INTERACT FORUM

More => Old Versions => JRiver Media Center 19 for Windows => Topic started by: Mr James Dunn on August 26, 2013, 05:35:39 am

Title: Help with expression for organising albums
Post by: Mr James Dunn on August 26, 2013, 05:35:39 am
Hi,

Some of my albums are multiple discs and the discs have titles rather than disc numbers. I have set up a custom [Disc Title] field and I'm trying to write an expression so that i can rename my files to create a folder (after [Artist]\[Album]..) using the [disc title] if there is one, the [disc #] if there isn't a title, or if there isn't either (for single disc albums) just the [track #] and [name] without creating a separate folder.

e.g.

Biffy Clyro\Opposites\The Land at the end of our toes\01- Different People.flac

or,

Led Zepplin\Physical Graffiti\Disc 2\01- In the Light.flac

or,

Audioslave\Out of Exile\01 - Your time has come.flac

I'm currently working with the If(IsEmpty()) expression but can seem to get it to works, can anyone work this out for me?

Cheers

James
Title: Re: Help with expression for organising albums
Post by: MrC on August 26, 2013, 11:56:35 am
Use this:

  FirstNotEmpty (http://wiki.jriver.com/index.php/Media_Center_expression_language#FirstNotEmpty)([Disc Title], [Disc #])

So your complete path under your media base path might be:

   [Album Artist (auto)\[Album]\delimit(FirstNotEmpty([Disc Title], [Disc #]),\)\[Track #] - [Name]

See:

   http://wiki.jriver.com/index.php/Media_Center_expression_language#FirstNotEmpty (http://wiki.jriver.com/index.php/Media_Center_expression_language#FirstNotEmpty)
Title: Re: Help with expression for organising albums
Post by: Mr James Dunn on August 26, 2013, 02:05:24 pm
Mr C,

Thanks for that.

Much appreciated.

Regards

James
Title: Re: Help with expression for organising albums
Post by: Mr James Dunn on August 26, 2013, 02:53:39 pm
Mr C,

I've just tried it on some files and where there is a [Disc Title] it works fine, but where there isn't it shows the name as [Album Artist (Auto)]\[album]\Unknown Disc Title\[Track #] - [Name].flac, it doesn't reference the [disc #] when there is one and still shows the same when there is neither a [disc title] or ]disc #].

Ive checked the spellings etc and they all seem OK. Could be something in my custom field set up that causes the problem?

Cheers

James
Title: Re: Help with expression for organising albums
Post by: MrC on August 26, 2013, 03:08:44 pm
In some places, such as the Rename tool, you'll need to use a field's raw format:

  FirstNotEmpty([Disc Title,0], [Disc #,0])

You can probably just use that in all situations for your needs.

Search both Rename and raw here for more explanation:

    http://wiki.jriver.com/index.php/Media_Center_expression_language (http://wiki.jriver.com/index.php/Media_Center_expression_language)
Title: Re: Help with expression for organising albums
Post by: Mr James Dunn on August 26, 2013, 03:49:35 pm
Perfect!!

Thanks.

I do try to follow work out the expressions myself, but the 'logic' ends up making my head hurt!!

J