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 432909 - Rhythmbox treats directory with two symlinks as two directories
Rhythmbox treats directory with two symlinks as two directories
Status: RESOLVED OBSOLETE
Product: rhythmbox
Classification: Other
Component: general
0.10.0
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 519845 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-04-24 10:01 UTC by Sebastien Bacher
Modified: 2018-05-24 12:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastien Bacher 2007-04-24 10:01:18 UTC
The bug has been opened on https://bugs.launchpad.net/bugs/108493

"Binary package hint: rhythmbox

I just upgraded to Feisty (7.04) and started rhythmbox for the first time. Auto-check for new files within the library was set, and many many entries have been doubled, though I didn't add one single file to the library.

Looking into the library I realized, there was no change in the files, just the entries in the rhythmbox library got doubled.
...
http://librarian.launchpad.net/7380136/screenshot.png
screenshot
...
I symlinked my music library from within my /home. I use the symlink as the reference to the library in rhythmbox.
But I did that months ago... Why did it add the duplicate entries now, after the upgrade???
..."
Comment 1 Leif Walsh 2007-08-22 18:54:15 UTC
Confirmed on gutsy.

I have
/home/leif/storage -> /media/storage
/home/leif/Music -> ./storage/music

My library path is set to /home/leif/Music, but at some point in the past, watch for new files didn't work, so I manually added /home/leif/storage/music.  Later on, it went through and scanned /home/leif/Music, and now there are two copies of everything.

There should also be a "reset library" or "remove paths from current library" function available.  If there is, someone mail me about my stupidity.
Comment 2 Jonathan Matthew 2008-03-02 03:50:01 UTC
*** Bug 519845 has been marked as a duplicate of this bug. ***
Comment 3 Robert Ancell 2009-04-20 07:40:24 UTC
To reproduce:
1. Log into guest session
2. Open Rhythmbox and set Edit>Preferences>Music>Watch my library for new files
3. Create the symlink, and watch two track being added:
$ ln -s /usr/share/example-content/ ~/Music/A
4. Create the symlink, and watch the same tracks being added:
$ ln -s /usr/share/example-content/ ~/Music/B

Note it doesn't seem to occur if you create symlinks directly to the files.

I'm not too sure where in the Rhythmbox source to fix an issue like this, please give pointers.

My guess is to make this work properly each track in the database would have to have a non-linked path to the file and a list of paths referencing it (in this case two).
Comment 4 Jonathan Matthew 2009-04-21 11:59:12 UTC
I think any solution that involves identifying symlinked paths that refer to the same file is going to be too complex.  What are the use cases that we're trying to support here?

How far would we get by just ignoring all directory symlinks?
Comment 5 Robert Ancell 2009-04-23 02:08:28 UTC
Based on the Ubuntu report the case the user had was:
1. The have their music available to all users on a separate partician (/mnt/music)
2. They manually imported this folder to Rhythmbox when they first used it.
3. Some time later they then symlinked ~/Music/shared to /mnt/music and then selected the "Watch my library" checkbox.

The result was their entire music collection was duplicated in the database.

I've tested this case with Rhythmbox 0.12.0.

Removing the symlink does not cause the duplicate entries to be removed immediately.  They were removed after restarting Rhythmbox however.

I think the normal use case would be not to do step 2 above - in this case you would want the symlink to be followed.

What would be nice in step 3 is for each new file that was detected the symlink was expanded and checked if it was already in the database.
Comment 6 Robert Ancell 2009-04-23 02:13:32 UTC
Actually re-reading the Ubuntu report shows their case was they replaced ~/Music with a symlink to /mnt/music - this would be fixed by expanding the symlinks to absolute paths.
Comment 7 Robert Ancell 2009-04-23 02:15:14 UTC
Note also in all these cases is these files are always exactly identical and could be checked by MD5 sum or similar.
Comment 8 Jonathan Matthew 2009-04-23 02:20:29 UTC
MD5 sum isn't generally useful for detecting duplicates, and it's horrendous overkill for this specific case.

The normal use case would be to add /mnt/music as a secondary library location (bug 523162), not to make symlinks.
Comment 9 Robert Ancell 2009-04-23 04:42:26 UTC
Users won't necessarily manage ~/Music as a Rhythmbox resource - they'll expect Rhythmbox to access files in the same way that nautilus will and potentially use it for other programs too.

I'm not sure what bug 523162 is referring to, is it to have multiple locations to import from?  e.g. in the above case ~/Music and /mnt/music?

This would have helped the Ubuntu user as AFAIK Rhythmbox has no record of /mnt/music being added to the database and no method to remove it now the symlink has been created.
Comment 10 Kamil Páral 2009-06-16 15:47:37 UTC
I have also problems with this bug, many songs are duplicated in my library because of symlinks (which I want them to be there). Is it a hard solution to use system calls to resolve symlinks to absolute paths? Seems easy to me and you can easily compare duplicate songs.
Comment 11 Dean Boulding 2011-04-12 05:07:31 UTC
Please mark this confirmed.

I have duplicate entries as well, and it seems to me to be very confusing behaviour.  I have selected a directory for my music and pointed rythmbox to it, but it insists on also displaying music from my previous selections.  This isn't expected, at least by me -- I would expect to only have the selected directory (or directories, even better) available and displayed.

My case:
Configuration 1:  smb mounted remote directory (for initial testing).  Rythmbox displays everything one time.

Configuration 2:  made symlink to smb://remotemachine/musicdirectory under /home/me/Music and pointed rythmbox there.  I now have two copies of everything displayed in rythmbox.

Configuration 3 (troubleshooting/fixing):  Added one directory of a few songs under /home/me/Music.  The new songs appear one time only, everything else twice.  This is unchanged even if I point rythmbox to only this one new directory.  Checking .gnome/apps/rythmbox/%gconf.xml confirms that it is only looking in one directory.

It may be that I am misunderstanding the developers' intentions, it that is to have everything ever added available and displayed.  This is most definitely not what I expect, and I can't think of any other app that works this way.  Keep non-available but added songs in the database, if you like, but don't display them would be my suggestion.
Comment 12 van.de.bugger 2012-12-13 21:39:49 UTC
I am using symlinks to organize my music library. For example, if an album recorded by two artists "A & B", I will save album in A's directory and symlink it to B's directory. Unfortunately, within rhythbox all the tracks of that album are doubled.

Suggestion made by Kamil Páral looks quite simple to implement.
Comment 13 GNOME Infrastructure Team 2018-05-24 12:32:41 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/365.