How-to: Windows iTunes playlists the easy way

Questions/comments regarding the Audio Station can be placed here
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/support_form.php?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
watson180
I'm New!
I'm New!
Posts: 6
Joined: Sat Apr 02, 2011 11:54 am

Re: How-to: Windows iTunes playlists the easy way

Postby watson180 » Sat Apr 02, 2011 12:33 pm

Thanks to all it will help me too. I am using ITUNES.
I am 22. Like to pass time online to gather knowledge.
bgriffis
I'm New!
I'm New!
Posts: 3
Joined: Mon Apr 23, 2012 6:28 pm

Re: How-to: Windows iTunes playlists the easy way

Postby bgriffis » Mon Apr 23, 2012 6:30 pm

Thanks to all for the great help. I thought I'd give a recap of my issue/solution in case it helps anyone else. I used the command line version of the tool as I thought it would be easier to just run a batch file in the future.

I have been running Logitech Media Server for many years from Windows. Recently I moved all my music to a Synology NAS and was having trouble getting the Media Server to "see" my content on the box. So I installed Logitech Media Server on the Synology NAS itself (supported right out of the box with just a few clicks!). Everything was working great except for the fact that all my playlists were being held captive by iTunes in Windows.

My solution was to download iTunes Export from here:

http://www.ericdaugherty.com/dev/itunesexport/

I grabbed the command line version so I could write a batch file to invoke it easily. Here's the contents of my command file:

"C:\Program Files (x86)\Java\jre6\bin\java" -jar itunesexport.jar -outputDir=\\diskstation\Media\Music\iTunes\Playlis ts -musicPath=/volume1/Media/Music/iTunes/Music -musicPathOld=C:\Media\Music\iTunes\Music -fileTypes=ALL -separator=MAC -includePlaylist="Brad 4 Star Sorted,Brad 5 Star Sorted,Kids 4 Star"

In the above command line the musicPathOld is where iTunes "sees" all my files from Windows, i.e. I created a softlink at C:\Media that points to \\diskstation\Media. The musicPath is the path that gets inserted into the m3u files, which is where Logitech Media Server "sees" the music locally on the NAS. I only wanted to create a few playlists as indicated by the includePlaylist. If you get rid of that part it generates all the playlists. I also have my iTunes library xml in the default location so didn't need to specify anything there.

Anyway, I hope this helps someone else having a similar issue. Now if I want to re-create the m3u files I simply run the batch file and then rescan playlists.
Wobblyman
I'm New!
I'm New!
Posts: 7
Joined: Sat May 19, 2012 9:25 am

Re: How-to: Windows iTunes playlists the easy way

Postby Wobblyman » Thu Dec 13, 2012 10:25 am

Hello,

I was having all sorts of problems - but eventually cracked it. None of the suggestions worked, but I've probably got a slightly different setup. I don't have any music under the default \music folder. Instead, I've shared a folder called iTunes, and the music is under a folder called iTunes Music. So the path to the tunes is \\iTunes\iTunes Music. Still no luck.

Anyway, after a few hours of fiddling around, I've used the following options:
Music Folder Prefix: ../../iTunes/iTunes Music/
Playlist Separator /


All good!
shank2001
I'm New!
I'm New!
Posts: 6
Joined: Wed Aug 28, 2013 7:24 am

Re: How-to: Windows iTunes playlists the easy way

Postby shank2001 » Wed Aug 28, 2013 7:28 am

I got everything to work, but any file that has a "(" or ")" in the filename cannot be read by Audio Station. Anyone have any idea why, or know a way to fix it?

Thanks for any help!
Steve1
Trainee
Trainee
Posts: 11
Joined: Sun Jun 23, 2013 6:23 pm

Re: How-to: Windows iTunes playlists the easy way

Postby Steve1 » Sun Sep 22, 2013 4:51 pm

Thanks for the tips everyone. I had the following problem that I managed to resolve.

Playlist created without issue and appeared in DS Audio however the music could not be found showing a red cross next to each of the songs.

If you have a problem locating the files make sure that the location of the music folder is correct when scripting the iTunes export or using the GUI. The correct music prefix depends on the location of the playlist and appears to be a relative path. For example in my case the music is located on a share which is mounted at the following location on my mac:

/Volumes/New iTunes Lib/Music

HOWEVER the path your computer uses may not be the not the path that DS Audio will use. In my case the path is as follows:

../../../../../New iTunes Lib/Music/

Each of the "../" take DS Audio back up a folder level. To find out what the correct path is for your music library:

1. Create a temporary playlist in DS Audio (via the web interface) and call it "temp"
2. Add a song to the playlist
3. Locate the playlist in the filesystem called temp.m3u
4. Open the file with a text editor to find out what the path should be. You should use the path up to and including the / were all your music is kept. (If you do not have all your music organised into a single folder with the option "keep itunes folder organised" I'm guessing you will have issues!)

From what I can tell the path will be different depending on where you store the playlists and if you have personal music folders set-up on your DS.
AndyTwizzle
Trainee
Trainee
Posts: 14
Joined: Fri Jan 16, 2015 6:32 pm

Re: How-to: Windows iTunes playlists the easy way

Postby AndyTwizzle » Thu Feb 12, 2015 10:10 pm

I'm using a Windows 7 PC with iTunes installed, opening a library file and music saved on my Synology 213air. I use iTunesexport (http://www.ericdaugherty.com/dev/itunesexport/) to export my iTunes playlist to access and play on my Android mobile using DS Audio. Anyone know if Itunesexport will still work if I upgrade iTunes to 12.1 with 64bit? Don't want to upgrade it if I can no longer get my playlists into my phone. Does the 64bit upgrade change the nature of the library files, or just affect the way Windows runs the iTunes application.

I also sync my iTunes library with Logitech Media Server on the Synology, so I can access all my music on my 3 Squeezeboxes around the house - does anyone know yet if the 64bit iTunes upgrade will affect LMS's syncing with my iTune library too?

Thanks

Andy
abdam
I'm New!
I'm New!
Posts: 3
Joined: Sun Jan 08, 2017 8:54 pm

Re: How-to: Windows iTunes playlists the easy way

Postby abdam » Sat Jan 14, 2017 5:39 pm

Hi I just thought I would share extra information about this. I used this post as inspiration (i.e. using iTunesexport) and I've managed to come up with a Powershell Script that uses the "Console Application" version of (http://www.ericdaugherty.com/dev/itunesexport/) that dynamically exports a play list (including new ones, hence it's dynamic) and the automatically edits the .m3u to make it compatible with synology.

Things you will need to make sure is:
Know where "iTunes\iTunes Music Library.xml" is being generated (To generate it, Edit > Preferences > Advanced > "Share Itunes Library XML with other applications")
Know the path to your music folder (e.g. "\\nas\music")
Know where you want your playlists to be exported to (e.g. "\\nas\music\playlists")
Know what playlists you want to exclude (e.g. Recently Added, Recently Played ect...)
You may need to enable powershell scripts to run, Run "Windows PowerShell" 'As Admin' and execute the code

Code: Select all

set-executionpolicy unrestricted
. You can check it with

Code: Select all

get-executionpolicy


This example should just work if your Itunes music is saved on your Synology box to "\\nas\music\iTunes\iTunes Music Library.xml" with your music in "\\nas\music\" and your out put playlists in "\\nas\music\playlists"

1. Download and exact the "Console Application" version of (http://www.ericdaugherty.com/) - I used "https://sourceforge.net/projects/itunesexport/files/iTunesExport/2.2.2/iTunesExportScala-2.2.2.zip/download"
2. Next to the "itunesexport.jar" you extract, make a .ps1 file with this in it:

Code: Select all

#Set Music Path
$MusicPath = "\\nas\music"
#Set Playlist Path
$PlaylistOutputPath = "$MusicPath\playlists"
#Playlists to exclude
$ExcludePlaylist = "Classical Music, 90s Music, Music Videos, My Top Rated, Recently Added, Recently Played, Top 25 Most Played"

java -jar itunesexport.jar -library="$MusicPath\iTunes\iTunes Music Library.xml" -fileTypes=ALL -musicPath="$MusicPath\" -excludePlaylist="$ExcludePlaylist" -outputDir="$PlaylistOutputPath\"

Get-ChildItem "$PlaylistOutputPath" -Filter *.m3u |
Foreach-Object {
    Write-Host "$PlaylistOutputPath\$_"

    #filter and save content to the original file
    (Get-Content $PlaylistOutputPath\$_).replace('\\nas\music', '..') | Set-Content $PlaylistOutputPath\$_
    (Get-Content $PlaylistOutputPath\$_).replace('\', '/') | Set-Content $PlaylistOutputPath\$_
}
Read-Host "Press ENTER to Continue"


and edit the:

Code: Select all

#Set Music Path
$MusicPath = "\\nas\music"
#Set Playlist Path
$PlaylistOutputPath = "$MusicPath\playlists"
#Playlists to exclude
$ExcludePlaylist = "Classical Music, 90s Music, Music Videos, My Top Rated, Recently Added, Recently Played, Top 25 Most Played"
and you may need to edit the text string you want to edit that leads up to the "root" of your music in

Code: Select all

Get-Content $PlaylistOutputPath\$_).replace('\\nas\music', '..')"

3. Run the ".ps1" file you made (Right click it, "Run With PowerShell")

Thats it.

You should see a list of the playlists it exports at the end. Feel free to edit the script to match what you would like it to do, I hope this helps.
OldSchool1948
I'm New!
I'm New!
Posts: 8
Joined: Fri Jul 14, 2017 10:07 pm

Re: How-to: Windows iTunes playlists the easy way

Postby OldSchool1948 » Tue Dec 12, 2017 12:53 am

MrBlue wrote:Hello everybody,
I think I figured it out - at least for me this works: I created a M3U playlists with audiostation and compared it to the list created by itunesexport (I'm working on a leopard mac and the latest 209-diskstation firmware).

In iTunesexport I set the "output directory" to: "/Volumes/music/playlists" (I had to take "Volumes" instead of the name of my diskstation)
and the "music folder Prefix" to: "../iTunes/" (watch closely if in your path to iTunes if it is written with a capital letter "T" in the middle, in my case this was the whole deal!!!) :shock: :!:

The result was in the M3U-playlist that the path was (you can open the M3U-list with the regulare apple texteditor to check yourself): "../iTunes/Music/Air/Moon Safari/05 Talisman.mp3" which worked then for me - it's then the same path logic as audiostation uses natively.

Btw, the regular path to my iTunes music directory on my diskstation is: "/name_of_my_diskstation/music/iTunes/music/" after I changed in iTunes the path under settings of the music location to my diskstation and consolidated it afterwards.

It even worked as a "M3UExt" Playlist format and "All Types" as File Types in the iTunesExport tool!

Good luck everybody!!! :idea:
Cheers! :D

PS: Now the diskstation is really awesome and the next thing I want to get is the PlugPlayer for iPhone so that I can control remotely the music of one iphone/iPod Touch (of my wife :) which is connected to my hifi system with my other iPhone! Anyone any experience? Worth the money for the PlugPlayer software?

Hello Everyone,

I have LMS working on my 216+II NAS with no issues. I've been trying to migrate LMS iTunes to Audio Station / DS Audio but cannot get the playlists to show in DS Audio. Synology tech support has been no help. Below is my setup, any help or advice would be greatly appreciated:

iTunes Library XML File
<key>Music Folder</key><string>file://localhost//volume1/music/itunes/</string>

My playlists are in folder:
/volume1/music/playlists/

Sample Playlist M3U File
//volume1/music/itunes/Wes Montgomery/A Day In The Life/01 A Day In The Life.m4a
//volume1/music/itunes/Wes Montgomery/A Day In The Life/03 When A Man Loves A Woman.m4a
//volume1/music/itunes/Wes Montgomery/A Day In The Life/05 Angel.m4a
//volume1/music/itunes/Wes Montgomery/A Day In The Life/07 Willow Weep For Me.m4a
//volume1/music/itunes/Wes Montgomery/Wes Montgomery_ Finest Hour/01 Bumpin' On Sunset.m4a
//volume1/music/itunes/Stanley Clarke/East River Drive/04 East River Drive.m4a
--------------------------------------------------
Squeezebox Duet x2, Synology 216+II
Amps: McIntosh MC2600, Pioneer SPEC4, NAD 7140 (x2)
Pre-Amps: McIntosh AVR Control Center, Soundcraftsman SP 4001
Speakers: DCM TimeWindow 3, JBL Century L100, Boston L1000, Polk LC 80i, Riva Festival, Riva Arena x3
Other stuff: Rodec Mixer, McIntosh Tuner, McIntosh CD, Teac X10R Reel-to-Real, Techniques SL-1600MK2 Turntable, dbx 3BX, dbx 224, multiple AudioEngine AW1, and too many other assorted things
OldSchool1948
I'm New!
I'm New!
Posts: 8
Joined: Fri Jul 14, 2017 10:07 pm

Re: How-to: Windows iTunes playlists the easy way

Postby OldSchool1948 » Fri Dec 22, 2017 2:52 pm

After reading this thread for the third time, I finally got it right. This is what worked for me:

Note: My NAS is called SynologyNAS. Substitute your NAS' name as appropriate :D

A. iTunes Music Library File

Using Notepad ++
1) Change all backslash characters to forward slash characters
2) Searched & replaced path name '//localhost//SynologyNAS/' with '//localhost//volume1/' throughout

B: iTunes Playlist Files
1) Used the iTunes Export freeware (GUI version) at: 'http://www.ericdaugherty.com/dev/itunesexport/' to create my M3U playlist files
2) Using Audio Station, I created a playlist call 'temp'
3) Used File Station to locate the file; on my NAS it was folder: SynologyNAS/home/music/playlists
5) Placed all of my M3U playlist files in folder: SynologyNAS/home/music/playlists
6) Noticed the path used in the 'temp' playlist, which is: '../../../../music/itunes/'
7) Using Notepad ++ search and replace across all documents, in each playlist:
a) Changed all '\' (backslash) characters to '/' (forward slash characters)
b) Change my iTunes playlist paths to look like the samples below:

../../../../music/itunes/Wes Montgomery/A Day In The Life/01 A Day In The Life.m4a
../../../../music/itunes/Wes Montgomery/A Day In The Life/03 When A Man Loves A Woman.m4a
../../../../music/itunes/Wes Montgomery/A Day In The Life/05 Angel.m4a
../../../../music/itunes/Wes Montgomery/A Day In The Life/07 Willow Weep For Me.m4a
../../../../music/itunes/Wes Montgomery/Wes Montgomery_ Finest Hour/01 Bumpin' On Sunset.m4a
../../../../music/itunes/Stanley Clarke/East River Drive/04 East River Drive.m4a
../../../../music/itunes/Stanley Clarke/East River Drive/06 Theme from Boyz N the Hood.m4a
../../../../music/itunes/Stanley Clarke/East River Drive/01 Justice's Groove.m4a

And viola, they all show up in Audio Station and DS Audio. Last night they worked in both, this morning only DS Audio works. In fact, Audio Station won't play ANYTHING. Oh well, back to the drawing board.
--------------------------------------------------
Squeezebox Duet x2, Synology 216+II
Amps: McIntosh MC2600, Pioneer SPEC4, NAD 7140 (x2)
Pre-Amps: McIntosh AVR Control Center, Soundcraftsman SP 4001
Speakers: DCM TimeWindow 3, JBL Century L100, Boston L1000, Polk LC 80i, Riva Festival, Riva Arena x3
Other stuff: Rodec Mixer, McIntosh Tuner, McIntosh CD, Teac X10R Reel-to-Real, Techniques SL-1600MK2 Turntable, dbx 3BX, dbx 224, multiple AudioEngine AW1, and too many other assorted things

Return to “Audio Station”

Who is online

Users browsing this forum: No registered users and 3 guests