X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=psa_harmattan%2Ffeedingit%2Fpysrc%2Frss_sqlite.py;fp=psa_harmattan%2Ffeedingit%2Fpysrc%2Frss_sqlite.py;h=ff0fcbaf81b2b1769be669e344a59b7e5a75fed5;hb=3554380b7d321e3a75201ae65184a968ebd6084b;hp=867e1afd5ba342b33007e7781cdac0099b295760;hpb=2b167b1e0eb63677c018594eaf3a432687659e2d;p=feedingit diff --git a/psa_harmattan/feedingit/pysrc/rss_sqlite.py b/psa_harmattan/feedingit/pysrc/rss_sqlite.py index 867e1af..ff0fcba 100644 --- a/psa_harmattan/feedingit/pysrc/rss_sqlite.py +++ b/psa_harmattan/feedingit/pysrc/rss_sqlite.py @@ -814,17 +814,17 @@ class Feed(BaseObject): #ids.reverse() return ids - def getNextId(self, id, forward=True): + def getNextId(self, id, forward=True, onlyUnread=False): if forward: delta = 1 else: delta = -1 - ids = self.getIds() + ids = self.getIds(onlyUnread=onlyUnread) index = ids.index(id) return ids[(index + delta) % len(ids)] - def getPreviousId(self, id): - return self.getNextId(id, forward=False) + def getPreviousId(self, id, onlyUnread=False): + return self.getNextId(id, forward=False, onlyUnread=onlyUnread) def getNumberOfUnreadItems(self): return self.db.execute("SELECT count(*) FROM feed WHERE read=0;").fetchone()[0]