New mask functions

Beta Testing for Windows Products and plugins

Moderator: Gurus

jiri
Posts: 5426
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

New mask functions

Post by 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
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Post by 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
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by 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
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

Bex wrote: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
Posts: 13
Joined: Sat Jan 19, 2008 9:27 am
Location: Ohio, US

Post by 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
Posts: 5426
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Post by 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
Posts: 5426
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Post by jiri »

I realized that there's one more missing:

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

Jiri
Guest

Post by Guest »

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".
Guest

Post by Guest »

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
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky »

Anonymous wrote:
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
Posts: 13
Joined: Sat Jan 19, 2008 9:27 am
Location: Ohio, US

Post by dreifach »

Oops, sorry. That was me posting as "guest" above. I didn't realize I wasn't logged in.
dreifach
Posts: 13
Joined: Sat Jan 19, 2008 9:27 am
Location: Ohio, US

Post by dreifach »

Teknojnky wrote:
Anonymous wrote:
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
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia

Post by 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 :)
Last edited by MoDementia on Sun Mar 02, 2008 11:19 pm, edited 2 times in total.
MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia

Post by 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
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by 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.
Post Reply