[Logo] Jaikoz and SongKong Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Albumartist & Album in foldername  XML
Forum Index -> Jaikoz Questions
Author Message
stufarnham



Joined: 19/06/2015 11:39:14
Messages: 3
Offline

I can't seem to make folder renaming based on metadata behave the way I want it to.

As an example: I have an album named "Motetten und Kantaten" with the albumartist being "John Eliot Gardiner"

The folder structure I want is a single folder named using albumartist and album:

.../John Eliot Gardiner - Motetten und Kantatten

The folder structure I am winding up with is

.../John Eliot Gardiner/Motetten und Kantaten

i.e. A folder with the album name nested inside a folder with the albumartist name.

Does Jaikoz enforce the hierarchy? As far as I can can tell my Javascript is correct:

function pad(number, length) {
if (number == '') {
return '';
}
var str = '' + number;
while (str.length < length) {
str = '0' + str;
}
return str;
}

function ifnotempty(value, sep) {
return value.length > 0 ? value + sep : '';
}

function ifnotempty2(value1, value2, sep) {
return value1.length > 0 ? value1 + sep : value2.length > 0 ? value2 + sep : '';
}

ifnotempty2(albumartist, artist, folderseparator) + ifnotempty(album, folderseparator)

Thanks in advance...

Stu
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7361
Offline

Hi folderseperator is what we call '/' on OSX/Linux and '\' on Windows

So just change last line to

Code:
 ifnotempty2(albumartist, artist, ' - ') + ifnotempty(album, '') 
 

thanks Paul (Administrator)
 
Forum Index -> Jaikoz Questions
Go to:   
Powered by JForum 2.1.6 © JForum Team