New mask functions

Beta Testing for Windows Products and plugins

版主: Gurus

jiri
帖子: 5431
注册时间: 周二 8月 14, 2001 7:00 pm

New mask functions

帖子 jiri »

Sometimes there are needs for more complex masks by our users and so I added a couple of new mask functions. They will be available in the next release, let me know whether this is enough or whether you have some other useful ideas:

- $RemovePrefix(string) - Removes starting 'The', i.e. 'The Beatles' -> 'Beatles'
- $MovePrefix(string) - Moves starting 'The' to the end of string, i.e. 'The Beatles' -> 'Beatles, The'
- $Group(string,integer) - Groups the first letter of the first parameter to groups of letters given by the second (optional) paremeter. Works just like <Artist@1>.
- $Replace(string,what,by) - Replaces all occurences of 'what' by 'by' in 'string'.
- $If(<Year><1990,...) - $If() function now accepts also <,<=,>,>= and <> operators. E.g. $If(<Year><1990,80's,$If(<Year><2000,90's,2000's)) returns 80's for year 1984.
- $Assign(variable,value) and $Use(variable) - Variables that can be used several times in mask, e.g. '$Assign(V,A)$Use(V)$Use(V)' produces string 'AA'.
- $First(string,count,start from) - There was added parameter 'start from' (optional), which specifies to skip a number of items in multi-value string. E.g. $First(a;b;c,1,1) returns 'b'.

Jiri
nohitter151
帖子: 23640
注册时间: 周三 8月 09, 2006 10:20 am

帖子 nohitter151 »

These should be very useful, I know some users have been asking for mask parameters like this. Can't wait to see them!
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
Bex
帖子: 6316
注册时间: 周五 5月 21, 2004 5:44 am

帖子 Bex »

Great enhancement!

One thing I miss sometimes in Auto-Tag from Filename is to be able to assign a "value" to more than one field.
e.g.
Path: C:\Music\Abba\1 - Waterloo.mp3
Mask: <Artist,Composer,Lyricist>\<Track#>-<Title>
Would tag Artist, Composer and Lyricist with Abba

Perhaps also some functions for fixing various FirstName LastName scenarios?
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
RedX
帖子: 366
注册时间: 周三 12月 27, 2006 10:32 am

帖子 RedX »

Bex 写了:Great enhancement!

One thing I miss sometimes in Auto-Tag from Filename is to be able to assign a "value" to more than one field.
e.g.
Path: C:\Music\Abba\1 - Waterloo.mp3
Mask: <Artist,Composer,Lyricist>\<Track#>-<Title>
Would tag Artist, Composer and Lyricist with Abba

Perhaps also some functions for fixing various FirstName LastName scenarios?
This idea is really very good! I'd definitely love to see this in the next release!.

Have the new mask for the filenames been addad to the wiki?

Regards,
Red
dreifach
帖子: 13
注册时间: 周六 1月 19, 2008 9:27 am

帖子 dreifach »

Here's a few off the top of my head:

<Type> tag for MP3, FLAC, etc.
Something similar to <'Field':n>, but truncate to n and don't pad with spaces if <n -- I would like this so filenames don't get too long, so I can truncate artist names to like 10 characters, but not have artists with names less than 10 chars expanded.
Include directory brackets in conditional statements. Like:

$If(<Album Artist>="Various",<Album:1>\<Album> - <Year>,<Album Artist:1>\<Album Artist> - <Year> - <Album>)<Disc#>-<Track#> - <Artist> - <Title>

Instead of:

$If(<Album Artist>="Various",<Album:1>,<Album Artist:1>)\$If(<Album Artist>="Various",<Album> - <Year>,<Album Artist> - <Year> - <Album>)<Disc#>-<Track#> - <Artist> - <Title>
jiri
帖子: 5431
注册时间: 周二 8月 14, 2001 7:00 pm

帖子 jiri »

<Type> tag for MP3, FLAC, etc.
Do you mean already existing <Extension>?
Something similar to <'Field':n>, but truncate to n and don't pad with spaces if <n -- I would like this so filenames don't get too long, so I can truncate artist names to like 10 characters, but not have artists with names less than 10 chars expanded.
I think that $Left(<Field>,n) should do what you want.
Include directory brackets in conditional statements
It doesn't work for you? Seems to work fine here.

Jiri
jiri
帖子: 5431
注册时间: 周二 8月 14, 2001 7:00 pm

帖子 jiri »

I realized that there's one more missing:

$Len(string) - returning the length of string, useful for $If() function.

Jiri
游客

帖子 游客 »

OK Thanks! I did not know about these!

Is there any other mask reference for existing masks besides the help file? Those you just mentioned aren't in the help file under "Directory and Format Masks".
游客

帖子 游客 »

It doesn't work for you? Seems to work fine here.
No, this doesn't work. MM3 still parses the '\' weather they're in a 'if()' statement or not.
Teknojnky
帖子: 5537
注册时间: 周二 9月 06, 2005 11:01 pm

帖子 Teknojnky »

Anonymous 写了:
It doesn't work for you? Seems to work fine here.
No, this doesn't work. MM3 still parses the '\' weather they're in a 'if()' statement or not.

did you try $\

?
dreifach
帖子: 13
注册时间: 周六 1月 19, 2008 9:27 am

帖子 dreifach »

Oops, sorry. That was me posting as "guest" above. I didn't realize I wasn't logged in.
dreifach
帖子: 13
注册时间: 周六 1月 19, 2008 9:27 am

帖子 dreifach »

Teknojnky 写了:
Anonymous 写了:
It doesn't work for you? Seems to work fine here.
No, this doesn't work. MM3 still parses the '\' weather they're in a 'if()' statement or not.

did you try $\

?
Duh. Ok, that works. Score me one point for the dumbass award. Thanks!
MoDementia
帖子: 1321
注册时间: 周四 6月 15, 2006 3:26 pm

帖子 MoDementia »

Trying to nest a $Replace inside an $If statement cant get it to work

D:\My Music\My Vinyl\AC-DC\'74 Jailbreak\'74 Jailbreak_01_Jailbreak.wma

D:\My Music\
$If($Replace(<Folder>,My Vinyl,)<><Folder>,My Vinyl,Unknown Source)
\<Album Artist>\<Album>\<Album>_<Track#:2>_<Title>


EDIT: Bah going by the date these arent in 1140 yet I'm guessing :( Hence they probably wont work :)
上次由 MoDementia 在 周日 3月 02, 2008 11:19 pm,总共编辑 2 次。
MoDementia
帖子: 1321
注册时间: 周四 6月 15, 2006 3:26 pm

帖子 MoDementia »

Ah I know what I need now :)

<Folder:2,1>

So that it will only return 1 directory after skipping the first 2

D:\My Music\My Vinyl\AC-DC\'74 Jailbreak\

Returns 'My Vinyl'

Or

<Folder:1,2>

Returns 'My Music\My Vinyl"
trixmoto
帖子: 10024
注册时间: 周五 8月 26, 2005 3:28 am

帖子 trixmoto »

Presumably the $RemovePrefix and $MovePrefix use the "IgnoreTHEStrings" setting in the INI file? But do they also take into consideration the "IgnoreTHEs" setting?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
回复