Page 1 of 1

Newbie to Magic Nodes, need help with orphaned tracks

Posted: Thu Dec 16, 2010 10:10 am
by grillmeister7
Moving my music collection to a bigger heard drive did not go smoothly and I have some grayed out (orphaned) tracks and extra copies stored outside my primary library folder.

All my active tracks are stored in the folder "O:\Audio files\' whereas there is alternate storage in 'O:\Extra Music copies 2\' and
'Z:\Gary's Documents\My Music\'. Also the grayed out tracks show up and having that may give me a useful clue as to what CDs might have to be ripped again.

My goal is to have a copy of all tracks rated 2-1/2 or higher located in the \Audio files\ folder (I know how to Move them).

Since multiple copies of a track may have different ratings, I'd need to select all copies of a track even if only one had a rating>=2-1/2 stars.

Can someone please help me with a Magic Node specification that will show all tracks (sorted by artist,title,path) where at least one copy of artist-track is rated 2-1/2 stars or More?

thanks

Gary

Re: Newbie to Magic Nodes, need help with orphaned tracks

Posted: Thu Dec 16, 2010 12:21 pm
by ZvezdanD
I am not sure that understand what you want, but I think that you could try this mask:

Code: Select all

<Group|name:Tracks...|Show tracks:No>\Duplicates where at least one track is rated 2.5 stars or more|Icon:Top level|Filter:Songs.SongTitle || '@' || Songs.Artist COLLATE IUnicode IN (SELECT SongTitle || '@' || Artist COLLATE IUnicode AS GroupField FROM Songs GROUP BY GroupField HAVING Count(*) > 1 AND Max(Rating) > 49)\<Title|Trim:1>\<Title with artist>
You could also try this:

Code: Select all

<Group|name:Tracks...|Show tracks:No>\Duplicates with maximal rating|Icon:Top level|Filter:Songs.ID IN (SELECT ID FROM Songs WHERE SongTitle || '@' || Artist || '@' || Rating COLLATE IUnicode IN (SELECT SongTitle || '@' || Artist || '@' || Max(Rating) COLLATE IUnicode FROM Songs GROUP BY Artist, SongTitle COLLATE IUnicode HAVING Count(*) > 1) GROUP BY Artist, SongTitle COLLATE IUnicode)\<Title|Trim:1>\<Title with artist|Statistic:Count(All)>

Re: Newbie to Magic Nodes, need help with orphaned tracks

Posted: Thu Dec 16, 2010 1:40 pm
by grillmeister7
Thank you ZvezdanD; that's a big help.

I'm working with the first construct and it looks like it's doing just what I want. I tweaked it to show the entire song title and artist, which appears more useful to me.

Re: Newbie to Magic Nodes, need help with orphaned tracks

Posted: Fri Dec 17, 2010 1:02 am
by grillmeister7
Almost home, but I need a refinement.

For each artist-track rated 2-1/2 stars or more, I need to find those which are not in my main music folder. I have a custom field (#1) which contains 'Yes' which I posted in all tracks in the folder 'O:\Audio Files". So I also want track that don't have a yes in any Custom1 fields.

I saw a sample Magic Node which CASt TrackNumber as an integer that was used in MAX(); maybe I need to do that.

Re: Newbie to Magic Nodes, need help with orphaned tracks

Posted: Fri Dec 17, 2010 3:44 am
by ZvezdanD
I don't understand if you want tracks when any duplicate don't have a yes in any Custom1 fields, or if you want tracks when at least one duplicate don't have a yes in any Custom1 fields. Anyway, you could try the next two masks:

Code: Select all

<Group|name:Tracks...|Show tracks:No>\Any duplicates where at least one track is rated 2.5 stars or more and Custom1 not equal 'Yes'|Icon:Top level|Filter:Songs.SongTitle || '@' || Songs.Artist COLLATE IUnicode IN (SELECT SongTitle || '@' || Artist COLLATE IUnicode AS GroupField FROM Songs GROUP BY GroupField HAVING Count(*) > 1 AND Max(Rating) > 49) AND Songs.Custom1 COLLATE IUnicode <> 'yes'\<Title|Trim:1>\<Title with artist>

Code: Select all

<Group|name:Tracks...|Show tracks:No>\Only duplicates where at least one track is rated 2.5 stars or more and none has Custom1 = 'Yes'|Icon:Top level|Filter:Songs.SongTitle || '@' || Songs.Artist COLLATE IUnicode IN (SELECT SongTitle || '@' || Artist COLLATE IUnicode AS GroupField FROM Songs GROUP BY GroupField HAVING Count(*) > 1 AND Max(Rating) > 49 AND Length(group_concat(Songs.Custom1)) = Length(Replace(group_concat(Songs.Custom1) COLLATE IUnicode, 'yes', '')))\<Title|Trim:1>\<Title with artist>
However, maybe you don't need to tag Custom1 field if you use the next mask:

Code: Select all

<Group|name:Tracks...|Show tracks:No>\Any duplicates where at least one track is rated 2.5 stars or more and not in music folder|Icon:Top level|Filter:Songs.SongTitle || '@' || Songs.Artist COLLATE IUnicode IN (SELECT SongTitle || '@' || Artist COLLATE IUnicode AS GroupField FROM Songs GROUP BY GroupField HAVING Count(*) > 1 AND Max(Rating) > 49) AND <Folder> Not Like 'O:\Audio Files\%'\<Title|Trim:1>\<Title with artist>

Re: Newbie to Magic Nodes, need help with orphaned tracks

Posted: Fri Dec 17, 2010 1:42 pm
by grillmeister7
Sorry to be a pest; you have been most helpful. I beg you indulgence but I wasn't clear enough. The first construct yielded over 11,000 records which was unwieldy.

My ultimate goal is to have a copy of all songs I've rated in my main library folder.

This latest code gives me songs that have any copy in the library rated 2-1/2 stars or more but are not stored in the "O:\Audio files" (Main library) folder yet all the ones I checked also had a copy in the "O:\Audio files" folder:

Code: Select all

    <Group|name:Tracks...|Show tracks:No>\Any duplicates where at least one track is rated 2.5 stars or more and not in music folder|Icon:Top level|Filter:Songs.SongTitle || '@' || Songs.Artist COLLATE IUnicode IN (SELECT SongTitle || '@' || Artist COLLATE IUnicode AS GroupField FROM Songs GROUP BY GroupField HAVING Count(*) > 1 AND Max(Rating) > 49) AND <Folder> Not Like 'O:\Audio Files\%'\<Title|Trim:1>\<Title with artist>
I want to find the tracks for which at least one of the copies of the track is rated 2-1/2 stars or more but has no tracks in the main library folder ("O:\Audio files") so I can move it to the main folder.

Ex. If The Platters 'The Great Pretender', rated 3 stars, doesn't have a copy in the 'O:\Audio files' folder but does have a copy in the "O:\Extra Music file Copies 2" folder (and/or a folder on another drive), that should appear in the result.

Ex. If Buddy Holly's 'Rave On, rated 3-1/2 stars has a copy in "O:\Audio Files', it should not appear in the result regardless of whether there is a copy in any other folder.

Re: Newbie to Magic Nodes, need help with orphaned tracks

Posted: Sat Dec 18, 2010 7:48 am
by ZvezdanD
So, actually you don't want to find duplicates, but you want to get all tracks which don't have copies in specific folder, right? This is something similar which I have already posted before (http://www.mediamonkey.com/forum/viewto ... 62#p268062):

Code: Select all

<Group|name:Tracks...|Show tracks:No>\Track rated 2.5 stars or more which don't have copies in specified folder|Icon:Top level|Filter:Songs.SongTitle || '@' || Songs.Artist || '@' || Songs.Album || '@' || Songs.TrackNumber || '@' || Songs.SongLength COLLATE IUnicode NOT IN (SELECT SongTitle || '@' || Artist || '@' || Album || '@' || TrackNumber || '@' || SongLength COLLATE IUnicode AS GroupField FROM Songs, (SELECT *, CASE WHEN DriveLetter IS NOT NULL THEN SubStr('ABCDEFGHIJKLMNOPQRSTUVWXYZ', DriveLetter + 1, 1) ELSE '' END AS DriveStr FROM Medias) AS Medias2 WHERE <Folder> Like 'O:\Audio Files\%' AND Songs.IDMedia = Medias2.IDMedia GROUP BY GroupField) AND <Rating> > 49\<Title|Trim:1>\<Title with artist>

Re: Newbie to Magic Nodes, need help with orphaned tracks

Posted: Thu Dec 23, 2010 10:00 am
by grillmeister7
That's a big help; it narrows my job to manageble.

Thanks.