New mask functions

Beta Testing for Windows Products and plugins

Moderator: Gurus

MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia

Post by MoDementia »

Try it the other way round

Code: Select all

E:\Music\($MovePrefix($First(<Album Artist>))\<Album>\
spacefish
Posts: 1427
Joined: Mon Jan 14, 2008 7:21 am
Location: Denmark

Post 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! :)
Image
MM Gold 3.0.3.1183 : Vista HP SP1 (x86) : Zen Stone (2GB)
Zekton: An original MM3 skin by Eyal.
Scripts in Use: Add/Remove PlayStat | Auto Album DJ | AutoRateAccurate | Backup
Case & Leading Zero Fixer | Classification & Genre Changer | Clean Scripts.ini | Clear
Field | Custom Report | Discogs Auto-Tag Web Search | Forget Crossfade | Invert
Selection/Select None | Last 100... | Lyricator | Lyrics to Instrumental | MonkeyRok
MusicBrainz Tagger | My Custom Nodes | Now Playing Art Node | Play History & Stats
Right Click for Reports | Right Click for Scripts | Right Click for Web | Stop After Current
WebNodes
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky »

Its like math, the innermost parenthesis evaluate first.
spacefish
Posts: 1427
Joined: Mon Jan 14, 2008 7:21 am
Location: Denmark

Post by spacefish »

Teknojnky wrote:Its like math, the innermost parenthesis evaluate first.
I suck at math! :)
Image
MM Gold 3.0.3.1183 : Vista HP SP1 (x86) : Zen Stone (2GB)
Zekton: An original MM3 skin by Eyal.
Scripts in Use: Add/Remove PlayStat | Auto Album DJ | AutoRateAccurate | Backup
Case & Leading Zero Fixer | Classification & Genre Changer | Clean Scripts.ini | Clear
Field | Custom Report | Discogs Auto-Tag Web Search | Forget Crossfade | Invert
Selection/Select None | Last 100... | Lyricator | Lyrics to Instrumental | MonkeyRok
MusicBrainz Tagger | My Custom Nodes | Now Playing Art Node | Play History & Stats
Right Click for Reports | Right Click for Scripts | Right Click for Web | Stop After Current
WebNodes
chrisjj
Posts: 5007
Joined: Wed Feb 14, 2007 5:14 pm
Location: UK

Re: New mask functions

Post by chrisjj »

As an aside, could someone explan why these are called 'mask' functions? I can see no masking! :)
Chris
Crow25
Posts: 17
Joined: Thu May 22, 2008 8:29 pm

Re: New mask functions

Post 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.
Crow25
Posts: 17
Joined: Thu May 22, 2008 8:29 pm

Re:

Post 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.
chrisjj
Posts: 5007
Joined: Wed Feb 14, 2007 5:14 pm
Location: UK

Re: New mask functions

Post 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.
Chris
ZvezdanD
Posts: 3264
Joined: Thu Jun 08, 2006 7:40 pm

Re: Re:

Post 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.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
Post Reply