Commit graph

800 commits

Author SHA1 Message Date
Justin Forest
661a4381e1 Split util.get_episode_info_from_url() for code reuse.
The part that issues different requests depending on the
availability of a proxy server is now reusable.
2008-10-14 19:12:21 +02:00
Justin Forest
ad7310c9dc Change the way episodes are saved after being downloaded.
Instead of using db.mark_episode(), we now use mark_downloaded()
2008-10-14 19:01:37 +02:00
Justin Forest
7fee669127 Add support for SQL module logging
Must be enabled in advanced settings, with the log_sqlite option.
2008-10-14 18:56:52 +02:00
Justin Forest
e07d7810ab Properly update existing episodes (bug 211)
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.
2008-10-14 18:55:28 +02:00
Justin Forest
f5a00b19e1 Purge old episodes before updating the channel.
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.
2008-10-14 18:55:11 +02:00
Justin Forest
a0b009ba5d Improved startup time by minimizing the number of SQL queries.
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.
2008-10-14 18:54:33 +02:00
Justin Forest
6ddb4b5441 Performance fix for the main episode list.
When the list of episodes for a channel was displayed, all episodes
were loaded with a single query, then loaded separately by one
inside podcastItem.iter_set_downloading_columns().  This patch
fixes this problem, the TreeModel is built with only one SQL query.

On the same machine a TreeModel for 50 episodes was displayed in
1.915531 seconds, with this patch: 0.236303 (8 times faster).
2008-10-14 18:39:15 +02:00
Justin Forest
024094559b Stop looking for episodes marked as deleted that still exist in fs.
If an episode is marked as deleted but the corresponding file somehow
still exists in the file system, this code was "resurrecting" the
episode, and vice-versa for downloaded episodes that lack their files.
Questionable behaviour, because a situation like that can only mean
an error somewhere, and this code was just making it harder to track
the real problem, and added unnecessary FS interaction.
2008-10-14 18:38:57 +02:00
Justin Forest
c2db36d697 Improve performance by minimizing commits.
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.
2008-10-14 18:38:38 +02:00
nikosapi
e0b84d2290 Make gPodderChannel callback use only_selected_channel 2008-10-14 18:37:58 +02:00
nikosapi
77875ee3d3 First step in reducing unneeded full refreshes of treeChannels
libpodcasts.py: Moved a bunch of code from channels_to_model to
update_channel_model_by_iter, a new method which allows updating of
individual iters in a model.

gui.py: Added only_selected_channel option to updateComboBox which makes it
only update the selected channel's iter. This saves a bit of time when doing
simple tasks like marking an episode as played. So far only playback_episode
and for_each_selected_episode_url take advantage of this option.
2008-10-14 18:37:52 +02:00
Justin Forest
d21ec069b5 Correct HTML feed auto-detection (bug 215)
It lets feedparser detect the feed type, instead of
guessing on headers. Thanks to Edouard Pellerin for
reporting this bug.
2008-10-09 20:32:23 +02:00
Thomas Perl
ff787ff2dc Update list of contributors in About dialog
Update list of code contributors and donators to gPodder
in the about dialog.
2008-10-09 20:24:57 +02:00
Bill Peters
0d62e80cb7 Set genre to "Podcast" when "update tag after download" is enabled
For me this is very useful. It eliminates the need to create a
playlist or open EasyTag to edit the genre.

Using this option I just transfer to my player and select the genre
Podcast to view all my synchronized podcasts.
2008-10-07 19:39:37 +02:00
Thomas Perl
b3c37934b3 gPodder 0.13.0 "A Thing About Machines"
Updated README, version info in bin/gpodder and manpage.
Removed icon conversion in Makefile.
Refresh messages.pot and all translation files.
Don't resize gPodder icon in the about dialog.

Enjoy this new feature-packed release of gPodder :)
2008-10-06 20:48:08 +02:00
Thomas Perl
14e9141802 Refreshed version of the gPodder "green man" icon
Updated the look of gPodder's "green man" icon in all
sizes (16, 22, 24, 26, 40, 48, 64) and add the SVG
sources for the smaller-size icons as developer docs.
2008-10-06 20:33:45 +02:00
Thomas Perl
a496bf1888 Updated German translation 2008-10-05 11:51:16 +02:00
Jérôme Chabod
cfee474ba6 Updated French translation 2008-10-04 12:51:57 +02:00
Leonid Ponomarev
e3657eb754 Updated Russian translation 2008-10-04 12:51:18 +02:00
Thomas Perl
097ab04f62 Auto-discover RSS/Atom feeds from HTML pages (bug 201)
For text/html content types, try to discover the correct
RSS/Atom feed URL by looking at the <link> meta elements
and getting the feed URL from that. If that fails, or if
there are not <link> meta elements, make sure that the UI
code can display the "This URL is a website" message box
that will allow the user to open a web browser window to
search for the feed URL manually.

Based on a patch by Justin Forest.
2008-09-30 22:07:06 +02:00
nikosapi
ad90b685c3 Make the OmplLister work with the threaded channel adder
gui.py: Add "block" keyword argument to add_new_channel which essentially
makes the channel adder behave like the old, non-threaded version. Without
this, when adding channels from the OPML lister the new episodes window
shows that there is nothing to download.
2008-09-30 20:42:48 +02:00
Sebastian Krause
079fe886e7 Make automatic iPod episode deletion work (bug 168)
Just citing the discussion between me and nikosapi in #gpodder:

16:56 <sheskar> nikosapi: I've looked into bug #168.
16:57 <sheskar> nikosapi: I guess the problem is that in _track_on_device() in
sync.py we check if a podcastItem is equal to a string.
16:59 <sheskar> I don't know exactly how to fix it, though.
17:47 <nikosapi> sheskar: change line 218 from "return
self._track_on_device(episode)" to "return
self._track_on_device(episode.title)"
2008-09-28 09:27:43 +02:00
Anders Kvist
3100609571 Updated Swedish translation
Updated data/po/sv.po in preparation for the 0.13.0 release.
2008-09-28 08:44:18 +02:00
nikosapi
35b329409e Workaround for gtk.ImageMenuItem on Ubuntu 8.10
gui.py: Don't use the get_children function, instead use get_child for the
gtk.AccelLabel and get_image for the gtk.Image
2008-09-28 08:40:58 +02:00
Thomas Perl
b4325c29f4 Allow tab switching with Ctrl + Page Up / Page Down
Allow switching the notebook tabs in the main window by
pressing Ctrl + Page Up and Ctrl + Page Down.

Thanks to Justin Forest for suggesting this feature on
the gpodder-devel mailing list.
2008-09-27 14:20:43 +02:00
Sebastian Krause
9c6b855330 Open menu entries with the keyboard (Alt + Letter)
Unfortunately it's currently not possible to open the menu entries
with Alt+Letter (except "Help"). The attached patch fixes that for
the main entries.
2008-09-27 14:09:46 +02:00
Silvio Sisto
5328c468f4 Updated Spanish translation
Updated Spanish translation. Added Silvio Sisto to list
of contributors in src/gpodder/gui.py
2008-09-27 14:07:06 +02:00
Thomas Perl
e12884e0fd Update gettext templates for 0.13.0 preparations
Updated messages.pot and all *.po files, for translators
to update their translation files for the 0.13.0 release.
2008-09-24 10:57:29 +02:00
nikosapi
b78cdd2920 Make the channel adder threaded (Bug #114)
gui.py: Split up the add_new_channel function to allow threading
2008-09-24 09:41:05 +02:00
Justin Forest
8b4bdc092a Fix for the threading issue (bug 185).
Removed the LockingCursor subclass, added explicit
calls to cur.close() to avoid race conditions.
No more "library routine called out of sequence" errors.
2008-09-22 15:21:23 +02:00
Thomas Perl
196d467a5c Fix problem when updating feed cache on startup (bug 183)
With the new threaded feed cache updater, we only want to
set the color in our ListStore of channels when the model
is available already. This isn't the case on startup.

Thanks to Bernd Schlapsi for reporting this bug on Bugzilla.
2008-09-10 18:07:39 +02:00
Thomas Perl
42d84e911e Better confirmation dialog when deleting episodes from device
Reword the confirmation dialog when deleting episodes from
iPods and MP3 players, so the user knows that the episodes
are only going to be removed from the device, and not from
the gPodder library.

This change has been suggested in the May 2008 User Test.
2008-09-10 16:11:44 +02:00
Thomas Perl
452b2d8a08 Add success message dialog on OPML file export
When exporting the subscription list to an OPML file,
show a success message with the number of podcasts exported,
so the user knows that everything went well.

This change has been suggested in the May 2008 User Test.
2008-09-10 16:02:06 +02:00
nikosapi
15a7bd56eb Threaded feed updater (bug 153)
This changeset is based on gPodder-r777-threaded-feed-updater.patch, plus:

config.py: Add new config option 'max_simulaneous_feeds_updating'. By default
it's set to 3, otherwise on slower devices the gui might become un-responsive
during an update because of the CPU resources required by python-feedparser.
Add 'color_updating_feeds' option for users that want to manually set it.

gui.py: Make channels that are updating a different color, this gives the user
a better idea of what's going on. Populate the update progress bar with a
message and clear the previous fraction setting before starting a feed update.
Colors dict for feed updates, default color is "None", so we don't need to do
any fancy color detection (for all different GTK themes).

libpodcasts.py: Make the channel's iter available as podcastChannel.iter.
Don't use the <span foreground=...> markup tag to set the channel's text
color, use the gtk.CellRendererText 'foreground' attribute. This allows
the text color to be easily changed by modifying the channel model.
Require the colors dict to be passed to channels_to_model.

For Maemo, add "Update selected podcast" menu item to the Subscriptions menu,
because the context menu isn't easily reached at the moment (no right-click).
2008-09-10 15:21:38 +02:00
Thomas Perl
9d8b9baaaf Fail if gpod is not available in iPod sync (bug 179)
Make iPodDevice in gpodder.sync fail if libgpod is not
available (i.e. not installed) by checking if gpod is
available. If not, don't try to open the iPod.

Thanks to Vincent for reporting this in our Bugzilla.
2008-09-07 16:44:09 +02:00
nikosapi
99c4c54fc9 Make self.minimized work on Maemo (bug 175)
On Maemo, gtk.gdk.WINDOW_STATE_ICONIFIED doesn't seem to work but
gtk.gdk.WINDOW_STATE_WITHDRAWN works pretty well. With this change
if the gPodder window is minimized to the tray (hidden) then the
self.minimized flag is set to true.

(Without this, auto-update doesn't work reliably)
2008-09-03 14:02:43 +02:00
Matt Baker
d04c533b5d Semantic sorting in episode selector (bug 161)
Add support for sort columns in the gPodderEpisodeSelector.
If a sort attribute is specified, it will create a hidden sort column.

This patch also changes each call to this episode selector.
2008-09-01 21:35:39 +02:00
Jérôme Chabod
15e694be30 Support for MTP device synchronization (bug 9)
Support devices that use the Media Transfer Protocol.

Adds "python-pymtp" as optional dependency if the user
wants MTP device synchronization.
2008-09-01 21:26:35 +02:00
Thomas Perl
1da963dd08 Improve slash and duplicate episode name handling in gdfs (bug 170)
Replace the forward slash ("/") in the channel and episode
title with a dash ("-") to prevent episode title text from
being stripped.

Apply a modified version of a patch by Mel Jay to fix problems
with duplicate episode names, and try to find free names when
the filename already exists.

Thanks to Mel Jay for reporting this bug in gPodder Bugzilla
2008-08-22 23:50:27 +02:00
Thomas Perl
7d55853787 Make gdfs-init work again (load_channels argument error)
gdfs-init.py has stopped working because of the changes
in load_channels, from the SQLite changes. This makes the
gdfs-init.py script work as expected.
2008-08-22 23:35:58 +02:00
Thomas Perl
4d9328a0eb Do not try to load invalid/empty RSS image tag (bug 169)
Fix problem when the image item in an RSS feed does not
contain a valid link to the image by checking for the
existence of the image link before trying to access it.

Bug reported by Adam on the gPodder Bugzilla
2008-08-17 15:16:24 +02:00
Thomas Perl
abe149c73a Fix problem with title setting on Maemo
When getting the title of the main window initially,
it has the value "None" on Maemo. Fix this by checking
for this value and using "gPodder" instead.
2008-08-11 18:00:10 +02:00
Thomas Perl
46de7bfe0c Detect and report HTTP errors when downloading (bug 106)
The FancyURLopener by default ignores HTTP errors and
downloads the HTTP error page without letting the calling
code know. We override the method and report the error
in our subclass, so we can provide feedback to the user
in the logfile and in a message dialog.

This bug has been reported by Markus Golser
2008-08-10 14:38:20 +02:00
Thomas Perl
e5460ab8d9 Fix large negative values for download progress (bug 160)
When downloading an episode, and the urllib progress
callback reports a totalSize of "-1", gPodder would show
large negative values for the download progress. This is
fixed by using the size reported by the feed in this case
and also adding some sanity checks (progress between the
values 0 and 100) and spitting out warnings in case of
problems.

This bug has been reported by Heinz Erhard
2008-08-09 17:16:23 +02:00
Thomas Perl
14a4dc7687 Fix argument count error when activating an episode
The on_treeAvailable_row_activated function had some of
its parameters removed in one of the last commits, which
prevents the preferences dialog from opening when double-
clicking an episode in the available episode list.
2008-08-09 13:34:38 +02:00
nikosapi
2c3d3865df Once a download is complete, save the real, on-disk filesize 2008-08-08 09:44:23 +02:00
Justin Forest
71144243c8 Thread safe SQLite interaction
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).
2008-08-07 15:05:36 +02:00
Justin Forest
55dd7cbb2b Case-insensitive channel sorting
Implemented as a custom collation because the only collation
supported by SQLite natively is binary, which is case-sensitive.
2008-08-07 15:05:27 +02:00
Thomas Perl
cd2771928d Clean up gui.py (download, playback and transfer button handling)
Cleanup and simplify the on_treeAvailable_row_activated handler
and make sure we have simpler code paths that are easier to maintain.
2008-08-05 14:56:58 +02:00
Thomas Perl
d000a1f2db Use "Open" instead of "Play" for non-media episodes (bug 18)
When a non-audio and non-video podcast episode is selected,
we now replace all "Play" buttons/items with an "Open" button
or item, so opening PDFs and non-media files in podcasts is
more straightforward (you "open" a PDF, you don't "play" it).

Original request from Stefan Lohmaier, gPodder bug 18
2008-08-04 23:26:51 +02:00