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 451265 - cannot create playlist on ipod
cannot create playlist on ipod
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: iPod
0.11.x
Other Linux
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks: 338564
 
 
Reported: 2007-06-26 14:40 UTC by Sebastien Bacher
Modified: 2010-08-03 23:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (38.12 KB, patch)
2007-07-13 12:41 UTC, James "Doc" Livingston
none Details | Review
Update to latest svn (27.26 KB, patch)
2008-04-08 13:18 UTC, Christophe Fergeau
none Details | Review
Same patch as earlier with the missing files (39.09 KB, patch)
2008-04-10 09:11 UTC, Christophe Fergeau
committed Details | Review
Patch to flush DB (1.77 KB, patch)
2008-06-18 14:32 UTC, Colin Leroy
none Details | Review
Fix extra ref (430 bytes, patch)
2008-06-18 15:40 UTC, Colin Leroy
committed Details | Review
Better patch to fix the saving (2.76 KB, patch)
2008-06-19 10:21 UTC, Colin Leroy
committed Details | Review

Description Sebastien Bacher 2007-06-26 14:40:31 UTC
The bug has been opened on https://bugs.launchpad.net/ubuntu/+source/rhythmbox/+bug/117925

"Binary package hint: rhythmbox

rhythmbox 0.11.0-0ubuntu1, ubuntu gutsy

I cannot create playlists on my ipod, I have to use gtkpod. Is rhythmbox supposed to create playlists? It has very low support for ipods.."

It should also allow to delete a playlist when right clicking on it
Comment 1 James "Doc" Livingston 2007-07-13 12:41:09 UTC
Created attachment 91732 [details] [review]
patch

This lets you add new (static) playlists, and rename or delete existing ones. It also forces a DB save when quitting, so that you don't lose changes if you quit before the async save is run.
Comment 2 Christophe Fergeau 2007-07-14 12:26:42 UTC
Looks good to me, would be nicer to consolidate the code of RBiPodDB::dispose() and RBIPodDb::flush()

Why was this code removed ? 
-			/* The playlist was added to the iPod database, 
-			 * 'action' is no longer responsible for its memory 
-			 * handling
-			 */
-			action->playlist = NULL;
I assume this is because it was useless anyway?
Comment 3 Nicolò Chieffo 2008-03-03 12:37:59 UTC
any news from this feature?
Comment 4 Christophe Fergeau 2008-04-08 13:18:34 UTC
Created attachment 108858 [details] [review]
Update to latest svn

Patch updated to latest svn, there were just 2 really minor conflicts. I'll apply that patch soon if noone complains loudly
Comment 5 Jonathan Matthew 2008-04-10 09:04:30 UTC
This version of the patch is missing the new files (rb-ipod-static-playlist-source.{c,h}).  Assuming there were no changes in those files since the original version of the patch, it looks OK to me.
Comment 6 Christophe Fergeau 2008-04-10 09:11:15 UTC
Created attachment 108984 [details] [review]
Same patch as earlier with the missing files

Sorry for the missing files, here is an updated patch. I didn't touch the new files anyway, so they should be the same as in the original patch.
Comment 7 Christophe Fergeau 2008-06-14 16:21:22 UTC
I finally committed it in r5747
Comment 8 Colin Leroy 2008-06-18 14:32:42 UTC
Created attachment 112984 [details] [review]
Patch to flush DB

I find that the playlists aren't saved when exiting Rhythmbox or ejecting the ipod. Re-adding this patch fixes it, but may not be the correct fix.
Comment 9 Christophe Fergeau 2008-06-18 14:40:23 UTC
I think this patch works around an actual bug :

16:35 < teuf> when the ipod is ejected
16:35 < teuf> the ipod source is supposed to be destroyed
16:35 < teuf> and the rb-ipod-db object should be disposed at the same time
16:35 < teuf> and RbIpodDb::dispose has some code to sync the database
16:36 < teuf> I *think* that dispose method isn't called
16:36 < teuf> which probably means a ref on RbIpodSource or RbIpodDB is leaked 
              somewhere
16:36 < teuf> and I *think* without the playlist patch, things are working as 
              expected
Comment 10 Colin Leroy 2008-06-18 15:40:55 UTC
Created attachment 112990 [details] [review]
Fix extra ref

Fixes the real bug, an extra reference. Thanks to Christophe :-)
Comment 11 Christophe Fergeau 2008-06-18 17:56:23 UTC
Committed, thanks a lot for tracking it down.
Comment 12 Christophe Fergeau 2008-06-18 20:44:29 UTC
This patch wasn't correct, there's a ref missing on every RbIpodStaticPlaylistSource and there are g_warnings on the console because of that: when RbIpodDB is disposed, its Itdb_iTunesDB is freed as well, which triggers a g_object_unref on every RbIpodStaticPlaylistSource, but those source were already disposed so g_object_unref complains.

The heart of the problem is that every RbIpodStaticPlaylistSource holds a ref on RbIpodDb, and at the same time, the RbIpodDb holds a ref on every RbIpodStaticPlaylistSource (through the user_data member of the Itdb_Playlist contained in the Itdb_iTunesDB structure wrapped by RbIpodDB). This creates a ref cycle between those objects :-/ We probably can get away with it using a weak pointer to the RbIpodDb in RbIpodStaticPlaylistSource.
Comment 13 Colin Leroy 2008-06-19 10:21:51 UTC
Created attachment 113033 [details] [review]
Better patch to fix the saving

This patch reverts the incorrect previous one, and moves the unreffing from _dispose to _delete_thyself in RbIpodStaticPlaylistSource.
Comment 14 Christophe Fergeau 2008-06-20 18:12:29 UTC
Ok, should be properly fixed now, thanks for working on that nasty referencing bug :)
Comment 15 Charles P. Collins IV 2010-08-03 08:12:45 UTC
This bug still exists in 0.12.8

See

https://bugs.launchpad.net/ubuntu/+source/rhythmbox/+bug/496681

and

https://bugs.launchpad.net/rhythmbox/+bug/117925
Comment 16 Bastien Nocera 2010-08-03 08:16:18 UTC
(In reply to comment #15)
> This bug still exists in 0.12.8

That's not helpful. Test with the latest version, or ask your distribution to update it.
Comment 17 Charles P. Collins IV 2010-08-03 23:11:04 UTC
Tested with 0.13, still not fixed. Will try from git once I figure it out.