Clean-up the database module for easier adding and
removal of columns to the podcast and episode tables.
Add time-related information (total time, position and
timestamp for the last position update) to episodes.
Remove the "deleted" column for podcasts and make sure
to remove all "deleted" podcasts and their episodes when
upgrading from an older version of gPodder.
Another attempt at finally fixing bug 340, but this time I'm pretty sure
that it works, because we are more selective now.
Whenever a new episode appears in the feed, its date is compared to the
date of the newest-known episode in the same feed. If it's more than one
week older than the newest-known episode, it's marked as old by default.
The "one week" value is just a randomly-chosen one to allow for border
cases (like a daily podcast re-issuing an episode of the last few days)
to work correctly and not cause "missing episodes".
The following command has been used:
grep -r '2005-2009 Thomas Perl and the gPodder Team' * | cut -d: -f1 |
xargs sed -i -e 's/2005-2009 Thomas Perl and the gPodder Team/2005-2010
Thomas Perl and the gPodder Team/g'
Episode that have not been downloaded (or have been
deleted since) and that do not appear in the feed are
now purged from the database after a feed update to
avoid the database getting filled with orphaned episodes.
Based on a patch by Neal Cox.
This adds a new checkbox in the "View" menu that allows
the user to hide all podcasts in the podcast list for
which the episode list is empty (probably because some
filter is active).
As long as the "Keep downloaded episodes" checkbox is
not checked, we now delete episodes and the podcast from
the database when unsubscribing from a podcast.
Thanks to slestak989 for reporting this issue.
This allows us to modularize the code later and control
which database object is given to which other object.
It should also allow for easier testing of code parts
because we could use a dummy database object instead of
the real one ;)
Currently for feeds updated in the last 24 hours, we
will try to intelligently skip feed updates based on
the expected publishing date of the next episode per
podcast.
Also, when the last feed updates is only 10 minutes
ago, the update is also skipped.
This might break a lot, but it makes feed parsing and
updating so much cleaner, and also helps with error
reporting, because exceptions are bubbled up to the UI.
Removed:
* Changing feed URL (this introduces too many problems)
* Support for FTP proxy servers (who uses FTP for podcasts?)
Fix a bug in gui.py (add URLs without scheme did not work).
Add is_new, is_downloaded and is_deleted as episode attributes.
Make the DB code less locking and don't complain about not being
able to write to the database when only trying to open it.
In order to be able to allow for a more generic access
to gPodder's data, we now provide a better CLI interface
that acts like apt-get/svn/git/... and an API module
that will allow developers to integrate gPodder functionality
into their Python applications.
Do not install gettext globally, but have a gettext
function in the gpodder module and import it from all
dependent modules.
Remove the --local command line option and instead
automatically detect if the gpodder script is called
from a source folder (determined by the existence of
"src" and "data" in the parent folder and by the fact
that prefix does not start with '/usr').
Clean up setup.py and use metadata from the module.
This happens for new versions of PySQLite that are available
with Python 2.6 (i.e. Ubuntu Jaunty).
Thanks to Fabian Scherschel and Tyler Rick for reporting this.
Refactor libpodcasts:
* Rename podcastChannel to PodcastChannel
* Rename podcastItem to PodcastEpisode
* Add a new base class with common functions for
PodcastChannel/PodcastEpisode
* Remove unneeded / orphaned functions and properties
Fix the buttons in the episode shownotes dialog when a
new episode finishes downloading by reloading the filename
from the database (so we can display the play button).
Fixed the "column url not unique" problem, got rid of an
unnecessary loop through all channels to find the one we
need to relocate.
Also, before the channel is updated from its new URL, old
episodes from this channel which haven't been downloaded
are deleted.
http://bugs.gpodder.org/show_bug.cgi?id=304
Transform the string comparison function for sorting
so that Umlauts (ä, ö, ü) are sorted in their respective
alphabetical position and not at the end of the list.
Hide the main window before starting vacuuming the
database, so it looks like shutdown is blazingly fast
while still allowing for optimizations to complete.
Fix problems with certain distributions/variants of
PySQLite that require collation names to be uppercase.
Thanks to Mehmet Nur Olcay for reporting this bug.
New episodes coming from feedparser no longer overwrite
the ones that are already in the database, but update
them properly, keeping states and file size.
Old episodes used to be kept in the database, but not displayed.
This patch removes all episodes beyond the max_episodes_per_feed
limit, which weren't downloaded.
channels_to_model() was issuing 3 SQL queries per channel to
get episode statistics (the number of downloaded, new and unplayed
episodes). This is now done with one query for all channels.
3 temporary views are created when the database is first open.
This not only affects the startup time, but also the time required
to finish a download, change settings -- everything that renews
the list of channels.
Changes to the database are only commited after a channel is added,
updated or when all downloads are finished, but not during episode
related operations. The threaded feed updater benefits the most
from this change.
Removed the LockingCursor subclass, added explicit
calls to cur.close() to avoid race conditions.
No more "library routine called out of sequence" errors.
Makes the SQLite interaction thread safe, required for threaded
feed updates and other threaded things that are coming. The changes
are completely internal and do not affect the usage. Also, some
commit() calls were removed (after selects, where they did nothing).
Always show downloaded episodes (Patch from Justin Forest)
* src/gpodder/dbsqlite.py: Include downloaded episodes even when they
go beyond the episode limit. e.g., when you have
gl.max_episodes_per_feed set to 10, but there are 20 downloaded ones
already. With this patch, all 20 episodes are displayed.
git-svn-id: svn://svn.berlios.de/gpodder/trunk@771 b0d088ad-0a06-0410-aad2-9ed5178a7e87
Support episodes without a guid during migration (patch from Justin Forest)
* src/gpodder/dbsqlite.py: Don't raise an exception if an episode is
missing a guid
* src/gpodder/libpodcasts.py: Make sure that episodes from LocalDBReader
always contain some kind of guid
git-svn-id: svn://svn.berlios.de/gpodder/trunk@757 b0d088ad-0a06-0410-aad2-9ed5178a7e87
Merge patch from Justin Forest and Thomas Perl:
- Use SQLite instead of cPickle to store all data, including feed summary
and entries, download and play history.
- Migration assistant to import the old cPickle files in to the SQLite DB
* src/gpodder/cache.py: SQLite-related accomodations
* src/gpodder/console.py: SQLite-related accomodations
* src/gpodder/dbsqlite.py: New file, SQLite interface for gPodder
* src/gpodder/gui.py: Lots of changes to accomodate the new SQLite
DB + new migration assistant code
* src/gpodder/libgpodder.py: Added gPodderLib.migrate_to_sqlite().
HistoryStore and ChannelSettings are marked as DEPRECATED
* src/gpodder/libpodcasts.py: SQLite-related accomodations and new
code for setting/determining episode state
* src/gpodder/sync.py: SQLite-related accomodations
* src/gpodder/trayicon.py: Use episode.was_downloaded() instead
of episode.is_downloaded()
* src/gpodder/util.py: SQLite-related accomodations
git-svn-id: svn://svn.berlios.de/gpodder/trunk@750 b0d088ad-0a06-0410-aad2-9ed5178a7e87