[Logo] Jaikoz and SongKong Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Stumped with folder renaming mask  XML
Forum Index -> Jaikoz Questions
Author Message
wilcoson

Pro

Joined: 05/04/2017 23:54:17
Messages: 24
Offline

Running into errors using this:
Code:
(albumartist.length>0  ? albumartist + folderseparator :(artist.length>0 ? artist + folderseparator : '')) 
 + (custom1.length>0 ? custom1 + '-' :'') + (album.length>0 ? album + ' [' :'') + (year.length>0 ? year + '-' : '')
 + (custom2='HD' ? custom2 + '-' :'') + (label.length>0 ? label + '-' :'') + (catalogno.length>0 ? catalogno + ']' :'') + folderseparator

I end up with:
EnglishSongs-DB-Custom11980.06.01-The Essential Aerosmith [2002-EnglishSongs-DB-Custom2HD-Columbia-88697 92210 2]

How can I get this:
1980.06.01-The Essential Aerosmith [2002-HD-Columbia-88697 92210 2]

Should be conditional on having both custom fields populated. If the custom fields are blank, statements should be ignored.

Thanks
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7485
Online

Hi, okay for ID3 formats (mp3, wav & aiff) Jaikoz custom1-5 field use the COMM (Comment) frame for ID3 and the COMM frame additionally contains a language and a Description field.

Unfortunately there is a bug that the rename mask is outputting the language and description rather than just the comment itself, I've raises issue in bugtracker.

The workaround is to make use of Javascripts find and replace on the value returned by comments

e.g

Code:
 (albumartist.length>0  ? albumartist + folderseparator :(artist.length>0 ? artist + folderseparator : '')) 
  + (custom1.replace('English','').replace('Songs-DB-Custom1','').length>0 ? custom1.replace('English','').replace('Songs-DB-Custom1','') + '-' :'')
  + (album.length>0 ? album + ' [' :'') + (year.length>0 ? year + '-' : '')
  + (custom2.replace('English','').replace('Songs-DB-Custom2','')='HD' ? custom2.replace('English','').replace('Songs-DB-Custom2','') + '-' :'') 
 + (label.length>0 ? label + '-' :'') + (catalogno.length>0 ? catalogno + ']' :'') + folderseparator
 


thanks Paul (Administrator)
wilcoson

Pro

Joined: 05/04/2017 23:54:17
Messages: 24
Offline

Hello, There must be an error in there somewhere as it's not letting me save. Nothing stands out however. Thanks
wilcoson

Pro

Joined: 05/04/2017 23:54:17
Messages: 24
Offline

NVM, i adjusted my logic and it seems to work:
Code:
 (albumartist.length>0  ? albumartist + folderseparator :(artist.length>0 ? artist + folderseparator : '')) 
   + (custom1.replace('English','').replace('Songs-DB-Custom1','').length>0 ? custom1.replace('English','').replace('Songs-DB-Custom1','') + '-' :'')
   + (album.length>0 ? album + ' [' :'') + (year.length>0 ? year + '-' : '')
   + (custom2.replace('English','').replace('Songs-DB-Custom2','').length>0 ? custom2.replace('English','').replace('Songs-DB-Custom2','') + '-' :'') 
  + (label.length>0 ? label + '-' :'') + (catalogno.length>0 ? catalogno + ']' :'') + folderseparator
 

Thanks Paul! Now I gotta figure out how to name the files
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7485
Online

Great, sorry about the typo.

thanks Paul (Administrator)
wilcoson

Pro

Joined: 05/04/2017 23:54:17
Messages: 24
Offline

Uh oh. For some reason I'm running into similar issue with tagging DSF files. Using this code I'm now getting a folder of:

Undercover [1983- -Songs-DB Custom2 -HD-Universal-UICY-40072]

It seemed to work before but now, not so much. Any thoughts?
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7485
Online

Well DSF uses ID3 same as Wav, Aiff and MP3s so is subject to the same issue, please check if your mask still works with the files it was working with

thanks Paul (Administrator)
wilcoson

Pro

Joined: 05/04/2017 23:54:17
Messages: 24
Offline

Mask still works on flac files as before
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7485
Online

It would work on Flac, but the mods were not for Flac since Flac does not use ID3, the original issue must have been for non Flac files ?

thanks Paul (Administrator)
wilcoson

Pro

Joined: 05/04/2017 23:54:17
Messages: 24
Offline

The original issue was impacting flacs as well. The solution resolved for all formats up until I edited it to add a 3rd custom field. The 3rd field brought the original issue back, so I removed the new line, but the issue remained. I will send the entire code I am trying to get to work, maybe that will help or maybe there is a better mask altogether. Thanks Paul!

Code:
 PersonalMax=190;
  Fills=12; //2 slash's, 6 for year, 3 for seperation of artist/album
  (albumartist.length>0 ? WhichArtist = albumartist : (artist.length>0 ? WhichArtist = artist : WhichArtist = 'noartist'));
  (artist.length>0 ? RWhichArtist = artist : (albumartist.length>0 ? RWhichArtist = albumartist : RWhichArtist = 'noartist'));
  PreTitle=RWhichArtist.length + WhichArtist.length + album.length + Fills;
  ForFileName=PersonalMax - PreTitle;
  FullSum=title.length + album.length + WhichArtist.length + 13;
  NoAlbumSum=title.length + WhichArtist.length + 10;
  TitleTrackSum=title.length + 7;
  (TitleTrackSum>ForFileName ? (
  	WhatToCut=TitleTrackSum-ForFileName+3,
  	NewAlbum='',
  	NewArtist='',
  	NewTitle=title.substring(0,(title.length-WhatToCut)) + '...'
  	) : (
  		NoAlbumSum>ForFileName ? (
  		WhatToCut=NoAlbumSum-ForFileName+3,
  		NewAlbum='',
  		NewArtist=WhichArtist.substring(0,(WhichArtist.length-WhatToCut)) + '...',
  		NewTitle=title + ' - '
  		) : (
  			FullSum>ForFileName ? (
  			WhatToCut=FullSum-ForFileName+3,
  			NewAlbum=album.substring(0,(album.length-WhatToCut)) + '...',
  			NewArtist=WhichArtist + ' - ',
  			NewTitle=title + ' - '
  			) : (
  				WhatToCut='',
  				NewAlbum=album,
  				NewArtist=WhichArtist + ' - ',
  				NewTitle=title + ' - ')
  		)
  	)
  );
 
 (albumartist.length>0  ? albumartist + folderseparator :(artist.length>0 ? artist + folderseparator : '')) 
  + (custom1.replace('English','').replace('Songs-DB-Custom1','').length>0 ? custom1.replace('English','').replace('Songs-DB-Custom1','') + '-' :'')
  + (album.length>0 ? album :'')
  + (' [' + (year.length>0 ? year + '-' : ''))
  + (custom2.replace('English','').replace('Songs-DB-Custom2','').length>0 ? custom2.replace('English','').replace('Songs-DB-Custom2','') + '-' :'') 
 + (custom3.replace('English','').replace('Songs-DB-Custom3','').length>0 ? custom3.replace('English','').replace('Songs-DB-Custom3','') + '-' :'') 
  + (label.length>0 ? label + '-' :'')
  + (catalogno.length>0 ? catalogno + ']' + folderseparator :'')
 
 
Forum Index -> Jaikoz Questions
Go to:   
Powered by JForum 2.1.6 © JForum Team