Can somebody put on the right track for scripting categories please?

Dear all,

I’m reaching out for some guidance on scripting and tagging categories for my music organization project.

While I am familiar with basic scripting, such as the format “%albumartist%/%album%/%tracknumber% - %title%,” my knowledge is limited beyond this point. I’m hoping to script the following categories:

  1. Single artist or band complete album
  2. Compilations (or Various)
  3. Singles
  4. Radio mixes
  5. Top 40
  6. Soundtrack
  7. DJ tracks

For each category, I have a specific structure in mind, along with tags and examples. Here’s a summary of what I’m aiming for:
For a single artist or band complete album:
~A~/Artist, The/Year - Album/CD-01 - Title
Comments: Country of origin
Genre: Up to 3 genres, separated by ,

~B~/Beatles, The/1965 - Help/02 - The night before
~P~/Pink Floyd/1973 - The dark side of the moon/06 - Us and them
For compilations:
Compilations/Year - Album/CD-01 - Artist - Title - Year

Comments: Country of origin
Genre: Up to 3 genres, separated by ,

Compilations/1997 - Top Hits '97/02-09 - Faithless - Salva Mea - 1997
For singles:
Singles/Year - Artist, The/Year - Artist - Album - 01 - Title

Comments: Country of origin
Genre: Up to 3 genres, separated by ,

Singles/~B~/1989 - Blackbox/1989 - Blackbox - Dreamland - 06 - Ride on time
For radio mixes:
Mixes/Broadcaster - Program/YYYY-mm-dd - Artist
Mixes/BBC - Essential mix/2010-05-29 - John Digweed
Mixes/Nederlandse Top 40/1982 - 006 - Dire Straits - Private investigations

Comments: Country of origin
Genre: Up to 3 genres, separated by ,
For Top 40:
Top 40/Broadcaster - Program/YYYY - 010 - Artist - Title
Mixes/Avro - Nederlandse Top 40/1982 - 006 - Dire Straits - Private investigations

Comments: Country of origin
Genre: Up to 3 genres, separated by ,
I’ve been diligently researching and exploring various forums and code sources, including those by esteemed authors like Bob Swift and Billy Yank. I want to express my sincere appreciation for their invaluable contributions to the community.

Despite my efforts, I find myself struggling to modify existing code to suit my specific needs. Unfortunately, my limited knowledge in this area is proving to be a significant hurdle. Additionally, while I’ve reviewed the scripting examples provided in the official documentation, I’ve found them to be somewhat limited in addressing the complexity of my requirements.

The structure outlined in my message, as shown above, is precisely what I’m aiming for. I seek to implement these categories without introducing unnecessary complexity.

Given these challenges, I kindly request assistance or guidance on how to tackle this issue effectively. Any insights or pointers you can provide would be immensely helpful.

Thank you all in advance for your support and assistance.

Warm regards,

First off, my comments are based on the assumption that you using metadata from MusicBrainz by matching the files to tracks on a release. I don’t think I would even touch this if you were just using metadata from the files themselves and saving directly from the clustering pane in Picard.

Some things to consider and clarify before jumping into the code:

  1. By country, can we assume that you mean the country of the first artist listed for the track? Should this be the two-character country code, or the full spelled out country name?

  2. Are the “up to three genres” for the track or the album, or different based on which category the file falls under? If there are more than three genres provided, how should the three be selected? What do you want to show if there are no genres available?

  3. For the year, are you looking for the year of the release, the year of the earliest release in the release group, or the year of the first release of the work (or something different). Is the year to be the same in all parts of the naming of the file, or are you looking for potentially different years in the path versus the file name? What do you want to use if there is no year information available for your selected option – another year option or something else?

  4. Should artist names be as credited or standardized? For my file naming script, I use standardized for setting the path (including the initial based on the sort name), and then only show the credited name as part of the track file name if it is credited differently from the standardized name or if there are additional featured artists on the track. This helps avoid creating unnecessarily long paths or file names by not repeating information. Other do this differently.

  5. How do you want to deal with missing or invalid information, such as a missing year or country, or the CD number of a non-CD release?

Based on the answers, the actual file naming should be relatively straighforward for each category, with each using its own specified format. The next, and more difficult, step to consider is how to decide which category the matching release falls into. In other words, for each of your seven categories, how do you decide if a release fits into that category? Also, which category takes precidence if a release could fit in more than one category? What category will you use as the default, if a release doesn’t fit the requirements of any of them?

In general, I think that most categories can be identified based on the release’s primary and secondary release group types. The possible exception to this is “Radio mixes” and “Top 40”. What criteria will be used to identify items in these categories?

Also, it appears that you want to treat each track from an incomplete album as a single rather than storing them as tracks on an album. Is this correct? That also begs the question as to the work flow that you plan to use to process the files – identify the releases and attach the files to the tracks in the selected releases.

Anyway, these are the sorts of things that we (or at least me) need to consider in order to provide any meaningful assistance.


Hi rdswift,

Wow, I definitely overlooked some aspects, didn’t I? :slight_smile: Thanks for prompting a more analytical approach.

Alright, let’s address these questions:

  1. By country: Using the full-spelled name of the country for the first artist listed will make searches easier. Abbreviating to just “US” instead of “United States” could limit search functionality

  2. Genres: If there are more than three genres listed, prioritizing the first three would suffice. However, If that adds too much complexity, I’m flexible on this point and wouldn’t mind if all the genres are listed. “No genre” for tracks without a listed genre works for me.

  3. Year: Is the release year of the album/song. “xxxx” for missing years.

  4. Artist name: Your preferred format for artist names makes sense to me. Standardization to avoid long names is definitely a plus (As you stated).
    I prefer the following format: “Neil Young” (Not “Young Neil”), “Beatles, The” (Not “The Beatles”).
    The featuring artist would be: “Artist, The (ft. second artist)”.

  5. Missing info: “0000” for missing years, “No country” for missing country info, and leaving the CD number blank for songs from single CDs all sound good. Using the format “02-12” for indicating CD and track numbers where applicable, and “- 12 -” for standalone tracks, with leading zeroes for track numbers, makes everything easily identifiable and searchable.

I hope this all makes sense. My thinking process seems to lack some deep understanding of these naming structures and I realize there might be numerous exceptions to these rules, especially for classical music and DJ-mixes. Thankfully, my collection doesn’t include classical music. If dealing with DJ-mixes becomes too complex, lumping them together might be the easiest solution :slight_smile:

I’m fine with the code ending up in a longer format if it helps with clarity and ease of adjustment. It’s crucial for me to be able to understand what’s happening.

Thanks again for your time and willingness to assist.

Cheers, Luke