Page 3 of 3

Posted: Sun Mar 30, 2008 7:21 am
by MoDementia
Try it the other way round

Code: Select all

E:\Music\($MovePrefix($First(<Album Artist>))\<Album>\

Posted: Sun Mar 30, 2008 8:10 am
by spacefish
Lovely! Thank you. I feel pretty dense for not trying that. :P

I guess after looking at it, I do see a logic to the order. I want to move the prefix (#1) for the first (#2) item. Well, some sort of logic anyway. Thanks for the help! :)

Posted: Sun Mar 30, 2008 12:05 pm
by Teknojnky
Its like math, the innermost parenthesis evaluate first.

Posted: Sun Mar 30, 2008 1:25 pm
by spacefish
Teknojnky wrote:Its like math, the innermost parenthesis evaluate first.
I suck at math! :)

Re: New mask functions

Posted: Sun Mar 30, 2008 8:27 pm
by chrisjj
As an aside, could someone explan why these are called 'mask' functions? I can see no masking! :)

Re: New mask functions

Posted: Mon Apr 20, 2009 9:16 pm
by Crow25
chrisjj wrote:As an aside, could someone explan why these are called 'mask' functions? I can see no masking! :)
Auto-organize uses the music tag to mask (produce) the eventual file path and name.

Re:

Posted: Mon Apr 20, 2009 9:25 pm
by Crow25
Seeker wrote:
K1LL3M wrote:Is there a way for these new mask to allow a variation in the tags such as an additional folder, with the disc number, to be added to the mask only if there is multiple discs

E.g.

If album has multiple disks, tag = path\<AlbumArtist>\<year> - <Album>\<Disc#> - <Album>\ Track # & name

Album is single disc - tag = path\<AlbumArtist>\<year> - <Album>\ Track # & name

If this is already available; could someone tell be how please :)
Does this work for you?

path\<AlbumArtist>\<year> - <Album>\$IF(<Disc#>,<Disc#> - <Album>$\,)Track # & name

note - I followed your convention - these won't work exactly correctly with mediamonkey rules.
I get the impression that K1LL3M wants to only have the "Disc 1" and "Disc 2" if there is 2 discs in the compilation. Many albums put a 1 in the disc metadata, even if there is only 1 disc producing...
Eg.
path\Adele - 19 - 2008\Disc 1\09. Adele - Make You Feel My Love.mp3
for that particular album it only contains 1 disc in total

However its tough because there is no metadata (that i know of) that describes the "total number of discs".
The closest i've got is

$If(<Disc#>>=2,Disc <Disc#>,)
Which only uses "disc 2" if there is second disc... however disc 1 is in the previous directory.

Re: New mask functions

Posted: Mon Apr 20, 2009 11:54 pm
by chrisjj
Auto-organize uses the music tag to produce the eventual file path and name.

Auto-organize doesn't use the music tag to mask the eventual file path and name.

Re: Re:

Posted: Tue Apr 21, 2009 1:59 am
by ZvezdanD
Crow25 wrote:I get the impression that K1LL3M wants to only have the "Disc 1" and "Disc 2" if there is 2 discs in the compilation.
This could be done with the RegExp Find & Replace script - folders with the Disc Number will be created only if some song from the album has this field >=2; if all songs from the album have disc number = 1 or undefined then this folder will not be created. Here are settings for the first mentioned example (path\<AlbumArtist>\<year> - <Album>\<Disc#> - <Album>\ Track # & name):
Find what:

Code: Select all

(.+?)\\(.+)\\([^\\]+)\.([^\.\\]+)$
Into: Path
Regular expression 1: checked
Replace with:

Code: Select all

IIf(Len(oSongData.AlbumArtistName ) > 0 And Len(oSongData.AlbumName) > 0 And Len(oSongData.Title) > 0, "$1\My Music\" & SDB.Tools.FileSystem.CorrectFilename(oSongData.AlbumArtistName & "\" & IIf(oSongData.Year > 0, oSongData.Year &  " - ", "") & oSongData.AlbumName & "\" & IIf(SQLQuery("SELECT Max(CAST(DiscNumber AS integer)) FROM Songs WHERE IDAlbum = " & oSongData.Album.ID & " GROUP BY IDAlbum") > 1,  oSongData.DiscNumberStr & " - " & oSongData.AlbumName & "\", "") & IIf(Len(oSongData.TrackOrderStr) > 0, oSongData.TrackOrderStr & " - ", "") & oSongData.Title & ".$4"), "$&")
VBScript expression:checked

Here are settings for the second example (path\Adele - 19 - 2008\Disc 1\09. Adele - Make You Feel My Love.mp3):
Replace with:

Code: Select all

IIf(Len(oSongData.AlbumArtistName ) > 0 And Len(oSongData.AlbumName) > 0 And Len(oSongData.Title) > 0, "$1\My Music\" & SDB.Tools.FileSystem.CorrectFilename(oSongData.AlbumArtistName & " - " & oSongData.AlbumName & IIf(oSongData.Year > 0,  " - " & oSongData.Year, "") & "\" & IIf(SQLQuery("SELECT Max(CAST(DiscNumber AS integer)) FROM Songs WHERE IDAlbum = " & oSongData.Album.ID & " GROUP BY IDAlbum") > 1,  "Disc " & oSongData.DiscNumberStr & "\", "") & IIf(Len(oSongData.TrackOrderStr) > 0, oSongData.TrackOrderStr & ". ", "") & oSongData.ArtistName & " - " & oSongData.Title & ".$4"), "$&")
Instead of the $1\My Music\ you should specify your path. If you want the Track Numbers with two digits, you should write Right("0" & oSongData.TrackOrderStr, 2) & instead of oSongData.TrackOrderStr & (but not inside of the Len function). Of course, all of this would work as it should only if you have numeric Disc Numbers.