Alphabetical subfolders before artist folder

Hello all, I had to recently reformat my computer and I forgot to export my naming script before doing so. I rip my CD’s to a folder, ex “D:\FLAC rips” and then had Picard add the tags and move/rename the files when I saved them. For the life of me, I cannot figure out how to recreate the folder structure in the renaming script.

The artist folder and actual file names are easy enough but I can’t remember how to get that initial folder that’s the first character of the artist name. I tried searching here but I couldn’t find the answer. Any suggestions? Thanks.

You can use the $firstalphachar function, see the documentation.

A typical use case would be adding the following script snippet to your file naming script at the position where you want to have the folder.

$firstalphachar(%albumartistsort%)/

This uses the album artist sort name, so “The Beatles” would be placed under “B” while “Michael Jackson” end up under “J”.

If you want to just use the first character of the artist name regardless whether it is an article or first name then just use %albumartist% instead of %albumartistsort%. This places The Beatles under “T” and Michael Jackson under “M”.

If you want person names filed under the first character of their first name, but still remove articles from band names, use
$swapprefix(%albumartist%) instead of just%albumartist%. Then The Beatles are under “B” but Michael Jackson under “M”.

6 Likes

Thanks, that’s definitely what I needed. I made a couple of adjustments while I’m doing this and here’s what I ended up with so far

$upper($firstalphachar($if2(%albumartistsort%, %artistsort%),#))/
$left($if2(%albumartistsort%, %artistsort%),30)/
$if2(%originalyear%,$left(%date%,4)) - %album% \($if(%date%,$left(%date%,4),----)\)$if(%label%, \(%label%\))/
$if($gt(%totaldiscs%,1),$if(%discnumber%,Disc $num(%discnumber%,1)/),)
$num(%tracknumber%,2) - $replace($replace($replace($replace($replace($replace(%title%,?,?),!,!),,),/,/),:,:),…,…)

This should work well for my normal stuff. However, it will not work the way I want on the compilations that I had going into the “Various Artists” folder. The way the script above is working, it creates a Various Artists folder under the letter V folder. If I recall correctly, I had a separate script that I used on compilations to make write to the Various Artists folder. Since I’m doing the script again anyways, I’m wondering if it’s possible to just have a single script that would check if it’s a compilation and then rename the folder/files differently than non-compilations? Here’s the way the Various Artists folders/files are structured.

At a quick glance, it looks like you want to simply leave out the first alpha character portion of the file path if it is a Various Artists album. This can be achieved by changing the first line of your script to:

$if($not(%compilation%),$upper($firstalphachar($if2(%albumartistsort%, %artistsort%),#))/)

This should work if you’re getting the metadata from MusicBrainz by matching your files to tracks on a release.

1 Like

Here is my script hope it helps someone

It will order the library in this order:

D:\A\ACDC\[1975] ACDC - T.N.T. - [flac]

It will create the
Alphabetic first letter of the artist folder
Artist Folder
[Year] Artist Name - Album - [.ext]
Track# - Track Name

`$noop(### Configuración de etiquetas basadas en los datos de MusicBrainz ###)

$noop(Asegurarse de que se establezcan múltiples valores para los campos relevantes)
$setmulti(album,%album%)
$setmulti(albumartist,%albumartist%)
$setmulti(artist,%artist%)
$setmulti(year,$if2(%originalyear%,%date:4%)) $noop(Usar el año original si está disponible)
$setmulti(tracknumber,%tracknumber%)
$setmulti(title,%title%)
$setmulti(genre,%genre%)

$noop(### Eliminación de etiquetas no deseadas ###)
$unset(comment) $noop(Eliminar comentarios de las etiquetas)

$noop(### Renombrar y organizar archivos ###)

$noop(Obtener la primera letra del nombre del artista o `#` si comienza con un número o símbolo)
$set(first_letter,$upper($firstalphachar($if2(%albumartist%,%artist%),#)))

$noop(### Crear la estructura de directorios: Letra -> Álbum Artista -> Álbum ###)

%first_letter%/
$if2(%albumartist%,Unknown Artist)/ $noop(Usar albumartist si está disponible, de lo contrario Unknown Artist)
[%year%] %albumartist% - %album% - [%_extension%]/ $noop(Usar albumartist en el nombre del álbum)
$if($gt(%totaldiscs%,1),Disc %discnumber%/,)
$num(%tracknumber%,2) - %title%

$noop(### Mejora de la estructura de directorios ###)

$noop(Agregar país de lanzamiento si está disponible)
$if2(%releasecountry%,Unknown Country) - %album%

$noop(###########################################)
$noop(# Script Information and Legal Notice    #)
$noop(###########################################)

$noop(### Created by: Juan A. Mendez ###)
$noop(### Contact info: universal.onestoptech@gmail.com ###)
$noop(### Script version: 1.0 ###)
$noop(### Date created: September 01, 2023 ###)

$noop(### About this Script ###)
$noop(This script was created to help organize music files based on metadata extracted)
$noop(from MusicBrainz. It automatically renames, structures, and organizes files)
$noop(based on artist, album, track number, and other metadata like genre and release year.)
$noop(The script can handle multi-disc albums and ensures that all information)
$noop(is properly categorized and structured. The result is a neatly organized)
$noop(folder structure that makes music libraries easier to manage and navigate.)

$noop(### Features of the Script ###)
$noop(1. Extracts metadata from MusicBrainz tags such as album, artist, track title, and genre.)
$noop(2. Renames files based on the artist and album name.)
$noop(3. Organizes multi-disc albums into separate folders based on disc number.)
$noop(4. Removes unwanted tags like comments to keep metadata clean.)
$noop(5. Adds country of release to the album folder name if available.)
$noop(6. Automatically creates subfolders based on the first letter of the album artist.)
$noop(7. Supports multiple values for key tags like albumartist and year.)
$noop(8. Creates an easily navigable directory structure for large music libraries.)

$noop(### Legal Notice ###)
$noop(This script is distributed under an open and permissive license. You are free to use, modify,)
$noop(and distribute this script for personal purposes, including adapting it to your needs.)
$noop(The script is provided "as-is" without any warranty of any kind, either expressed or implied.)
$noop(This includes, but is not limited to, the implied warranties of merchantability, fitness for)
$noop(a particular purpose, or non-infringement. The author is not liable for any damages or losses)
$noop(that may arise from the use or inability to use this script, even if advised of the possibility)
$noop(of such damages.)

$noop(### Restrictions ###)
$noop(1. This script is provided solely for personal use. Commercial redistribution or use without)
$noop(the author’s explicit consent is prohibited.)
$noop(2. Users are allowed to modify the script to suit their needs but must not misrepresent its)
$noop(original creation or ownership.)
$noop(3. The author's name and contact information should be retained in any modified versions.)
$noop(4. Users are responsible for ensuring compliance with all applicable laws, including)
$noop(copyright laws and those related to music tagging, distribution, or storage.)

$noop(### Usage Disclaimer ###)
$noop(This script is not affiliated with MusicBrainz or any other music metadata service.)
$noop(While every effort has been made to ensure the accuracy of the metadata processing,)
$noop(the author makes no guarantees regarding the quality or accuracy of the results.)
$noop(Use of this script is entirely at the user's own risk. Users should back up their data)
$noop(before running the script to prevent potential data loss or corruption.)

$noop(### Contact and Support ###)
$noop(If you encounter issues or have suggestions for improving this script, feel free to reach)
$noop(out to the author at universal.onestoptech@gmail.com. While the author is not obligated to)
$noop(provide ongoing support or updates, feedback is always appreciated.)

$noop(### Future Updates ###)
$noop(The script is currently at version 1.0. Updates may be released in the future to improve)
$noop(functionality, add features, or resolve potential bugs. If you wish to receive notifications)
$noop(about updates or new releases, please contact the author via email.)

$noop(###########################################)
$noop(# End of Script                          #)
$noop(###########################################)`