Change Jear - Album

I have this at the moment

$if($eq(%musicbrainz_albumartistid%,89ad4ac3-39f7-470e-963a-56509c546377), 
  
$left($if2(%albumartistsort%, %artistsort%),40)/ 
$if(%date%,$left(%date%,4)) $left(%album%,65) / 
%tracknumber% $left(%title%,40) - $left($if2(%artistsort%, %artist%),40) 
  
, 
$upper($firstalphachar($if2(%albumartistsort%, %artistsort%),#)) 
/$left($if2(%albumartistsort%, %artistsort%),65)/ 
$if(%date%,$left(%date%,4)) $left(%album%,50) / 
%tracknumber% $left(%title%,40) - $left($if2(%artistsort%, %artist%),40) 
  
)

i do not know HowTo get
Album - Jear

Hope for help

So you currently get “Year Album” but want to reverse it and add a dash in between. To get the album name you use %album%. The year is in %date%, but you only need the first 4 characters of this if you just want the year. Have a look at the script, there is already code for this:

 $if(%date%,$left(%date%,4)) $left(%album%,65)

Just reverse the two parts and add " - " between them to get name first:

$left(%album%,65)-  $if(%date%,$left(%date%,4))

Take care, this code is twice in your script and both occurrences should be corrected.

2 Likes

Ok THX
What I have now:

$if($eq(%musicbrainz_albumartistid%,89ad4ac3-39f7-470e-963a-56509c546377), 
  
$left($if2(%albumartistsort%, %artistsort%),40)/ 
$left(%album%,65)$if(%date%,$left( - %date%,7))/ 
%tracknumber% $left(%title%,40) - $left($if2(%artistsort%, %artist%),40) 
  
, 
$upper($firstalphachar($if2(%albumartistsort%, %artistsort%),#)) 
/$left($if2(%albumartistsort%, %artistsort%),65)/ 
$left(%album%,65)$if(%date%,$left( - %date%,7))/ 
%tracknumber% $left(%title%,40) - $left($if2(%artistsort%, %artist%),40) 
  
)

I changed:
$left(%album%,65)$if(%date%,$left( - %date%,7))/
not to have
Album -
if there is no date.

What do you think?
Will this cause Problems?

That will work. Although I would have written the date part as

$if(%date%, - $left(%date%,4))

But just because I find this easier to read and understand, it will have the same output.

2 Likes

Great THX

maybe you can help me using this Renaming Script also to sort incomplete albums like described here:

The idea is to remove the tags with the plugin as you’ve already suggested in this thread

and adapt the renaiming script ( but I don’t know how) that if Tracknumber (removed from the Plugin) is 00 then
No Tracknumber should appear in Filename

%tracknumber% $left(%title%,40) - $left($if2(%artistsort%, %artist%),40) 

Instead of %tracknumber% use $if($ne(%tracknumber%,0),%tracknumber% )

1 Like

ok
what I have now is

$if($eq(%musicbrainz_albumartistid%,89ad4ac3-39f7-470e-963a-56509c546377), 
  
$left($if2(%albumartistsort%, %artistsort%),40)/ 
$left(%album%,65)$if(%date%, - $left(%date%,4))/ 
$if($ne(%tracknumber%,00),%tracknumber% )$left(%title%,40) - $left($if2(%artistsort%, %artist%),40) 
  
, 
$upper($firstalphachar($if2(%albumartistsort%, %artistsort%),#)) 
/$left($if2(%albumartistsort%, %artistsort%),65)/ 
$left(%album%,65)$if(%date%, - $left(%date%,4))/ 
$if($ne(%tracknumber%,00),%tracknumber% )$left(%title%,40) - $left($if2(%artistsort%, %artist%),40) 
  
)

Then I have enabled The plugin norelease with this settings

asin,barcode,catalognumber,date,label,media,releasecountry,releasestatus,album,albumsort,discnumber,totaldiscs,tracknumber,totaltracks

What I get ist OK so fare

grafik

BUT if the songs belong to a Various Artist Album
I get This

grafik

I dont want to Change the renaiming Skript

can the necessery changes be done in the plugin?
or is it better to do the whole things in Scripting?
unset Album etc.

Hope for help
regards witzker

Your naming script currently uses the album artist for the folder name. That doesn’t make much sense if you don’t deal with albums.

You should unset albumartist and albumartistsort and maybe update your naming script to use artist and artistsort instead.

1 Like

I now unset albumartist and albumartistsort:
and this:

asin,barcode,catalognumber,date,label,media,releasecountry,releasestatus,album,albumsort,discnumber,totaldiscs,tracknumber,totaltracks,albumartist,albumartistsort

I get this
the first caracter is missing

grafik

Is it possible to keep the renaming skrip as it is - that it will work for other albums and I have only to deactivate the plugin

I don’t see what is missing, can you give an example?

Yes. The script uses code like $if2(%albumartistsort%, %artistsort%), which will use albumartistsort if it is available and otherwise artistsort.

schould look like this
A
-Artist
–title - Artist
grafik

Can you pls. modyfy the skript that it works mormaly when the plugin is disabled?
asin,barcode,catalognumber,date,label,media,releasecountry,releasestatus,album,albumsort,discnumber,totaldiscs,tracknumber,totaltracks,albumartist,albumartistsort

Try also unsetting musicbrainz_albumartistid, that should fix the issue with the first character folder missing (and also is one thing that really should be unset for files without album).

A general question is how you want to have real Various Artists albums to be sorted. Do you want them to be in the folder V/Various Artists or directly in Various Artists? Because if you want to have them sorted as V/Various Artist:s it would behave exactly the same as all other albums and we could simplify your script to just:

$upper($firstalphachar($if2(%albumartistsort%, %artistsort%),#)) 
/$left($if2(%albumartistsort%, %artistsort%),65)/ 
$left(%album%,65)$if(%date%, - $left(%date%,4))/ 
$if($gt(%tracknumber%,0),%tracknumber% )$left(%title%,40) - $left($if2(%artistsort%, %artist%),40)
2 Likes

THX
with Plugin on
Various Artistrists now go under artists as they schould
But everything goes under #

grafik

with Plugin Off it would be great if Various Artists would be an extra folder Various Artists

Maybe artistsort is not set? Try instead of $if2(%albumartistsort%, %artistsort%) to use $if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%). Also there must be no space between the arguments.

Ok, this final proposal should do it then:

$if($ne(%musicbrainz_albumartistid%,89ad4ac3-39f7-470e-963a-56509c546377),
$upper($firstalphachar($if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%),#))/)
$left($if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%),65)/
$left(%album%,65)$if(%date%, - $left(%date%,4))/
$if($gt(%tracknumber%,0),%tracknumber% )$left(%title%,40) - $left($if2(%artistsort%,%artist%),40)
2 Likes

Btw, what are all those length limits in the code, such as use the first 65 characters for the artist folder name and the first 40 characters for the title? The values look rather randomly chosen, is there some specific reason for applying those limits?

1 Like

I had problems with Path lengs - so I tried not to lose to much

1 Like

the plugin removes:

asin,barcode,catalognumber,date,label,media,releasecountry,releasestatus,album,albumsort,discnumber,totaldiscs,tracknumber,totaltracks,albumartist,albumartistsort

with laterst code plugin ON I get:
grafik

now nonalbum tracks are there?

THX for your pation

That means there is a tag for album name with “[non-album tracks]”. Don’t only just save and look at the results, also look at the tags listed at the bottom when you select a file. It will show you exactly what is and what is not there. Maybe the files already contained this tag from a previous save. Have you reloaded the releases after enabling the plugin? Where the files matched to a release on the right?

2 Likes

What I have now is:

Filenaming:

$if($ne(%musicbrainz_albumartistid%,89ad4ac3-39f7-470e-963a-56509c546377),

$upper($firstalphachar($if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%),#))/)

$left($if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%),65)/

$left(%album%,65)$if(%date%, - $left(%date%,4))/

$if($gt(%tracknumber%,0),%tracknumber% )$left(%title%,40) - $left($if2(%artistsort%,%artist%),40)

Plugin
Last FM

norelease

asin,barcode,catalognumber,date,label,media,releasecountry,releasestatus,album,albumsort,discnumber,totaldiscs,tracknumber,totaltracks,albumartist,albumartistsort

Scripting:

$if($gt(%totaldiscs%,1),$set(tracknumber,%discnumber%$num(%tracknumber%,2)),$set(tracknumber,$num(%tracknumber%,2)))

I will load your last code and start new

$if($ne(%musicbrainz_albumartistid%,89ad4ac3-39f7-470e-963a-56509c546377),
$upper($firstalphachar($if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%),#))/)
$left($if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%),65)/
$left(%album%,65)$if(%date%, - $left(%date%,4))/
$if($gt(%tracknumber%,0),%tracknumber% )$left(%title%,40) - $left($if2(%artistsort%,%artist%),40)

soon back with results

THX again for taking care