After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 424086 - Put podcasts on the Podcasts playlist
Put podcasts on the Podcasts playlist
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Plugins (other)
HEAD
Other All
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 440197 476193 (view as bug list)
Depends on:
Blocks: 338564
 
 
Reported: 2007-03-29 11:26 UTC by Steven Walter
Modified: 2008-06-07 14:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implement podcast playlist support (2.25 KB, patch)
2007-03-29 11:33 UTC, Steven Walter
none Details | Review
Stash the playlist instead of iterating each time (2.33 KB, patch)
2007-03-29 17:18 UTC, Steven Walter
none Details | Review
Reintroduce mediatype constants (2.63 KB, patch)
2007-03-29 22:16 UTC, Steven Walter
needs-work Details | Review
Fix defines (2.73 KB, patch)
2007-03-30 00:22 UTC, Steven Walter
none Details | Review
Reposting patch from comment #5 (2.63 KB, patch)
2007-03-30 11:38 UTC, Steven Walter
committed Details | Review
Create the podcasts playlist if it doesn't exist (1.51 KB, patch)
2007-04-01 10:38 UTC, Christophe Fergeau
none Details | Review
Create podcasts playlist if it does not exist already. (1.52 KB, patch)
2007-04-03 00:46 UTC, Steven Walter
committed Details | Review

Description Steven Walter 2007-03-29 11:26:37 UTC
Currently, if a podcast is downloaded onto the iPod, it is only added to the master playlist.  If a user were to then look in the "Podcasts" menu of the            
iPod, it would be confusingly empty.  It would be better if rhythmbox automatically made it so that podcasts would appear on the "Podcasts" menu.
Comment 1 Steven Walter 2007-03-29 11:33:11 UTC
Created attachment 85511 [details] [review]
Implement podcast playlist support

Add podcasts to the podcasts playlist so that they appear on the proper menu on the ipod.
Comment 2 Steven Walter 2007-03-29 17:18:50 UTC
Created attachment 85521 [details] [review]
Stash the playlist instead of iterating each time

Don't iterate to find the playlist each time add_to_podcasts is called, as suggested by Christophe and James
Comment 3 Christophe Fergeau 2007-03-29 18:12:36 UTC
The patch looks fine to me now, though I have 2 questions for people more knowledgeable in rb internals ;)

* is rhythmdb_entry_get_pointer (entry, RHYTHMDB_PROP_TYPE) the best way to get the type of a RhythmDBEntry, or is there some nicer way?

* the podcast is added to the rb playlist using rb_static_playlist_source_add_location (rbpl, filename, -1); in add_to_podcasts. Given that in the function calling add_to_podcasts, we have a RhythmDBEntry available corresponding to that filename, would it be better to use rb_static_playlist_source_add_entry instead?
Comment 4 Christophe Fergeau 2007-03-29 18:43:03 UTC
Grumble, just found another issues :-/ The ITDB_MEDIATYPE_AUDIO and ITDB_MEDIATYPE_PODCAST constants I recommended using aren't available in the latest libgpod release, so it might be better to define our own constants as you did in your initial patch for now.
Comment 5 Steven Walter 2007-03-29 22:16:42 UTC
Created attachment 85540 [details] [review]
Reintroduce mediatype constants

I noticed that the constants were only in cvs (is why I didn't use them in the first place), but figured that it was okay.

In any case, constants are back, and I fixed a bug in the previous code (I use "itdb_playlist" in one place and "itdb-playlist" in another)
Comment 6 Bastien Nocera 2007-03-29 22:20:44 UTC
Comment on attachment 85540 [details] [review]
Reintroduce mediatype constants

<snip>
>+/* FIXME:  these should go away once we compile against new-enough libgpod */
>+#define MEDIATYPE_AUDIO         0x0001
>+#define MEDIATYPE_PODCAST       0x0004

This should obviously be:
#ifndef MEDIATYPE_AUDIO
#define MEDIATYPE_AUDIO         0x0001
#endif
etc.
Comment 7 Steven Walter 2007-03-30 00:22:58 UTC
Created attachment 85549 [details] [review]
Fix defines

Obviously.
Comment 8 Christophe Fergeau 2007-03-30 07:29:55 UTC
The constants in libgpod are defined as an enum:
typedef enum
{
    ITDB_MEDIATYPE_AUDIO      = 0x0001,
    ITDB_MEDIATYPE_MOVIE      = 0x0002,
....
};
so I'm not sure at all they will be caught by the #ifndef, does anybody know if they will? Otherwise, the patch from comment #5 is probably better. Sorry Steven for having you modify again and again your patch :-/
Comment 9 Steven Walter 2007-03-30 11:38:50 UTC
Created attachment 85558 [details] [review]
Reposting patch from comment #5
Comment 10 James "Doc" Livingston 2007-04-01 08:22:25 UTC
This works fine for me, and I've committed it to svn trunk (with a few code-style fixes, like using tabs to indent instead of spaces). Thanks.
Comment 11 Christophe Fergeau 2007-04-01 10:38:09 UTC
Sorry to reopen that bug, but this seems more appropriate here than in a new bug, here is a patch to create the podcasts playlist on the ipod if it doesn't exist.
Comment 12 Christophe Fergeau 2007-04-01 10:38:53 UTC
Created attachment 85644 [details] [review]
Create the podcasts playlist if it doesn't exist
Comment 13 James "Doc" Livingston 2007-04-01 10:47:19 UTC
Looks fine to me.
Comment 14 Steven Walter 2007-04-02 14:51:05 UTC
The patch seems to be incorrect to me.  For one thing, priv->podcast_pl is of type RBStaticPlaylistSource, so assigning the Itdb_Playlist to it is wrong.  Second, podcast_pl gets set by add_rb_playlist, which is called immediately before it.  Removing that assignment should render the patch correct, however.

Just to be particular, it's not necessary to declare a second Itdb_Playlist variable in the if statement; ipod_playlist could be used.  In fact, if it were done this way, the call to g_object_get_data could be put in an else clause and avoided in some cases.
Comment 15 Christophe Fergeau 2007-04-02 15:00:03 UTC
(In reply to comment #14)
> The patch seems to be incorrect to me.  For one thing, priv->podcast_pl is of
> type RBStaticPlaylistSource, so assigning the Itdb_Playlist to it is wrong. 
> Second, podcast_pl gets set by add_rb_playlist, which is called immediately
> before it.  Removing that assignment should render the patch correct, however.

Yep, dunno why this assignment is still there, I compile-tested this patch, so I'm pretty sure I got rid of it.
Fwiw, this assignment is a left-over of the patch from http://bugzilla.gnome.org/show_bug.cgi?id=425117#c2 (initially, I had written the patch attached to that bug on top of the patch in this other bug, then I changed it so that it applies to svn trunk, and I screwed up :p )

> 
> Just to be particular, it's not necessary to declare a second Itdb_Playlist
> variable in the if statement; ipod_playlist could be used.  In fact, if it were
> done this way, the call to g_object_get_data could be put in an else clause and
> avoided in some cases.

Yep, good point for reusing ipod_playlist. I don't feel it's necessary to make the code slightly harder to read to get rid of the g_object_get_data. 

Comment 16 Steven Walter 2007-04-03 00:46:11 UTC
Created attachment 85739 [details] [review]
Create podcasts playlist if it does not exist already.

 plugins/ipod/rb-ipod-source.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
Comment 17 Steven Walter 2007-04-03 00:46:54 UTC
Comment on attachment 85739 [details] [review]
Create podcasts playlist if it does not exist already.

Address the two deficiencies of the previous patch
Comment 18 Christophe Fergeau 2007-04-03 06:58:34 UTC
Ah thanks for the update :)

Any reason why you put the podcast playlist as the second playlist on the ipod instead of letting libgpod deal with it? (I'm referring to the itdb_playlist_add_track (ipod_playlist, song, 1) call). I don't care either way, I'm just curious if it's something that must be done or if you just feel it's better that way.
Comment 19 Steven Walter 2007-04-03 11:02:40 UTC
There is indeed a reason.  I was having some trouble getting the Podcasts playlist created by rhythmbox recognized on my iPod.  I noticed that before I removed it, it was the second playlist, so I tried forcing it to be second.  I think my primary problem was something else, but it is working now, and is the second playlist.
Comment 20 Christophe Fergeau 2007-04-03 11:13:30 UTC
Ok, thanks for the explanation :) gtkpod uses -1 when it adds a new playlist, so it probably doesn't matter, but yeah, it makes sense to put it at 1 and might be safer.
Comment 21 Christophe Fergeau 2007-04-03 17:55:45 UTC
Committed to CVS, thanks for the updated patch.
Comment 22 Christophe Fergeau 2007-05-21 15:11:42 UTC
*** Bug 440197 has been marked as a duplicate of this bug. ***
Comment 23 Susana 2008-06-07 14:03:29 UTC
*** Bug 476193 has been marked as a duplicate of this bug. ***