[Logo] Jaikoz and SongKong Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
replace the forward slash when naming but keep the tag  XML
Forum Index -> Jaikoz Questions
Author Message
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

I'm trying to metatag/rename the artist AC/DC and having some difficulty getting everything to display correctly.

After autocorrecting/double checking if I go to save the file WITHOUT an entry in "Preferences->File and Folder Correct->File and Folder Naming" to replace "/" with "_" I get the folder structure of Code:
Base Folder/AC/DC/(1980) AC/DC - Back in Black/

meaning the actual songs are four folders deep from the Base Folder.

But if I DO have an entry for replacing "/" with "_" i get this folder structure:
Code:
Base Folder/AC_DC_(1980) AC_DC - Back in Black

meaning the actual songs are one folder deep from the Base Folder.

What I really want is my songs two folders deep from the Base Folder, one folder for the Artist and one for the Album. I think this just means that I need Jaikoz to replace the "/"'s with "_" in the folder renaming, but not for it to touch the "/" being used as a folder separator.

Any help in how I would accomplish this would be greatly appreciated.

Thanks!

Edit: Just found this post http://www.jthink.net/jaikozforum/posts/list/4450.page Is this still my best option? Please say no :p
paultaylor

Pro
[Avatar]

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

Ah the AC/DC problem. Yes the problem is that when the Replace From Char with to Char option is used at save time it has no idea when a '/' is being used to separate folders and when it is part of the fieldname. So what we need to do is address this issue in the rename mask. I have edited the default rename mask for folder naming so that AC/DC becomes AC_DC as follows:

Code:
 function ifnotempty(value,sep){
      value=(value=='AC/DC' ? 'AC_DC' : value);
      return value.length > 0 ? value + sep : '';
  }
  
  function ifnotempty2(value1,value2,sep){
      value1=(value1=='AC/DC' ? 'AC_DC' : value1);
      value2=(value2=='AC/DC' ? 'AC_DC' : value2);
 
      return value1.length > 0 ? value1 + sep :value2.length > 0 ? value2 + sep:'' ;
  }
  
  ifnotempty2(albumartist,artist,'/') + ifnotempty(album,'/') + (disctotal>1 ? discno  + '/' : '')
 


And this works. Of course this only works for AC/DC if you have other artists with the same problem you would have to modify the script to include these but at least it works in this case.

For the filename renaming part the '/' gets removed automatically because '/' is not allowed so you just get ACDC but if you would want the underscore here as well you would have to do a similar change here as well.


Im struggling to think of a general purpose change I could make to Jaikoz to make it work automatically, if you have an idea let me know.

thanks Paul (Administrator)
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

Paul, thanks so much for you're reply, but I was REALLY hoping that wasn't gonna be the answer. I knew I could do something along those lines but as you surmised, AC/DC is just the most common example. There are many other items that contain a forward slash. I've replaced many of them with underscores or ampersands but I'd really like to avoid doing that. And I already have an incredibly complicated renaming scheme for both file and folder options.

I guess I really don't know the technicals of how you implement the Replace From Char with to Char option but it seems to me that its a order of operations issue. As in, if Jaikoz manipulated the different fields BEFORE they were sent to the renaming mask it could be avoided. Or if a Placeholder is inserted inplace of "Folder seperator" (though I suppose that is a sort of placeholder) and the forward slash's were inserted only directly before the actual renaming (i.e. after all the other char have been replaced in the Replace From Char with to Char option. But again, this is just a layman's ramblings.
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

I suppose I could add something to the beginning of all the strings along the lines of:
Code:
 string noslashartist = (artist.indexOf('/') == -1 ? artist : artist.replace('/', '_'));
 string noslashalbumartist = (albumartist.indexOf('/') == -1 ? albumartist : string albumartist.replace('/', '_'));
 string noslashtitle = (title.indexOf('/') == -1 ? title : title.replace('/', '_');
 *etc etc etc
 


and then use my new "noslashxxx" strings in my renaming. But I'm not much of a coder and not really sure this is optimal (or even if it works). Think I should add some check to see if there actually IS an artist, album artist, title etc...
paultaylor

Pro
[Avatar]

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

seth.feinberg wrote:
but it seems to me that its a order of operations issue. As in, if Jaikoz manipulated the different fields BEFORE they were sent to the renaming mask it could be avoided. 


Ah, youve solved it !

I was thinking that Replace From Char with to Char was applied at save time, but it isn't it is applied when you run Correct Subfolder from Metadata.

As you said currently we perform the rename mask on the fieldnames and then do Replace from Char but if Jaikoz did Replace from Char first and then perform the rename mask there would be no problem. I can do this for the next release.

thanks Paul (Administrator)
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

Sweet! so I should hold off on adding those lines from my second post to my renaming masks? When do you think the new release can/will be released (I'm in no rush, just curious)?
paultaylor

Pro
[Avatar]

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

I expect the next release will be in about a month.

thanks Paul (Administrator)
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

Hey Paul!

No rush, just curious if this has been implemented yet? I've been on other projects, but opened up jaikoz yesterday to see if it informed me of an update and it didn't. Again no rush, thanks for everything you do with this, just curious what the status of this was...
paultaylor

Pro
[Avatar]

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

Sorry, yes I did apply and release a fix for this problem.

If you go to Preferences:File and Folder Naming:Correct Filename from Metadata
and add a '/' to '_' mapping to Replace 'From' Character 'To' Character

then when you run Correct Filename from Metadata AC/DC will be converted to AC_DC

Unfortunately it didnt quite work because if you then run Correct Subfolder from Filename on OSX/Linux because the '/' seperating each folder component get converted to '_'

So you could apply the fix and just run Correct Filename from Metadata and then change back, otherwise this will be resolved for the next release..


thanks Paul (Administrator)
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

Thanks Paul.

That work around seems like kind of a lot of work. If I understand correctly I would change the / to _ in the file then run "Correct Folder from Metadata" then switch the tag info back to / and then add / to _ in the "Correct Filename from Metadata" and then run it? Seems a bit involved and still means my folder structure is messed up. Thanks so much for the suggestion but I think I'm just gonna hold off till a full fix is in place (seeing as I'm going to have to replace literally thousands of underscores and ampersands with forward slashs). I've got plenty to do in the meantime.
paultaylor

Pro
[Avatar]

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

No thats not what I was saying, I was saying you can use this fix to easily correct your filenames but you cannot use it to correct your subfolder structure.

But rereading you original question you only talk about the folder structure not the last filename component part (i.e AC_DC.mp3) so I guess this is not much use to you

thanks Paul (Administrator)
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

yeah after rereading and sitting on it for a sec I realized what you were talking about. And yes the folder's is the issue because instead of nesting artist/album it creates a giant folder (AC_DC_(1992) AC_DC T.N.T.). Or if I leave the slashs in it creates a super nested AC/DC/ (1992) AC/ DC T.N.T./ AC/ DC - title of song.

Anyways, thanks again, I'll stay put and tuned in for the next release
paultaylor

Pro
[Avatar]

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

At last, fixed for new release,will be out later this week.

thanks Paul (Administrator)
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

paultaylor wrote:
At last, fixed for new release,will be out later this week. 


Saaahhhhhweeeet. thanks paul
loess

Enthusiast

Joined: 23/08/2009 20:38:11
Messages: 10
Offline

Awesome, I'm on OSX and this was bugging me too. Thank you, Paul!
paultaylor

Pro
[Avatar]

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

Now resolved in Jaikoz 5.0.0 http://jthink.net/jaikozforum/posts/list/6880.page

thanks Paul (Administrator)
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

paultaylor wrote:
Now resolved in Jaikoz 5.0.0 http://jthink.net/jaikozforum/posts/list/6880.page 


You can't see me now but if you could you would be watching a pretty mean robot dance...
paultaylor

Pro
[Avatar]

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

Cool,. but have you actually tried it yet, please check it works for you.

thanks Paul (Administrator)
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

paultaylor wrote:
Cool,. but have you actually tried it yet, please check it works for you. 


Ahhh good point, I'll test tonight
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

paultaylor wrote:
Cool,. but have you actually tried it yet, please check it works for you. 


Paul, What's the best way to install this? When I tried to install it over the old instance I got an "Incompatible installation detected. Uninstall it first or choose another directory". I would like to keep as many of my settings as possible...
paultaylor

Pro
[Avatar]

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

Aaah yes, this is an annoying problem with the installer that it doesn't let you overwrite a previous installation (that uses Izpack 1) with one built with Izpack 5. But your settings are not installed in this folder anyway (they are stored in (C:\Users\username\Jaikoz) so if you install Jaikoz 5 to a different location OR manually delete the existing Jaikoz installation and then install Jaikoz you will still keep your settings.

thanks Paul (Administrator)
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

paultaylor wrote:
...OR manually delete the existing Jaikoz installation and then install Jaikoz you will still keep your settings.
 


I understand that there is a Jaikoz folder with userdata in the, well, Userdata folder, but I saw some files with setting in the name in the Jaikoz folder under "Program Files (x86)" folder so thought I'd check.

When you say manually delete the existing Jaikoz installation, do you mean delete that Jaikoz folder in the "Program Files (x86)" folder or just the Jaikoz.exe INSIDE that folder?
paultaylor

Pro
[Avatar]

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

Delete the Jaikoz folder.

thanks Paul (Administrator)
seth.feinberg

Pro

Joined: 17/12/2011 20:48:04
Messages: 42
Offline

Success! It appears to work. I loaded up the dreaded AC_DC folder, changed all the artists/albumartists to AC/DC and corrected folder and filename from metadata and...drumroll please...nothing changed. Which at first was disappointing til I realized that's what was supposed to happen (since the filenames and folders already had AC_DC and not AC/DC).

Thanks for implementing the change Paul! Now i just need to get out of this rut of compulsively changing my renaming masks. DAMN YOU FILE CHARACTER LIMITS!
 
Forum Index -> Jaikoz Questions
Go to:   
Powered by JForum 2.1.6 © JForum Team