INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: simple file renaming preset for album artist  (Read 3004 times)

thunderlips222

  • Recent member
  • *
  • Posts: 23
simple file renaming preset for album artist
« on: September 10, 2013, 08:37:31 am »

I'd like to set up the file renaming tool so any albums with multiple artists get renamed as [track #] [artist] - [name] while any albums with just 1 artist get renamed [track #] [name]
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: simple file renaming preset for album artist
« Reply #1 on: September 10, 2013, 12:25:03 pm »

[Track #]ifelse(isequal([album artist (auto)], /(Multiple Artists/)), / [artist] -) [Name]
Logged
The opinions I express represent my own folly.

thunderlips222

  • Recent member
  • *
  • Posts: 23
Re: simple file renaming preset for album artist
« Reply #2 on: September 10, 2013, 02:15:32 pm »

Thx MrC, I'm sure this will be simple for me soon when I learn the expression language
Logged

thunderlips222

  • Recent member
  • *
  • Posts: 23
Re: simple file renaming preset for album artist
« Reply #3 on: September 11, 2013, 08:13:24 am »



Hi again, so this is what's showing up when I copy/paste that.

For me to understand the language better, is this how you'd explain the expression you posted?

track number first, stays the same regardless of what kind of album it is
guessing there should then be a space
ifelse is for nesting if/then situations
the isequal is the first if/then sequence, here it's set so that if album artist (auto) = (Multiple Artists) you'll see the artist name before the track name. the slash marks before the parentheses make sure the parentheses are treated as characters, not as expression containers.

where i'm lost:
the floating slash mark before artist I don't understand. The parentheses after the hyphen show up in the filename. There's a 0,/ after the track # for both songs and for both songs the artist comes up even though only one has a (Multiple Artists) value.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: simple file renaming preset for album artist
« Reply #4 on: September 11, 2013, 11:59:07 am »

it appears MC18 for the Mac still has problems with the escape character in the expression language.  So use this until it gets fixed:

[Track #] ifelse(isequal([album artist (auto)], Multiple Artists, 7),  [artist] -) [Name]
Logged
The opinions I express represent my own folly.

thunderlips222

  • Recent member
  • *
  • Posts: 23
Re: simple file renaming preset for album artist
« Reply #5 on: September 12, 2013, 12:25:12 am »

Thx!
So close. There are 2 spaces for non-album-artist tracks between the track # and song name.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: simple file renaming preset for album artist
« Reply #6 on: September 12, 2013, 01:07:00 am »

Yup, sorry, I didn't notice due to the font I use.

Since we can't easily escape the trailing space (yet), just do this:

   if(isequal([Album Artist (auto)], Multiple Artists, 7), [Track #] [Artist] - [Name], [Track #] [Name])

An internal space doesn't need escaping.
Logged
The opinions I express represent my own folly.

javidan

  • Junior Woodchuck
  • **
  • Posts: 76
Re: simple file renaming preset for album artist
« Reply #7 on: September 12, 2013, 07:44:43 am »

I'd like to set up the file renaming tool so any albums with multiple artists get renamed as [track #] [artist] - [name] while any albums with just 1 artist get renamed [track #] [name]

Hey this is a great idea. :)

Thanks for asking, I have actually added this "feature" to my renaming script.
Works really well for soundtracks/compilation albums.
Logged

thunderlips222

  • Recent member
  • *
  • Posts: 23
Re: simple file renaming preset for album artist
« Reply #8 on: September 12, 2013, 07:59:31 am »

glad to hear, it was just the way I had things sep up on foobar.

The tricky part for me now is Directory Rules.

I'm moving my files to folders based on a relational Genre field (Genre2) I created. This is because I have artists scattered across diff. folders. and want to consolidate them by genre without manually mislabeling certain artists with different genres.

With compilations/mutliple artist albums my plan is to manually change the Genre tag instead of using Genre2. Since a lot of the compilations already have 2 or 3 artists with Genre2, if I changed them it would change those Genre2 tags for non-compilation tracks by the same artist.

With the same logic I tried to set up the Directory rule so if it is a compilation, the directory rule is looking at genre but if it's not the directory rule is looking at genre2

if(isequal([Album Artist (auto)], Multiple Artists, 7), [genre]/[artist] - [album] ([year]), [genre2]/[artist] - [album] ([year])

It gives me back:

Base Path
/1, Electronic/(Multiple Artists) - After Dark 2 (2013)/
Logged

javidan

  • Junior Woodchuck
  • **
  • Posts: 76
Re: simple file renaming preset for album artist
« Reply #9 on: September 13, 2013, 09:00:33 am »

I'm moving my files to folders based on a relational Genre field (Genre2) I created. This is because I have artists scattered across diff. folders. and want to consolidate them by genre without manually mislabeling certain artists with different genres.

With compilations/mutliple artist albums my plan is to manually change the Genre tag instead of using Genre2. Since a lot of the compilations already have 2 or 3 artists with Genre2, if I changed them it would change those Genre2 tags for non-compilation tracks by the same artist.

With the same logic I tried to set up the Directory rule so if it is a compilation, the directory rule is looking at genre but if it's not the directory rule is looking at genre2

if(isequal([Album Artist (auto)], Multiple Artists, 7), [genre]/[artist] - [album] ([year]), [genre2]/[artist] - [album] ([year])

It gives me back:

Base Path
/1, Electronic/(Multiple Artists) - After Dark 2 (2013)/

Bear with me because I'm not good with scripts so do correct me if I'm getting your idea confused. You've set up a relational field called [Genre2] right? And what field is it tied to? (Relational fields are insanely powerful but are restricted to only [Artist/Series/Album]) I'm guessing [Genre2] is tied to [Artist].

i.e. You are setting every specific artist to a "super" genre so to speak. e.g. Michael Jackson would likely have a [Genre2] of "Pop" although he could still have plenty of songs with different genres in [Genre]

Thus a compilation album would use [genre]/[artist] - [album] ([year])
A single artist album would use  [genre2]/[artist] - [album] ([year])

Two questions, did you check if you were closing your parenthesis for your if(...) function?
MrC has corrected me, the 2nd question is my own error:

And did you check whether your function was testing for (Multiple Artists) instead of Multiple Artists? The code you pasted looks like it will fail because [Album Artist (auto)] is going to return (Multiple Artist), therefore a isEqual() for Multiple Artist will fail and it is correctly returning [genre2].
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: simple file renaming preset for album artist
« Reply #10 on: September 13, 2013, 10:45:24 am »

The errors in the expression are due to the forward slash escape characters.  JRiver hasn't yet worked out all the niggles.  Forward slash is the escape character, yet is also the path separator character in Unix/Linux/Mac/POSIX file systems.

Until these wrinkles are worked out, you need to write expressions in such a way as to avoid having to use forward slashes.

I'll provide some techniques if you need them.

And did you check whether your function was testing for (Multiple Artists) instead of Multiple Artists? The code you pasted looks like it will fail because [Album Artist (auto)] is going to return (Multiple Artist), therefore a isEqual() for Multiple Artist will fail and it is correctly returning [genre2].

Mode 7 of IsEqual() means sub-string compare.  We used this mode to avoid having to escape the parens with the problematic forward slash.
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up