Old 10th November 2013, 20:36   #1
Xennex
Junior Member
 
Join Date: Oct 2012
Posts: 35
Gracefully handle duplicate albums

Currently when Winamp discovers duplicates in the media library, it just lists both entries as tracks for the same album, so an album of 10 tracks might become an album of 20 tracks with all tracks present twice.

This is regardless of whether the primary identifying tags are identical.

There is one important use case wherein graceful handling of duplicates becomes important: when a user wants to keep both FLAC and MP3 albums (lossless + lossy) in the same library, but logically split in the file system.

Ie. you might have one folder tree with 60 FLAC albums, and one folder tree with mostly MP3 albums. This is not an exact mirror, you might have many MP3 albums that you don't have as FLAC. Some MP3 albums will have a FLAC mirror, but many will not; and some FLAC albums might not have an MP3 mirror.

When Winamp does not gracefully handle these duplicates, life becomes rather difficult. One needs to create 2 smartviews, one with lossy and one with lossless files. Then, each view is a limited subset of the whole, and you have to start remembering which albums are flac and which ones are mp3!! Furthermore, if you were to prefer listening to the FLAC version, you would have to navigate the FLAC tree; should you realize the FLAC version is not present, you'd have to navigate the MP3 tree.

My desired behaviour is simply this: when winamp library detects duplicates (same albumartist, albumtitle and title) it selects the superior file for listing, which means that higher bitrate = better. The other ones are masked.

The query builder for smartviews does not allow one to compare items against one another or to detect the presence of identical files in the library.

This could very easily be implemented at library-build-time, but could also be done when building the current view. There is no way in the user interface to visualize the difference between different codecs - you want the library view to be format-agnostic (ie. don't list two albums as separate entities simply because they are encoded differently; you'd end up with duplicates at the album level and you wouldn't know which one is which).

I think this feature would not require more than 3 lines of code.

One a side-note, track-id display is also not very graceful. It will just list whatever is in the field. This can be "01" or "1" or "1/10". You would have to run a script over your library to harmonize all of these in all the files, or your Winamp is going to be showing every album differently.

http://forums.winamp.com/showthread.php?t=285920
http://forums.winamp.com/showthread.php?t=350643
Xennex is offline   Reply With Quote
Old 10th November 2013, 20:45   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
Quote:
Originally Posted by Xennex View Post
I think this feature would not require more than 3 lines of code.
that's a wonderfully inaccurate statement.

having a 'mimetype' value allowing for easier filtering by media type would likely help with things (and is the nearest that might happen), but preferential type & rollup of library items is not going to happen anytime soon (or at all) as it's a lot more than 3 lines of code (and not forgetting all of the time needed to make changes, test things, etc).
DrO is offline   Reply With Quote
Old 10th November 2013, 21:35   #3
MrSinatra
Forum King
 
MrSinatra's Avatar
 
Join Date: Dec 2004
Location: WKPS, State College
Posts: 5,207
Send a message via AIM to MrSinatra
I understand what the OP is saying I think, but winamp does allow you to do smartviews, so you can use folders to divide at a root point lossless from lossy.

I actually adjust the album tags anyway, so I can see both as separate, so its not really an issue.

it would be cool though to have some kind of toggle function for lossy mirrors. so basically, when browsing, you'd see everything, except the lossy ver of a lossless file. hit the toggle, and now they show as well. imagine being able to specify a root folder as the "mirror" dir to enable such a function. maybe make it a 3 way mode function so when u hit the toggle again, the lossless stuff is hidden. just an idea.

PENN STATE Radio or http://www.LION-Radio.org/
--
BUG #1 = Winamp skips short tracks
Wish #1 = Multiple Column Sorting
Wish #2 = Add TCMP/Compilation editing
MrSinatra is offline   Reply With Quote
Old 10th November 2013, 21:40   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
this new thread just seems to go over stuff that the two of you have already discussed to death. and as the OP has some insane view that it'd by 3 lines of code - if it was then hell it'd be done but it's not and is quite a hefty change to do what the two of you are saying / wanting.

hence why if enabling the 'mimetype' field it would at least make it possible to order them by type so it's at least simpler to see them or do as was said before and explicitly filter by type but personally i despise having things rolled up as you then have to do a load of other things in the UI handling to make it possible to determine / switch between things (again which is why 3 lines of code is not realistic).
DrO is offline   Reply With Quote
Old 10th November 2013, 23:46   #5
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,620
Quote:
Originally Posted by Xennex View Post
The query builder for smartviews does not allow one to compare items against one another or to detect the presence of identical files in the library.
Hi Xennex,

True the query builder doesn't do that, but there are alternatives for generating separate views for these kind of duplicates (same songs in different formats).

The tracks panel in the media library allows an "Extension" column to be added. Then you could at least group files by format.

The smart view query builder does not include an "Extension" filter, but you can use "Filename" and filter by the extension portion, e.g. 'Filename contains .mp3' or 'Filename contains .flac'. You can use as many 'Filename contains .x' filters as needed (each separated by the "or" operator) to capture all your lossy or lossless files in one view.

Even simpler, for lossless format files you can just use the 'Lossless = 1' filter.

In the resulting smart views, you can then sort the tracks panel by album or artist or some other column (from the available choices) to further group the songs.

Winamp Pro 5.666.3516 fully-patched - Komodo X Touchscreen by Victhor skin
Windows 10 Home 64-bit desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 11th November 2013, 00:25   #6
MrSinatra
Forum King
 
MrSinatra's Avatar
 
Join Date: Dec 2004
Location: WKPS, State College
Posts: 5,207
Send a message via AIM to MrSinatra
Quote:
Originally Posted by DrO View Post
this new thread just seems to go over stuff that the two of you have already discussed to death.
I don't believe I have EVER discussed this before?

all I wanted to do, was make a suggestion, and i don't posit its easy to do; to me, coding on this level is beyond my grasp.

but i would like to make my suggestion clearer:

if someone has a big ML, and mixes lossless and lossy, and also has a mirror of their lossless stuff as lossy, then it would be cool to be able to toggle whats showing in the ML:

1. everything, (all lossless and all lossy incl mirror)
2. lossless only
3. lossy only
4. everything, except the lossy mirror of the lossless

a button that cycles thru the choices would be in the UI; and to keep it simple for the devs, the root mirror dir would need to be specified in prefs, so winamp would discern whats "mirrored" via that folder.

of course, everything i just said is essentially doable by making a specific smartview for each, but the idea of being able to cycle through the choices in any given smartview does have merit imo. on the other hand, there's a lot of other things i'd like to see done before that.

PENN STATE Radio or http://www.LION-Radio.org/
--
BUG #1 = Winamp skips short tracks
Wish #1 = Multiple Column Sorting
Wish #2 = Add TCMP/Compilation editing
MrSinatra is offline   Reply With Quote
Old 11th November 2013, 00:30   #7
DrO
 
Join Date: Sep 2003
Posts: 27,873
i only said it as it was the impression i got it was going over things already in Xennex's other threads (as you both have a tendency to be overly verbose so is no surprise i got the wrong impression).

and it's not like the 'lossless' value cannot be used to query with / without lossless / lossy formats (had forgotten about that value).
DrO is offline   Reply With Quote
Old 11th November 2013, 00:33   #8
MrSinatra
Forum King
 
MrSinatra's Avatar
 
Join Date: Dec 2004
Location: WKPS, State College
Posts: 5,207
Send a message via AIM to MrSinatra
I hope one day I may please you my lord.

PENN STATE Radio or http://www.LION-Radio.org/
--
BUG #1 = Winamp skips short tracks
Wish #1 = Multiple Column Sorting
Wish #2 = Add TCMP/Compilation editing
MrSinatra is offline   Reply With Quote
Old 11th November 2013, 00:42   #9
DrO
 
Join Date: Sep 2003
Posts: 27,873
you both want a hefty overhaul on functionality which is not going to happen, there are means to achieve the filtering and yes it involves a bit more intervention but it's do-able.

and i'm going to assume that comment was meant as sarcasm.
DrO is offline   Reply With Quote
Old 11th November 2013, 01:33   #10
MrSinatra
Forum King
 
MrSinatra's Avatar
 
Join Date: Dec 2004
Location: WKPS, State College
Posts: 5,207
Send a message via AIM to MrSinatra
honestly, it was meant in total good humor. I have np with your view on the req.

PENN STATE Radio or http://www.LION-Radio.org/
--
BUG #1 = Winamp skips short tracks
Wish #1 = Multiple Column Sorting
Wish #2 = Add TCMP/Compilation editing
MrSinatra is offline   Reply With Quote
Old 11th November 2013, 02:18   #11
Xennex
Junior Member
 
Join Date: Oct 2012
Posts: 35
Quote:
Originally Posted by DrO View Post
that's a wonderfully inaccurate statement.

having a 'mimetype' value allowing for easier filtering by media type would likely help with things (and is the nearest that might happen), but preferential type & rollup of library items is not going to happen anytime soon (or at all) as it's a lot more than 3 lines of code (and not forgetting all of the time needed to make changes, test things, etc).
How is it more than:

code:
MediaLibraryEntry existing;
if (existing = mediaLibrary.getEntry("%albumartist% == '" + current.albumArtist() +
"' && %albumtitle% == '" + current.albumTitle() + "' && "%title% == '" +
current.title() + "'"))
if (existing.bitrate() < current.bitrate())
mediaLibrary.remove(existing)
else
addCurrent = false;



supposing all these methods exist, and not counting any escape code.

Quote:
personally i despise having things rolled up as you then have to do a load of other things in the UI handling to make it possible to determine / switch between things (again which is why 3 lines of code is not realistic).
That is assuming you are going to keep all duplicates in the library and are going to depend on the UI code (which has all these different views) to facilitate switching and all kinds of UI functionality. What I propose is a simple filter in the library generation code that will just get rid of the duplicates (they will never enter the library or be replaced when a higher bitrate is found).

Of course you'd need to add at least some preferences ability to switch this on and off and if you'd really want to do it right you'd need an interface to select preferred formats and yadda yadda yadda but as a simple hack I'm sure I would be able to do it in an hour if I had the source. Granted, I would not want to put such an incomplete feature in a production version either, but this limited idea seems completely doable?

Question: is it possible to write an addon that will install this filter, OR, that will allow me to prune the library database of duplicates given a simple rule? The downside of the latter is that I will need to run that prune after every scan :-/.

A mimetype is really not going to help because I can already filter lossless. The point is that a smartview can only determine "is this file going to be shown" and it can only determine this based on the current entry, not what's in the library. Expanding that functionality is going to take a lot of work.

Quote:
you both want a hefty overhaul on functionality which is not going to happen, there are means to achieve the filtering and yes it involves a bit more intervention but it's do-able
A filter with scarcely any configuration is not a hefty overhaul on functionality, and if you mean by do-able that I would go and add "[flac]" to the albumtitle tag of every flac album, or that I would keep a 'combined' hierarchy and a 'mp3s-i-don't-want-in-there' hierachy (like I'm doing now) only to run into problems again when I want to separate the mp3s from the flacs, well... it's not pretty.

(Now that I'm thinking about it, the cleanest way to do it is to create 3 hierarchies: one all FLAC, one all lossy (inclusive) and one all lossy (exclusive). Then I would just need a way to combine the inclusive and exclusive lossy trees into one view. In essence, a Windows Explorer smartview. The easiest way to do THAT is to create a 4th tree with symbolic links.)

I'm telling you, it's ugly. Smartviews don't solve this.

Quote:
hence why if enabling the 'mimetype' field it would at least make it possible to order them by type so it's at least simpler to see them
You'd probably still see all duplicates in every album, so if you'd queue the album, you'd queue it twice - they would just be in the right order.

Quote:
The tracks panel in the media library allows an "Extension" column to be added. Then you could at least group files by format.
Same. And we're not talking files, we're talking entries that will only be shown in the final view - which is usually the album view. So you'd get albums all the time with twice the entries.

I will agree that the UI overhaul that you considered, would be a major effort, not even knowing the code myself.

Btw, in that other thread we never debated the feasibility of this feature, MrSinatra just proposed ways to deal with the absence of it.
Xennex is offline   Reply With Quote
Old 11th November 2013, 03:15   #12
Xennex
Junior Member
 
Join Date: Oct 2012
Posts: 35
I will try to achieve the following:

Create 3 logical sets:
- all lossless
- all lossy inclusive
- all lossy exclusive

The relationships will be as follows:

lossless + inclusive = all albums
inclusive + exclusive = all lossy albums
lossless == exclusive

all FLAC albums will contain MP3 mirrors in exclusive.
lossless + inclusive will be included in Winamp and other libraries (hence the name 'inclusive')

I will write a shell script that creates a 4th tree with symbolic links combining "lossless + inclusive" to create a view of all albums, a 5th tree with symbolic links combining "inclusive + exclusive" such that I can easily copy albums to mobile devices, and a 6th tree containing a flat view of all FLAC albums.

That should cover all my needs. The big advantage of doing this in the file system over doing it in Winamp is that it will work for every program imaginable that can accept multiple directories in its library.
Xennex is offline   Reply With Quote
Old 11th November 2013, 03:36   #13
MrSinatra
Forum King
 
MrSinatra's Avatar
 
Join Date: Dec 2004
Location: WKPS, State College
Posts: 5,207
Send a message via AIM to MrSinatra
Quote:
Originally Posted by MrSinatra View Post
1. everything, (all lossless and all lossy incl mirror)
2. lossless only
3. lossy only
4. everything, except the lossy mirror of the lossless
I suppose I should've added:

5. mirror only

but anyway, don't you, at one time or another need all 5 views? or perhaps filters is a better word?

maybe also:

6. lossy only with lossy mirror (as opposed to 3 which is without the mirror)

PENN STATE Radio or http://www.LION-Radio.org/
--
BUG #1 = Winamp skips short tracks
Wish #1 = Multiple Column Sorting
Wish #2 = Add TCMP/Compilation editing
MrSinatra is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Winamp > Winamp Wishlist

Tags
duplicate, flac, library, mp3

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump