Podcasts don't download if the files are all the same filename.

Bug #445141 reported by NoBugs! on 2009-10-07
This bug affects 6 people
Affects Status Importance Assigned to Milestone
rhythmbox (Ubuntu)
Robert Ancell
Robert Ancell

Bug Description

I noticed a podcast that wouldn't download correctly in Rhythmbox. They appear different, but each one was the exact same episode! I thought it was a problem at the server-side, but then I opened the feed in Firefox and found that Firefox could download the different episodes. Then I noticed the filename, and each and every filename had the same name, but in a different folder. I think this is why Rhythmbox wasn't updating, it looked and it saw "same filename, same filename" without looking at the folder part of the url. I'm pretty sure this is a bug in Rhythmbox.

tags: added: likely-dup
Pedro Villavicencio (pedro) wrote :

Thanks for the report, could you provide an example to the report? Thanks.

Changed in rhythmbox (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
importance: Undecided → Low
status: New → Incomplete
NoBugs! (luke32j) wrote :

As an example, try adding this podcast (or almost any other itunesU based podcast)
Now right click, download an episode, then right click another, download, repeat...
Notice that it says several episodes are downloaded, yet when you play them they are actually all the same one.
Also, go to the podcast's folder, it will only have one file, named enclosure.

Sebastien Bacher (seb128) wrote :

Robert could you have a look to this one?

Changed in rhythmbox (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → Robert Ancell (robert-ancell)
status: Incomplete → New
NoBugs! (luke32j) wrote :

I think the source of the problem is somewhere around line 764 of rb-podcast-manager.c.
local_file_name shouldn't be just the end file name, but the full url, otherwise all podcast downloads will overwrite the same "enclosure.mp3".

Daan Sprenkels (dsprenkels) wrote :

I had this bug too. And when I deleted the podcast, including all the files, Rythmbox crashed. Deleting Podcast excluding files went fine.

NoBugs! (luke32j) on 2009-11-01
Changed in rhythmbox (Ubuntu):
status: New → Confirmed
Changed in rhythmbox (Ubuntu):
status: Confirmed → Triaged
NoBugs! (luke32j) wrote :

Any progress on this bug? I noticed gPodder didn't have a problem with podcasts like this, can the gPodder downloader be integrated somehow into rhythmbox?

Jesse (sbjesse) wrote :

I've subscribed to SciAm 60-seconds science: http://rss.sciam.com/sciam/60secsciencepodcast
The feed contains URLs that are actually redirects, which is very common among podcasts. In RB 0.12.5 running on Karmic there's no problem: the saved file name is the final redirected name. In RB 0.12.8 running in Lucid, the saved file name is always podcast.mp3, lame!

Strangely enough, I tried doing this on Lucid:
$ sudo apt-get -t karmic install rhythmbox
trying to downgrade my RB. But the RB 0.12.5 installed this way still carries the bug ... I'm so confused!

NoBugs! (luke32j) wrote :

That 60-second science podcast breaks in rhythmbox, I also noticed the download meter shows 130% and above while it is downloading!? Then it doesn't show up as downloaded at all.

NoBugs! (luke32j) wrote :

I also tried disabling Rhythmbox plugins, that doesn't help... still have this problem in 10.04.

In Rhythmbox 0.12.8 On Ubuntu 10.04 I have the same problem with this podcast (French, about IT): http://podcast.bfmradio.fr/channel9/BFMchannel9.xml
Each episode consists of 2 files with the same name in the same folder. So only the first one is correctly downloaded and not the second one.

Changed in rhythmbox:
status: Unknown → New
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rhythmbox - 0.12.8git20100616-0ubuntu3

rhythmbox (0.12.8git20100616-0ubuntu3) maverick; urgency=low

  * 05_use_escaped_podcast_uri.patch:
    - Handle podcasts that have sound files with the same basename (LP: #445141)
 -- Robert Ancell <email address hidden> Tue, 22 Jun 2010 16:34:28 +1000

Changed in rhythmbox (Ubuntu):
status: Triaged → Fix Released
Robert Ancell (robert-ancell) wrote :

Proposing for Lucid:
- The change only affects new podcasts that are downloaded
- Test case:
1. Open Rhythmbox
2. Add http://deimos3.apple.com/WebObjects/Core.woa/Feed/cmu.edu.1335575211.01335575214 as a podcast (Ctrl+P)
3. Download 2 tracks in the podcast
4. Confirm the tracks are different (in the current version they will be the same)


diff --git a/podcast/rb-podcast-manager.c b/podcast/rb-podcast-manager.c
index c220bf2..c23c320 100644
--- a/podcast/rb-podcast-manager.c
+++ b/podcast/rb-podcast-manager.c
@@ -29,6 +29,7 @@
 #include "config.h"

 #include <string.h>
+#include <ctype.h>
 #define __USE_XOPEN
 #include <time.h>

@@ -790,9 +791,15 @@ download_podcast (GFileInfo *src_info, RBPodcastManagerInfo *data)

        if (local_file_name == NULL) {
- /* fall back to the basename from the original URI */
- local_file_name = g_file_get_basename (data->source);
- rb_debug ("didn't get a filename from the file info request; using basename %s", local_file_name);
+ char *c;
+ /* fall back to the escaped URI */
+ local_file_name = g_file_get_uri (data->source);
+ for (c = local_file_name; *c; c++) {
+ if (!isalnum (*c) && *c != '.')
+ *c = '-';
+ }
+ rb_debug ("didn't get a filename from the file info request; using escaped uri %s", local_file_name);

        /* if the filename ends with the query string from the original URI,

Changed in rhythmbox (Ubuntu Lucid):
assignee: nobody → Robert Ancell (robert-ancell)
importance: Undecided → Low
status: New → Fix Committed

Accepted rhythmbox into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
NoBugs! (luke32j) wrote :

Could not load the music database
The database was created by a later version of Rhythmbox. This version of Rhythmbox cannot read the database.

I get this error on the new lucid-proposed Rhythmbox, it always shows that error and reloads all music, and it doesn't show my previously subscribed podcasts. Other than that, it works, bug is fixed :)

Robert Ancell (robert-ancell) wrote :

@NoBugs!, did you try a development version of Rhythmbox? When you run a newer version it migrates the database to the new format, when you return to an older version you will get the error you saw.

NoBugs! (luke32j) wrote :

Yeah, I actually tried the package from Maverick 10.10 before I tried the Lucid-proposed. That must have been the problem. I went back to the old rhythmbox 0.12.8-0ubuntu6, I still get the "could not load the music database" error every time I run it.

NoBugs! (luke32j) wrote :

Removed the old database with:
rm ~/.local/share/rhythmbox/rhythmdb.xml
then it rebuilds the database, and works fine.
The lucid-proposed update works, those podcasts download correctly, thank you for fixing it :)

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rhythmbox - 0.12.8-0ubuntu7

rhythmbox (0.12.8-0ubuntu7) lucid-proposed; urgency=low

  * debian/control:
    - Update Vcs-Bzr link
  * debian/patches/07_use_escaped_podcast_uri.patch:
    - Handle podcasts that have sound files with the same basename (LP: #445141)
 -- Robert Ancell <email address hidden> Tue, 22 Jun 2010 17:06:19 +1000

Changed in rhythmbox (Ubuntu Lucid):
status: Fix Committed → Fix Released
Changed in rhythmbox:
importance: Unknown → Medium
Alexei Colin (alexei.colin) wrote :

The fix above seems to cover one case, but there's another that I just stumbled upon. The standard::copy-name attribute might not be set by the gvfs backend. In that case, currently, we fall back to edit-name attribute (and only if that's not set either -- to escaped URI). That causes the original undesired behavior that prompted this bug report: podcasts with non-unique file attributes/file names are unusable. Here's a real example:
$ gvfs-info http://computersciencepodcast.com/download-mp3/1/episode.mp3
display name: episode.mp3
edit name: episode.mp3
  standard::display-name: episode.mp3
  standard::edit-name: episode.mp3

A fix for this particular case could be to fall back to the escaped URI and not to edit-name attr when copy-name is not set (see trivial patch for this below). However, that wouldn't really cure the real issue: it would be nice if Rhythmbox were robust against non-unique file attributes (ie, even if they are set) and file names on podcasts. Of course, this is a problem of podcast creators, but it might still make sense to work around it, esp. since in the canonical Rhythmbox user doesn't care about filenames of saved podcasts at all. A patch for this is not included but seems simple as well -- just always use the current fall-back-to-URI path for the local filename.

Patch to not fall back on edit-name when copy-name is null (for real example above):

diff --git rhythmbox-0.13.0git20100819.orig/podcast/rb-podcast-manager.c rhythmbox-0.13.0git20100819.no-copy-name/podcast/rb-podcast-manager.c
index a972490..d195684 100644
--- rhythmbox-0.13.0git20100819.orig/podcast/rb-podcast-manager.c
+++ rhythmbox-0.13.0git20100819.no-copy-name/podcast/rb-podcast-manager.c
@@ -769,14 +769,7 @@ download_podcast (GFileInfo *src_info, RBPodcastManagerInfo *data)

        if (src_info != NULL) {
                data->download_size = g_file_info_get_attribute_uint64 (src_info, G_FILE_ATTRIBUTE_STANDARD_SIZE);
                local_file_name = g_file_info_get_attribute_as_string (src_info, G_FILE_ATTRIBUTE_STANDARD_COPY_NAME);
- if (local_file_name == NULL) {
- /* probably shouldn't be using this, but the gvfs http backend doesn't
- * set the copy name (yet)
- */
- local_file_name = g_strdup (g_file_info_get_edit_name (src_info));
- }

                g_object_unref (src_info);

lucacerone (lucacerone) wrote :

I'm using Rhytmbox 0.12.8 in a computer with Ubuntu 10.04 installed.
I installed Rhythmbox from the official repositories.
Today I've tried to add the following podcasts:
but the files are not downloaded with the right name
(for example file are saved as
instead of cbf-306-basic.mp3).
How can I get the right names working? I've read that the bug seems to be solved.
Cheers, -Luca

Alexei Colin (alexei.colin) wrote :

@Luca: I'm no authority on this but your situation looks strange. The filename you are seeing is constructed as a result of the patch that was submitted to fix the bug. However, for you podcast it shouldn't fall back to the "escaped uri" filename because gvfs-info reports that stardard::edit-name is set, which means edit-name should be taken as the filename (since copy-name is not set). I would look at the debug output when downloading any of those podcasts: run "rhythmbox -d".

Sidenote re my comment #19: it seems people do care about filenames. But handling podcasts with episodes with identical copy-name's (and/or edit-name's) still needs to be resolved. Perhaps a new bug needs to be submitted?

Changed in rhythmbox:
status: New → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.