Browse Source

fixed for Catalina

master
James Stout 4 years ago
parent
commit
dab3ddcf7d
Signed by: stouty
GPG Key ID: 248009A5472B2815
  1. 52
      .gitignore
  2. 23
      playlistRecover.php

52
.gitignore vendored

@ -2,3 +2,55 @@
!*.gz
iTunes-new.xml
iTunes-old.xml
newPlaylists copy/5 stars 1_NEW2.xml
newPlaylists copy/5 Stars_NEW2.xml
newPlaylists copy/90’s Music_NEW2.xml
newPlaylists copy/Angels or Devils_NEW2.xml
newPlaylists copy/Cannonball_NEW2.xml
newPlaylists copy/Chasing Rainbows_NEW2.xml
newPlaylists copy/Classical Music_NEW2.xml
newPlaylists copy/Come Back To What You Know 1_NEW2.xml
newPlaylists copy/DJ Riko - Merry Mixmas_NEW2.xml
newPlaylists copy/Either Way_NEW2.xml
newPlaylists copy/Everything's Magic_NEW2.xml
newPlaylists copy/Girl Talk - All Day_NEW2.xml
newPlaylists copy/In The Morning_NEW2.xml
newPlaylists copy/iPhone16GB_NEW2.xml
newPlaylists copy/It's Not About You_NEW2.xml
newPlaylists copy/Kryptonite_NEW2.xml
newPlaylists copy/Large Files_NEW2.xml
newPlaylists copy/Last Christmas_NEW2.xml
newPlaylists copy/Last Night_NEW2.xml
newPlaylists copy/Leaving_NEW2.xml
newPlaylists copy/Little Lion Man_NEW2.xml
newPlaylists copy/Louis CK_NEW2.xml
newPlaylists copy/Misery Business_NEW2.xml
newPlaylists copy/My Top Rated_NEW2.xml
newPlaylists copy/New Day_NEW2.xml
newPlaylists copy/NEW_NEW2.xml
newPlaylists copy/Nickel Creek - A Dotted Line_NEW2.xml
newPlaylists copy/No Artwork_NEW2.xml
newPlaylists copy/No It Isn't_NEW2.xml
newPlaylists copy/One-Hit Wonders_NEW2.xml
newPlaylists copy/Patience_NEW2.xml
newPlaylists copy/Pink Floyd - Meddle [2011 Remastered]_NEW2.xml
newPlaylists copy/Pink Floyd - The Wall (Remastered)_NEW2.xml
newPlaylists copy/Playlist_NEW2.xml
newPlaylists copy/Q-Rock 100_NEW2.xml
newPlaylists copy/Red Hot Chili Peppers_NEW2.xml
newPlaylists copy/Rian - Looper_NEW2.xml
newPlaylists copy/Robert Jordan - Book 1 - The Eye of the World_NEW2.xml
newPlaylists copy/Scala & Kolacny Brothers_NEW2.xml
newPlaylists copy/Singing_NEW2.xml
newPlaylists copy/Superman (It's Not Easy)_NEW2.xml
newPlaylists copy/The Bones Of You_NEW2.xml
newPlaylists copy/The Kleptones - A Night At The Hip-Hopera_NEW2.xml
newPlaylists copy/The Masterplan_NEW2.xml
newPlaylists copy/The Planets Bend Between Us_NEW2.xml
newPlaylists copy/This = Love_NEW2.xml
newPlaylists copy/This Sweet Love_NEW2.xml
newPlaylists copy/Top 25 Most Played_NEW2.xml
newPlaylists copy/Voice Memos_NEW2.xml
old/iTunes-new.xml.gz
old/iTunes-old.xml.gz
newPlaylists copy/Pink Floyd - Meddle [2011 Remastered]_NEW2.xml

23
playlistRecover.php

@ -43,7 +43,7 @@ if ($writeNewPlaylistFile == true) {
$time_start = microtime(true);
// load up old library, and playlists
$oldLibrary = new iTunesLibrary($oldiTunesFileGZ, true, $trackLimit);
$oldLibrary = new iTunesLibrary($oldiTunesFile, true, $trackLimit);
$time = (microtime(true) - $time_start);
printf("Time to load old lib and playlists: %01.3f\n", $time);
@ -51,7 +51,7 @@ printf("Time to load old lib and playlists: %01.3f\n", $time);
$time_start = microtime(true);
// load up new library, just the tracks
$newLibrary = new iTunesLibrary($newiTunesFileGZ, false);
$newLibrary = new iTunesLibrary($newiTunesFile, false);
$time = (microtime(true) - $time_start);
printf("Time to load new lib: %01.3f\n", $time);
@ -117,12 +117,16 @@ function outputPlaylistFile($playlistName, $trackIDs){
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Playlists</key>
<key>Tracks</key>
<dict>
HEAD;
$mid1 = <<< MID1
</dict><key>Playlists</key>
<array>
<dict>
<key>Name</key><string>
HEAD;
MID1;
$footer = <<< FOOT
</array>
@ -142,7 +146,14 @@ FOOT;
MID;
$str = $header . $playlistName . $mid;
$str = $header;
foreach ($trackIDs as $trackID) {
$str = $str ."<key>" . $trackID ."</key>";
}
$str = $str . $mid1 . $playlistName . $mid;
// loop through tracks
foreach ($trackIDs as $trackID) {

Loading…
Cancel
Save