Index: channels/__init__.py ================================================================== --- channels/__init__.py +++ channels/__init__.py @@ -323,10 +323,11 @@ # called to early if not category: log.ERR("load(None)") return self.current = category + do_save = False # get data from cache or download if force or not category in self.streams: log.PROC("load", "update_streams") self.status("Updating streams...") @@ -338,22 +339,20 @@ # Postprocess new list of streams (e.g. assert existing title and url) if new_streams: try: new_streams = self.postprocess(new_streams) + do_save = True except Exception as e: log.ERR("Updating new streams, postprocessing failed:", e) # don't lose forgotten streams if conf.retain_deleted: self.streams[category] = new_streams + self.deleted_streams(new_streams, self.streams.get(category,[])) else: self.streams[category] = new_streams - # save in cache - self.save() - else: # parse error self.status("Category parsed empty.") self.streams[category] = self.nothing_found log.INFO("Oooops, parser returned nothing for category " + category) @@ -363,10 +362,14 @@ log.UI("load() → uikit.columns({}.streams[{}])".format(self.module, category), [inspect.stack()[x][3] for x in range(1,5)]) uikit.do(self.columns, self.prepare(self.streams[category])) if y: uikit.do(self.gtk_list.scroll_to_point, 0, y + 1) # scroll to previous position, +1 px, because # somehow Gtk.TreeView else stumbles over itself when scrolling to the same position the 2nd time + + # save in cache + if do_save: + self.save() # unset statusbar self.status()