http://bugs.gpodder.org/show_bug.cgi?id=12





--- Comment #41 from Thomas Perl <[EMAIL PROTECTED]>  2008-06-20 09:33:38 ---
(In reply to comment #40)
> [...]
>   File "/home/paul/Source/gpodder-trunk/src/gpodder/gui.py", line 513, in new
>     old_episodes = self.get_old_episodes()
>   File "/home/paul/Source/gpodder-trunk/src/gpodder/gui.py", line 1451, in
> get_old_episodes
>     for episode in channel.get_downloaded_episodes():
>   File "/home/paul/Source/gpodder-trunk/src/gpodder/libpodcasts.py", line 237,
> in get_downloaded_episodes
>     return [episode for episode in db.load_episodes(self, factory=lambda c:
> podcastItem.create_from_dict(c, self)) if episode.is_downloaded and not
> episode.is_deleted and os.path.exists(episode.local_filename())]
> AttributeError: 'podcastItem' object has no attribute 'is_downloaded'

Yep, we have to get rid of that and query the state instead of the flag. Also,
we should probably move this into load_episodes as a parameter, so the
resulting SQL query will only load downloaded episodes. This way, we don't have
to fetch all episodes and also not instantiate all episodes, which should save
some cpu cycles.

something like this:

db.load_episodes(self, factory=lambda c: podcastItem.create_from_dict(c, self),
state=episode.STATE_DOWNLOADED)

If the "state" parameter is not given, simpyl return all episodes, independent
of state.


-- 
Configure bugmail: http://bugs.gpodder.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
_______________________________________________
gPodder-Bugs mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/gpodder-bugs

Reply via email to