You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While scanning my library in a symlinked folder cmus constantly finds duplicate files, like this:
Sometimes there are only two of them, other times three or even four (like in this example).
I probably do have some duplicate files, but it finds duplicates for practically every file, which is impossible — I have searched for many of supposedly duplicate files and found only one of each. I am unsure what info I should provide to clarify the issue :(, so please ask questions if you care to help.
Darwin Kernel Version 15.3.0, cmus v2.7.1
On the other note, how am I supposed to deal with duplicates anyway? I read the man, but couldn't find any way to display, e.g. the file path of the selected file (in pane 1). Duplicates make listening in album mode difficult. Have you considered providing the user with some option to deal with them, e.g. delete the duplicates, or add an additional level of grouping (e.g file path) that would remove the duplicates?
@z3t0 Wouldn’t they be re-added if I add new music to library and then refresh cache?
Anyway, looks like I found the original problem — symlinked folder was the culprit. If I added the folder by its real path, obsolete duplicates didn’t occur.
Still unsure how to deal with legitimate duplicates though.
But that would impose a folder structure (Artist/Album/Track) which I think you should definitely not do.
If there are different albums/singles named the same for one artist, then I think that's the actual problem. I personally would try to make this clear from the metadata and call them "Name" and "Name (Single)".
I do not think this approach imposes anything: the user is free to choose whatever folder structure suits him better. I propose that the path/folder structure be used only as a last means for disambiguation, in the cases where all metadata for files is identical. It is also convenient because file paths are already stored in the library, so you do not need to cache any more data.
Before grouping by folder path, other levels of grouping may be added to solve the same problem, e.g musicbrainz ID. However, this approach has the aforementioned disadvantage of needing to cache more data.
Ok, but in my opinion "conditional disambiguation" is not desirable.
Apart from that, using the location for distinction purposes goes a bit against the idea of a media library.
in my opinion "conditional disambiguation" is not desirable
Could you please elaborate why? I am genuinely interested. I understand the controversial ideological grounds, but I can’t see any drawbacks from a UX perspective.
Well, thats a purley personal view, but I like to have one defined behaviour (yes, you could argue that this is still well-defined).
I would certainly be at least surprised (if not confused) if suddenly there was a further grouping in one place that I don't see anywhere else.
And again: I understand your point, but I think the disambiguation should explicitly happen in the album title (an attribute belonging to a media library item) rather than using file paths (which a library is trying to abstract from).
I stumbled over the same problem. I have a directory tree with some duplicated (symlinked) content. For instance I have a subdir to be copied to a mobile MP3 player and another subdir with ripped CDs, and some of the content is in both subdirs, and it looks like the picture above. Would be nice if there was an option to squeeze the duplicated entries simply together somehow (if all metadata and filesize is identical and only the path is different). Otherwise I could try to reorganize my tree and make a cmus-subtree with no duplicated content. ;)
This can be fixed by calling realpath on the filename before processing. realpath will resolve symlinks and relative paths to a canonical absolute paths.
Same issue here. I have a symlink in ~/Music that points to my network share that holds all my music. When adding the symlink, cmus created duplicates of all the files. I have a lot of music, and sorting through them to delete is not feasible.
I've noticed a flaw in the ignore_duplicates option I added; that cmus won't catch duplicates if the original is currently hidden by a filter. They'll at least be stripped out of the library again if cmus is restarted with the filter disabled. Unfortunately I can't think of a good way to fix it right now, aside from something extremely invasive like gavtroy@filter-keeps-objects.
Activity
z3t0 commentedon Mar 31, 2016
You can delete individual songs with the "D" key
z3t0 commentedon Apr 1, 2016
It would be a good idea to add a feature where duplicate files are not added
alexander-pecheny commentedon Apr 1, 2016
@z3t0 Wouldn’t they be re-added if I add new music to library and then refresh cache?
Anyway, looks like I found the original problem — symlinked folder was the culprit. If I added the folder by its real path, obsolete duplicates didn’t occur.
Still unsure how to deal with legitimate duplicates though.
flyingmutant commentedon Apr 3, 2016
What do you mean by «legitimate duplicates»? Files with identical content, but different paths?
alexander-pecheny commentedon Apr 3, 2016
E.g. a band has a single and an album with the same name. They will be grouped together, which is not very convenient.
I think that third level of grouping (by folder path) would solve this problem.
jolange commentedon Apr 4, 2016
But that would impose a folder structure (Artist/Album/Track) which I think you should definitely not do.
If there are different albums/singles named the same for one artist, then I think that's the actual problem. I personally would try to make this clear from the metadata and call them "Name" and "Name (Single)".
alexander-pecheny commentedon Apr 5, 2016
I do not think this approach imposes anything: the user is free to choose whatever folder structure suits him better. I propose that the path/folder structure be used only as a last means for disambiguation, in the cases where all metadata for files is identical. It is also convenient because file paths are already stored in the library, so you do not need to cache any more data.
Before grouping by folder path, other levels of grouping may be added to solve the same problem, e.g musicbrainz ID. However, this approach has the aforementioned disadvantage of needing to cache more data.
jolange commentedon Apr 5, 2016
Ok, but in my opinion "conditional disambiguation" is not desirable.
Apart from that, using the location for distinction purposes goes a bit against the idea of a media library.
alexander-pecheny commentedon Apr 7, 2016
Could you please elaborate why? I am genuinely interested. I understand the controversial ideological grounds, but I can’t see any drawbacks from a UX perspective.
jolange commentedon Apr 7, 2016
Well, thats a purley personal view, but I like to have one defined behaviour (yes, you could argue that this is still well-defined).
I would certainly be at least surprised (if not confused) if suddenly there was a further grouping in one place that I don't see anywhere else.
And again: I understand your point, but I think the disambiguation should explicitly happen in the album title (an attribute belonging to a media library item) rather than using file paths (which a library is trying to abstract from).
Just my two cents.
woffs commentedon Nov 15, 2016
I stumbled over the same problem. I have a directory tree with some duplicated (symlinked) content. For instance I have a subdir to be copied to a mobile MP3 player and another subdir with ripped CDs, and some of the content is in both subdirs, and it looks like the picture above. Would be nice if there was an option to squeeze the duplicated entries simply together somehow (if all metadata and filesize is identical and only the path is different). Otherwise I could try to reorganize my tree and make a cmus-subtree with no duplicated content. ;)
mahkoh commentedon Nov 15, 2016
How do other players handle this?
nefthy commentedon Nov 15, 2016
This can be fixed by calling
realpathon the filename before processing.realpathwill resolve symlinks and relative paths to a canonical absolute paths.8 remaining items
Ignore duplicates when adding tracks to the library
Ignore duplicates when adding tracks to the library
rachmadaniHaryono commentedon Dec 13, 2021
i have this issue and because there is no solution yet except #1052, i modify the cmus lib directly (
~/.config/cmus.lib.pl)the drawback is i lose the playcount.
currently there is no way to export play count as of 1 G
Footnotes
https://github.com/cmus/cmus/issues/489 ↩
tehmasterer commentedon Jan 9, 2023
Same issue here. I have a symlink in
~/Musicthat points to my network share that holds all my music. When adding the symlink, cmus created duplicates of all the files. I have a lot of music, and sorting through them to delete is not feasible.rachmadaniHaryono commentedon Jan 10, 2023
i have to write my own python script to replace symlink
for example
/mnt/uuid/music/1.mp3is equal to/home/username/music/1.mp3Ignore duplicates when adding tracks to the library
Ignore duplicates when adding tracks to the library
Ignore duplicates when adding tracks to the library
gavtroy commentedon Aug 7, 2023
I've noticed a flaw in the
ignore_duplicatesoption I added; that cmus won't catch duplicates if the original is currently hidden by a filter. They'll at least be stripped out of the library again if cmus is restarted with the filter disabled. Unfortunately I can't think of a good way to fix it right now, aside from something extremely invasive like gavtroy@filter-keeps-objects.Fix ignore_duplicates missing filtered tracks
Fix ignore_duplicates missing filtered tracks
Fix ignore_duplicates missing filtered tracks
Fix ignore_duplicates missing filtered tracks
Fix ignore_duplicates missing filtered tracks