josephw / titl

Tools for iTunes Libraries
60 stars 12 forks source link

Space in directory path lead to error #24

Closed josephw closed 9 years ago

josephw commented 9 years ago

Original issue 24 created by josephw on 2013-06-22T14:25:40.000Z:

What steps will reproduce the problem?

  1. Copy files from old directory containing spaces to new location (OS X)
  2. Run MoveMusic command
  3. Check information in iTunes

What is the expected output? What do you see instead?

Expected output: "file://localhost/Volumes/HDD/Music" Real output: "file://localhost/Volumes/HDD/My\ music" (old location/nothing changed)

What version of the product are you using? On what operating system?

titl-core-0.3-SNAPSHOT.jar, OS X

Please provide any additional information below.

When the old location doesn't contain spaces everything works like a charm. I have moved my files successfully from:

"file://localhost/Volumes/OLDHDD/Music" (where subfolder still contain spaces) to "file://localhost/Volumes/NEWHDD/Music"

But with spaces it doesn't work. I used the following command:

java -Xmx512m -XX:MaxPermSize=256m -jar titl-core-0.3-SNAPSHOT.jar MoveMusic --use-urls ~/Music/iTunes/iTunes\ Library.itl "file://localhost/Volumes/HDD/My\ Music" "file://localhost/Volumes/HDD/Music"

josephw commented 9 years ago

Comment #1 originally posted by josephw on 2013-07-19T13:39:51.000Z:

Have you examined the paths in the original file to confirm how the path is encoded? The space may well be percent-encoded as 'file://localhost/Volumes/HDD/My%20Music'.

This could be clearer if there were a summary of paths at the end, to highlight the most frequent prefix.

josephw commented 9 years ago

Comment #2 originally posted by josephw on 2013-07-21T10:45:36.000Z:

Yes, spaces in the XML file are encoded as you described, e.g.

Locationfile://localhost/Volumes/MEDIA/My%20Music/...
josephw commented 9 years ago

Comment #3 originally posted by josephw on 2013-07-21T10:59:25.000Z:

OK, I found the problem. I changed the command as follows and now it works:

java -Xmx512m -XX:MaxPermSize=256m -jar titl-core-0.3-SNAPSHOT.jar MoveMusic --use-urls ~/Music/iTunes/iTunes\ Library.itl "file://localhost/Volumes/HDD/My%20Music" "file://localhost/Volumes/HDD/Music"

Thank you a lot!

josephw commented 9 years ago

Comment #4 originally posted by josephw on 2014-03-09T10:26:17.000Z:

<empty>