phauer / migrate-itunes-to-rhythmbox

Script to migrate iTunes playlists, play counts and ratings to Rhythmbox.
GNU General Public License v3.0
38 stars 10 forks source link

Source/Target Not Recognized in Script? #7

Closed BarRunBoatHonestyOperation closed 7 years ago

BarRunBoatHonestyOperation commented 7 years ago

Hi, I've used your script in the past and it works great. Thanks.

However, I'm running into an issue where I get the error:

No songs have been changed. Probably because the iTunes and Rhythmbox song paths could not be matched together. Please check your source_library_root and target_library_root.

I've opened both .xml files and checked that the paths are correct, and they seem to be correct. Any idea why it isn't working? Here's what I've directly copied and pasted out of the .xmls, stopping immediately before the artist folder:

iTunes prefix:    file://localhost/E:/Music/iTunes%20Media/
Rhythmbox prefix: file:///home/(username)/Music/iTunes%20Media/

Per your readme, this should convert to

    --source_library_root="E:/Music/iTunes%20Media/" \
    --target_library_root="/home/(username)/Music/iTunes%20Media/"

I've tried removing the %20, using the file:// strings instead, and adding or removing slashes, but the script doesn't seem to like this input. I have no issues with opening either .xml via the other two parameters, so it has something to do with these two parameters. Any idea on how I can fix this?

phauer commented 7 years ago

Hi benkisley, you are right, your parameters and the paths look good. Could you please provide your (minimal) Rhythmbox and iTunes XML files leading to this issue? This way, I can try to reproduce your problem on my machine and debug the script. What versions of migrate-itunes-to-rhythmbox, iTunes and Rhythmbox do you use? Are you using Windows? Cheers, Philipp

BarRunBoatHonestyOperation commented 7 years ago

I have two machines. On the Windows 7, I have iTunes 12.5.5.5 installed and the media folder is located in a shared network location at E:/Music/iTunes%20Media/ On the machine with Rhythmbox 3.3, I am running Linux Mint 18.1.

I am using the most recent version of the script I believe. I pulled it the other day using the current readme.

I have attached my two .xmls with only one song in each. I made sure I don't cut out anything important. If you need more info, let me know. Thanks!

iTunesRhythmboxXMLs.zip

phauer commented 7 years ago

I took a deeper look at your paths.

iTunes: file://localhost/E:/Music/iTunes%20Media/Toro%20Y%20Moi/Anything%20In%20Return/02%20Say%20That.mp3
Rhythmbox: file:///home/bk6/Music/iTunes%20Media/Toro%20y%20Moi/Anything%20In%20Return/02%20Say%20That.mp3

Especially compare Toro%20Y%20Moi with Toro%20y%20Moi: In the iTunes path it's a lower-case y and in the Rhythmbox path it's an upper-case Y. So the names of the folders have changed. That's why they can't be matched together anymore by the script. Changing the folder name should fix your problem. Can you confirm this?

BarRunBoatHonestyOperation commented 7 years ago

Interesting. The network drive iTunes is pointing to is actually the Rhythmbox machine's hard drive, so they're pointing to the exact same folder. I guess iTunes/Windows doesn't care about correct capitalization.

Anyways, how about I take another entry from each that doesn't have a capitalization issue? I just chose a random song below that you can test with:

Rhythmbox XML:

  <entry type="song">
    <title>Penny Lane</title>
    <genre>Classic Rock - Rock</genre>
    <artist>The Beatles</artist>
    <album>Magical Mystery Tour</album>
    <track-number>9</track-number>
    <track-total>11</track-total>
    <disc-number>1</disc-number>
    <disc-total>1</disc-total>
    <duration>180</duration>
    <file-size>4001617</file-size>
    <location>file:///home/bk6/Music/iTunes%20Media/The%20Beatles/Magical%20Mystery%20Tour/09%20Penny%20Lane.mp3</location>
    <mtime>1477399850</mtime>
    <first-seen>1489274429</first-seen>
    <last-seen>1489371082</last-seen>
    <bitrate>170</bitrate>
    <date>718318</date>
    <media-type>audio/mpeg</media-type>
    <album-artist>The Beatles</album-artist>
    <composer>John Lennon/Paul McCartney</composer>
  </entry>

iTunes XML:

        <key>12421</key>
        <dict>
            <key>Track ID</key><integer>12421</integer>
            <key>Size</key><integer>4001617</integer>
            <key>Total Time</key><integer>180950</integer>
            <key>Disc Number</key><integer>1</integer>
            <key>Disc Count</key><integer>1</integer>
            <key>Track Number</key><integer>9</integer>
            <key>Track Count</key><integer>11</integer>
            <key>Year</key><integer>1967</integer>
            <key>Date Modified</key><date>2016-10-25T12:50:50Z</date>
            <key>Date Added</key><date>2013-05-26T16:53:43Z</date>
            <key>Bit Rate</key><integer>169</integer>
            <key>Sample Rate</key><integer>44100</integer>
            <key>Play Count</key><integer>31</integer>
            <key>Play Date</key><integer>3548181790</integer>
            <key>Play Date UTC</key><date>2016-06-08T02:03:10Z</date>
            <key>Rating</key><integer>40</integer>
            <key>Album Rating</key><integer>40</integer>
            <key>Album Rating Computed</key><true/>
            <key>Artwork Count</key><integer>1</integer>
            <key>Persistent ID</key><string>C78A31257C20667C</string>
            <key>Track Type</key><string>File</string>
            <key>File Folder Count</key><integer>4</integer>
            <key>Library Folder Count</key><integer>1</integer>
            <key>Name</key><string>Penny Lane</string>
            <key>Artist</key><string>The Beatles</string>
            <key>Album</key><string>Magical Mystery Tour</string>
            <key>Genre</key><string>Classic Rock - Rock</string>
            <key>Kind</key><string>MPEG audio file</string>
            <key>Sort Artist</key><string>Beatles</string>
            <key>Location</key><string>file://localhost/E:/Music/iTunes%20Media/The%20Beatles/Magical%20Mystery%20Tour/09%20Penny%20Lane.mp3</string>
        </dict>
phauer commented 7 years ago

Can't reproduce your issue.

migrate-itunes-to-rhythmbox counts-ratings --itunes_library_xml="./src/unittest/resources/unknown/iTunes Library.xml" --rhythmdb="./src/unittest/resources/unknown/rhythmdb.xml" --source_library_root="E:/Music/iTunes%20Media/" --target_library_root="/home/bk6/Music/iTunes%20Media/"

Output:

Reading iTunes library in ./src/unittest/resources/unknown/iTunes Library.xml
Adding play counts and ratings to Rhythmbox DB in ./src/unittest/resources/unknown/rhythmdb.xml
Updated 1 song entries

Result:

<?xml version="1.0" standalone="yes"?>
<rhythmdb version="2.0">
  <entry type="song">
    <title>Penny Lane</title>
    <genre>Classic Rock - Rock</genre>
    <artist>The Beatles</artist>
    <album>Magical Mystery Tour</album>
    <track-number>9</track-number>
    <track-total>11</track-total>
    <disc-number>1</disc-number>
    <disc-total>1</disc-total>
    <duration>180</duration>
    <file-size>4001617</file-size>
    <location>file:///home/bk6/Music/iTunes%20Media/The%20Beatles/Magical%20Mystery%20Tour/09%20Penny%20Lane.mp3</location>
    <mtime>1477399850</mtime>
    <first-seen>1489274429</first-seen>
    <last-seen>1489371082</last-seen>
    <bitrate>170</bitrate>
    <date>718318</date>
    <media-type>audio/mpeg</media-type>
    <album-artist>The Beatles</album-artist>
    <composer>John Lennon/Paul McCartney</composer>
  <play-count>31</play-count><rating>2</rating><last-played>1465351390</last-played></entry>
</rhythmdb>
BarRunBoatHonestyOperation commented 7 years ago

Okay, interesting. Maybe a reinstall will fix it. Feel free to close this since it must be something with my machine.