Answered

Cannot use iTunes playlists on my NAS

  • 11 October 2018
  • 15 replies
  • 1035 views

Hi,
I've copied all of my music as an iTunes folder onto a NAS drive, which I've connected to my router via an ethernet cable. I can use Sonos to play the songs individually as I select them from the albums or artists folders. Unfortunately, the playlists don't work. When I play the same song as it appears on a playlist, it tells me it's "Unable to play xxxx cannot be found". Apparently, Sonos doesn't like the path of the playlists, but I don't know how to go about changing it. Thanks!
icon

Best answer by Edward R 18 October 2018, 15:55

Hi, Tony_P. Copy-pasting your library can cause issues with playlists; it compromises the integrity of your ".xml" file. This is an Apple proprietary file that maintains and governs your playlists. I would recommend deleting the copy on the NAS, removing the filepath, then following Apple's instructions on how to consolidate your iTunes library before trying it again. Let us know how you get on.
View original

15 replies

Userlevel 7
Badge +19
Hi, Tony_P. Copy-pasting your library can cause issues with playlists; it compromises the integrity of your ".xml" file. This is an Apple proprietary file that maintains and governs your playlists. I would recommend deleting the copy on the NAS, removing the filepath, then following Apple's instructions on how to consolidate your iTunes library before trying it again. Let us know how you get on.
I have the same issue. I tried a bunch of things and got closest by deleting the copy of the iTunes Library.itl file on my NAS to ensure Sonos wasn't ingesting that, and edited the iTunes Music Library.xml file on my NAS to replace references to the master copy of my music on my PC (eg local\c:\users\[username]) with the location of my music on my NAS (eg 192.x.x.x\Music\iTunes). It almost worked, but while ingesting the xml file, Sonos duplicated the location of my NAS in the song location in the playlist (ie it described the location of the song as 192.x.x.x\Music\iTunes192.x.x.x\Music\iTunes[song name]). Note: Everything else works - can use Sonos to play songs stored on the NAS by album, artist etc; it's just the imported playlists that don't correctly identify the location of the songs. Has anybody found a way around this? Is there maybe a way of editing the Sonos imported playlist in xml to delete the duplicate text? Sonos Case #: 00509542.
I'm getting closer! It seems Sonos is appending the NAS path to the music folder in the location of the song within the imported playlist. So I deleted the string identifying the NAS iTunes folder location from the iTunes Music Library.xml file on my NAS. Then Sonos showed me the following location for each song in the playlist:192.x.x.x/Music/iTunesfile:/iTunes Media[remainder of song path and filename]. So I was right that Sonos appends the NAS library location and managed to eliminate the duplicate string. But now Sonos is adding the text "file:" between the iTunes folder location and the sub-folders / files within that location in the path for the song in the playlist. This, of course, means it still can't be found.
It would be much easier to just migrate your iTunes to the NAS, then there is no need to mess with updating the files, and iTunes will take care of maintaining the library. Google "migrate iTunes library to another drive" for instructions.
jgatie: Thanks for the suggestion. I spend quite a bit of time offline and don't want to do that.
jgatie: Thanks for the suggestion. I spend quite a bit of time offline and don't want to do that.

So duplicate your library offline and switch between them. Or just leave it offline and use the NAS strictly for Sonos. At least you will get the library files correct, instead of the mess you have created now.
I have duplicate libraries. The issue is with succesfully using the same playlists on both. I do not have the skill to amend the iTunes.itl file (the version of iTunes I use offline). And Sonos appears to add superfluous text when ingesting the iTunes .xml file on my NAS so that the location of the songs in the playlist is incorrect.
If you migrate your library to the NAS, the library files will configure themselves. Then you just copy them over. No editing needed. Then just migrate back if you wish. As stated above, simply copying and pasting the tracks without using iTunes screws things up.

The Sonos rep gave you simple instructions on how to do this above. Why you would ignore the advice and keep doing what obviously is not working is an honest question.
The Sonos rep above answered a different question to the one I posted as a reply. I should not have posted a reply to this question and I have in fact now asked a separate question. It's the first time I posted and it was a mistake to do this. To your point, I do not wish to migrate my library. I want 2 copies of it that I can use independently - completely offline (the master library stored locally on my laptop, which I do not use as a server and is not always on) and completely online (a copy stored on my NAS, to which I want to point Sonos as it is always on). To be able to use the same playlists in both locations requires having different playlist song paths to the 2 different locations. The only way I can see of doing this is to edit the iTunes Library xml file on the NAS (I cannot have the master library on the NAS and duplicate it to my offline laptop because iTunes does not itself use the xml file, only the itl file). When Sonos ingests the xml file, it adds unnecessary text to the actual xml that then messes up the location address. My situation is an edge case that I do not expect Sonos to resolve in code (though I think it is theoretically possible). I was hoping someone might be able to help with a workaround - either telling me how to prevent Sonos adding the text "file:" to the song location in the Sonos playlist, or, identifying if there is an xml file in Sonos that points to playlist song locations so that I might be able to edit it to delete the superfluous text manually.
I've tried to help you, you refuse to take the advice. Migrating your library does not preclude you from having two libraries or using one of them offline. No need to edit XML files, just migrate, copy the XML file, then migrate back. Easiest thing in the world, but you won't do it. I give up. Good luck straightening out your completely avoidable mess.

And by the way, Sonos is read only. It makes no changes to local files, such as adding text to the XML file. Any changes you are seeing are from your stubborn refusal to actually go through the recommended Apple procedures and instead you are winging it on your own.
I appreciate your help but we seem to be talking at cross-purposes. I did not suggest that Sonos changed the native iTunes xml file; it imports the relevant string from the xml AND (unfortunately) appends additional text within the Sonos system presumably in order to correctly identify pathnames to songs in playlists, but the appended text breaks the pathname - the error is a simple one and appears in the Sonos error message very clearly. Regarding migrating my iTunes library to the NAS, based on my experience of previous iTunes migrations of a library that goes back to about 2003, the amount of potential cleanup work required after the migration would greatly exceed in time and complexity a simple find and replace instruction in the iTunes xml file (a 2 minute job) IF Sonos ingested it without appending the unnecessary text.
I've migrated iTunes libraries a half dozen times. Never had one issue of cleanup.

Cutting and pasting iTunes libraries, on the other hand? Well, you seem to be having absolutely no problems with that, so I will bow out now. You obviously have things in capable hands. :8
I appreciate your help but we seem to be talking at cross-purposes. I did not suggest that Sonos changed the native iTunes xml file; it imports the relevant string from the xml AND (unfortunately) appends additional text within the Sonos system presumably in order to correctly identify pathnames to songs in playlists, but the appended text breaks the pathname - the error is a simple one and appears in the Sonos error message very clearly. Regarding migrating my iTunes library to the NAS, based on my experience of previous iTunes migrations of a library that goes back to about 2003, the amount of potential cleanup work required after the migration would greatly exceed in time and complexity a simple find and replace instruction in the iTunes xml file (a 2 minute job) IF Sonos ingested it without appending the unnecessary text.

Dear stuk,
I have the same problem and context:
- I had to buy a NAS to play iTunes songs on SONOS to solve this nasty streaming problem between iPhone and Sonos (see my other post).
- I didn't move the iTunes library but C&P all the songs to the NAS because I want to keep it on my local laptop (travelling every week and working a lot from client offices)
- And now everything works fine except the iTunes playlists which look for the songs at a wrong location

Have you found a solution in the meanwhile? Any response would be much appreciated!

Thanks,
Peter
Hello stuk and Peter. I had the same issue (I think). Just recently bought Sonos. I have a (Windows 10) laptop which is my 'main' machine but is not permanently on and a NAS. I store my music in dropbox, on my laptop this is on a 2nd drive so D:\Dropbox\Music. I pointed itunes to that on my laptop, all happy for many years. I then bought and set up the NAS - it has an itunes server which uses a folder called Multimedia so that was fine, I copied my music from the laptop to a NAS subfolder called Music (the folder names are not relevant ofc). I pointed Sonos to the \\NAS\Multimedia\Music folder, all good for artists, albums etc except the playlists import but fail as they are looking for files in D:\Dropbox. The itunes .itl and .xml files also transferred over in my mass copy to the NAS.

I want (maybe wrongly) to leave my laptop as is and have a duplicate on my NAS in which playlists work in Sonos. My library is fairly static but I don't want to have to have my laptop on for Sonos to work. So here's what I did - it worked for me but I expect it's risky and not recommended so that's a warning. The itunes library .itl and .xml files got copied over to the NAS and were incorrect, the .itl is not readable (by me) but the .xml is plain text and although not used by itunes is kept up to date apparently for legacy apps. I made a copy from from laptop and examined it. There are filename references //localhost/D:/Dropxox/Music/the song name. When the NAS tried to play the playlist the error message was Cannot find //NAS/Multimedia/D:/Dropbox etc. So.... On my copy of the .xml I opened in a file editor (I used Notepad++) and did a search and replace replacing /D:Dropbox/Music/ with /Music/. I then deleted the .itl on my NAS and replaced the .xml on the NAS with this new .xml. I then had Sonos update the music library. It seems Sonos is happy to take the /localhost/ part of the filename and use it - in my case the NAS's name - //NAS/Multimedia. It took me a few goes to get the right search and replace.

I am now thinking though maybe creating a symlink on the NAS would have been easier, I had to do that on another 'duplicate' itunes install which only had a C drive using mklinks. But it needs some linux knowledge, how hard can that be to acquire? I will find out.

Obviously this is a huge kludge, not dynamic as when the main (laptop) itunes library changes I have to repeat the cycle of copy music, update .xml etc. Plus it's not future proof and I am sure is not recommended by anyone sensible - but for me it worked so here it is. No flaming please if it fails and your itunes goes up in smoke.... make plenty of copies and be careful which ones you replace.
I also don't like moving mu iTunes source to NAS; my laptop is my source and Das is my backup and the place from which to play music in my house. I have used the iTunes server on the Synology in the past and it has worked very well with my Logic devices etc. Sones does not support that at all. I wish Sonos support the iTunes DAAP protocol since most NAS servers have Daap iTunes server. It also lets to listen to playlists from any mac or pc that is running and has the iTunes app running.

For iTunes play list I needed to create symbolic links for C: or 😨 and it worked very well without changing the pathnames in the iTunes Music Library.xml file.

So getting back to the Sonos music lib via network shares. I tries the symlink trick creating the "D:" symlink *inside* network share i.e. in my case //NasServer/music folder. This would avoid the duplication of the prefix in the path name that is mentioned in the thread above. However symlinks are not supported through the network shared. However, you can use the "mount --bind ". I created the --bind mount in my //NasServer/music folder but "D:" does not work as ":" is special char for network shares. I then created a "Dlink" mount --bind and that works but you have to edit the iTunes xml file and do a change of "D:" to "Dlink" easy and it works.


Here is link that explains why symlinks don't work and how to use mount --bind.

https://www.albertogonzalez.net/how-to-create-a-symbolic-link-to-a-folder-on-a-synology-nas/

Reply