Symlinks cause files to be added to the library multiple times

Bug #406050 reported by Thomas Zander
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
Low
Unassigned
Nominated for 0.3.x by Thomas Zander

Bug Description

This affects exaile-0.3.
I happen to organise a few files in my library using symlinks. These files get imported as different files several times when the collection is scanned. When I drop a file which exists (due to this issue) several times in exaile's collection onto a new playlist, it gets added multiple times: Once for each link in the watched folders tree that points to the file, and it's not possible to add a file like this only once.
The attached tiny patch resolves this problem by ignoring symlinks to files when a collection is scanned.

Revision history for this message
reacocard (reacocard) wrote :

hm, this is somewhat tricky, since ignoring links means that people who use symlinks to merge in parts of their collection (eg. if its spread across multiple partitions) would lose functionality. Perhaps its best to simply follow the link, and if it results in a path inside the library root, we ignore it, and otherwise treat it normally.

Changed in exaile:
importance: Undecided → Low
milestone: none → 0.3.0
status: New → Confirmed
Revision history for this message
Thomas Zander (thomas-e-zander) wrote :

First, I thought about this too and thought about writing a longer patch. However, due to exaile's capability of using several locations for the music library, I would not expect regression as these users could simply add subfolders on the other partitions to their collection location list. That's why I suggested this tiny change.
However, it's not set in stone. If you believe that checking the link target and include it if it is not in the same library root is the way to go, I will rework my patch appropriately and resubmit. I'd really appreciate a solution for this issue before 0.3 is released and I am happy to write patches. It's fun if it has the chance of getting committed :-)

Revision history for this message
reacocard (reacocard) wrote :

> However, due to exaile's capability of using several locations for the music library, I would not expect regression as these users could simply add subfolders on the other partitions to their collection location list. That's why I suggested this tiny change.

While that is true, you'll still get some users who are very confused as to why it doesn't work with the way they already had it set up. Thus I think checking the link target is a better solution, since it resolves the bug without impacting other use cases in the slightest.

Revision history for this message
Thomas Zander (thomas-e-zander) wrote :

That's fine with me. I have changed the patch such that the link target is compared to the library location. Please have a look if that's what you had in mind.

Revision history for this message
reacocard (reacocard) wrote :

Patch committed in r2267, thanks!

Changed in exaile:
status: Confirmed → Fix Committed
reacocard (reacocard)
Changed in exaile:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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