Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Help with scripts in masstagger (Read 1258 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Help with scripts in masstagger

I wish to use FB2K's mass-tagging feature for a lot of Flac files. I tried with mixed results to learn the script's syntax (I'm not too good at this  ), searched on the forum but failed to achieve what I want. My basic filename is :

AlbumArtist [Year] AlbumTitle\TrackNumber [Performer] Title

Nothing fancy, but I add more information when I need it (or simply have it) :

* Edition, when there are several editions for an album
* Track origin, B-side of some single, or from some LP (if the CD is a Greatest Hits or part of a Box set), etc.
* Date, for each track, when different from the album date (especially for albums collecting tracks pre-dating the LP era)
* Original CD, when I replace a CD track by another. Let's say I have a Betty Everett crappy-sounding Best of, and a great-sounding version of "You're no Good" on a Vee-Jay Box set. Then I'll replace the Best of version by the Box set version in the album folder. But I want to remember this is not the original CD version.
* Errors, when I had ripping errors with EAC (I ripped a lot of scratched CD from public libraries)

So a full-blown filename goes like this (gray fields may be present or not) :

AlbumArtist [Year] AlbumTitle {Edition}\TrackNumber [Performer] Title [TrackOrigin] #Date @OriginalCD {Errrors} , e.g. :
Jean Knight [1971] Mr. Big Stuff {24bits Ed.}\12 [Jean Knight] Helping Man [A-Side] #1972 @Complete Stax-Volt Singles Vol.1 {Errors}.flac

Here's what I scripted for the directory part :

Quote
//Artist
$substr(%_directoryname%,1,$sub($strchr(%_directoryname%,'['),2))

//Year
$substr(%_directoryname%,$add($strchr(%_directoryname%,'['),1),$sub($strchr(%_directoryname%,']'),1))

//Album Title :
$ifgreater($strchr(%_directoryname%,'{'),0,$substr(%_directoryname%,$add($strchr(%_directoryname%,']'),2),$sub($strchr(%_directoryname%,'{'),2)),$substr(%_directoryname%,$add($strchr(%_directoryname%,']'),2),$len(%_directoryname%)))

//Edition :
$ifgreater($strchr(%_directoryname%,'{'),0,$substr(%_directoryname%,$add($strchr(%_directoryname%,{),1),$sub($len(%_directoryname%),1)),)


I'm pretty sure there is a smarter way to go, but like I said, I'm no good at this, and it seems to do the job. The first two fields of the filename goes like this :
Quote
//Tracknumber
$substr(%_filename%,1,2)

//Performer
$substr(%_filename%,$add($strchr(%_filename%,'['),1),$sub($strchr(%_filename%,']'),1))
And then... I'm stuck with the title track and the four optional fields, which may or may not be in the filename. I can handle one optional field, but four are way too much for my very limited skills.  Could some kind script guru help me finish these scripts ?