SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-09-2010, 11:17 PM
ptzink ptzink is offline
Sage Aficionado
 
Join Date: Mar 2008
Posts: 300
How To Get Updating Playlists from iTunes in SageTV

Like many SageTV users, I use iTunes to manage my music collection. One of the most essential components of my iTunes database are the countless playlists and smart playlists that I have created to fine tune my listening experience. The problem is that iTunes does not utilize the m3u playlist format that SageTV (and other media players) support. I have seen other posts in the forum address solutions to this problem, but have never seen a cohesive guide put together on how to achieve this. This guide will show you the method I use to get updating iTunes playlists in SageTV on Windows (7). I am sure there are other methods one could use and I invite any discussion about tips and tricks people have in this thread. However, please refrain from the “why don’t you just use (insert non-iTunes media player here)?” or “iTunes sucks” posts.

General Steps:
  1. Download the iTunes playlist exporting script and download and install necessary software
  2. Schedule and configure a Windows task to export/update playlists from iTunes to m3u files at your preferred interval
  3. Check the playlist in notepad and another media player to verify it works
  4. Configure SageTV (must be version 7.0.13 or newer) to update playlists at every media scan

Detailed Steps:

1. Download the iTunes playlist exporting script and download and install necessary software
(a) Go here and download Mike's itunes2m3u.py python script
(b) Create a “playlists” folder in your music library location (optional) and copy the itunes2m3u.py file to that directory
(c) Next, go here and download the latest version of Python for your operating system (Windows 7 x64 in my case). Install the software in the location of your choosing.
(d) If you haven't already, download the latest version of SageTV (7.0.13 or greater) server and install
2. Schedule and configure a Windows task to export/update playlists from iTunes to m3u files at your preferred interval (Note: This is what I do because I am on Windows and I find this to be the easiest “set it and forget it” method. Other options include creating a batch file or script depending upon your OS.)
(a) Click on “Start” and type “schedule tasks” in the search box (Windows XP users will have to browse to the task scheduler manually through the Control Panel)
(b) Once in the Task Scheduler, click on the “Action” menu and select “Create Task...”
(c) In the “General tab”, give your task a name and description. I call mine “iTunes Playlist Export”
(d) Click on the “Triggers” tab and click on the “New” button
(e) Select how frequently you want your playlists to be updated in Sage and at what time of day/day of the week you want the task to run. (Since I have smart playlists in iTunes that update frequently based upon my listening and other conditions, I run the task everyday at 2AM)
(f) Make sure the “enabled” box is checked and click “OK”
(g) Next, select the “Actions” tab and click on the “New” button
(h) In the New Action window, select “Start a program” from the drop down menu
(i) Under “Program/Script” click on the “Browse...” button and find your “itunes2m3u.py” script. Select the script and click “OK”
(j) IMPORTANT STEP! Under arguments type: --directory=”//servername/musicdir/” where “servername” is the name of the of your server or share where the music is located and “musicdir” is the path to the music directory. Be sure to use network paths and not local paths (eg. Use //server/users/me/iTunes/iTunes music/ and NOT C:/users/me/iTunes/iTunes Music/). Also, be sure to use a slash at the end. The path to your music directory should be the same one specified in iTunes under Preferences->Advanced->”iTunes media folder location”
(k) After the --directory argument put a space and type (in quotes) the path to your iTunes library.xml file. It should look something like: “C:/users/me/music/iTunes/iTunes Library.xml” This path can be local
(l) Steps j. and k. above should combine to make an Arguments line that looks something like: --directory=”//server/users/me/iTunes/iTunes music/” “C:/users/me/music/iTunes/iTunes Library.xml”
(m) Double check that you have typed all paths correctly and click OK
(n) Adjust any other settings as you wish and click on “OK” to make your new task
(o) Now under “Task Scheduler Library” you should see a your task you just created at the bottom. To test the task, highlight it and go to “Action”->”Run” You should see a DOS window pop up which says: "Parsing C:/users/me/music/iTunes/iTunes Library.xml..." or whatever your library location is. Then it will starting “spitting out” m3u playlists in the newly created “playlists” folder (or the location where your itunes2m3u.py file is located)
3. Check the m3u playlist in notepad and another media player to verify it works. (Note: One of the easiest ways to verify the playlist works, is to open it in Windows Media Player. I use WMP instead of iTunes as not to mess up my existing iTunes library. Secondly, you should verify the m3u files generated have the correct file paths by opening them in Notepad or another text editor)
(a) Browse to your “playlists” folder. You should see several .m3u files there.
(b) Right-click on one of the playlists and select “Open with...” then choose Windows Media Player. If the playlist begins to play the songs normally, then that is a good indication that the playlist file is good.
(c) Verify this by opening Notepad. Then drag and drop the same m3u file into the Notepad window.
(d) Each song in the playlist should contain 2 lines that look something like this:
#EXTINF:180,The Distance
//server/users/me/iTunes/iTunes music/Cake/Fashion Nugget/02_Cake-The Distance.mp3
(e) If the path does not look similar to this you may have typed incorrectly in step 2j.
4. Configure SageTV (must be version 7.0.13 or newer) to update playlists at every media scan
(a) Stop the SageTV service and make a backup of your Sage.properties and Wiz.bin files. These are located either in the SageTV program directory or in the “Virtual Store” is Windows Vista/7 @ C:\Users\<user>\AppData\Local\VirtualStore\Program Files\SageTV\SageTV
(b) Now open the Sage.properties file in Notepad
(c) Go to “Edit”->”Find...” and type “fully_reimport_playlists_every_scan”
(d) Change the value from “false” (default) to “true”. When set to true, every time a library import scan is done, any playlists that originated from external playlist files (the m3u files) will be fully reimported (i.e. the playlists in SageTV's database will be synchronized with the external playlist files, using the external playlist file as the master) WARNING: This will discard any changes you make to the playlist in Sage.
(e) Restart the SageTV service
(f) Open up Sage on the client or server, go to “Setup” and kick off an imported media scan
(g) Go to Setup->Detailed Setup->General and make sure that your “Automatic Library Rescan Frequency" is set to your liking
(h) After the media scan is complete, go to Music->Playlists to verify your playlists have imported successfully
(i) Enjoy your iTunes playlists in Sage!
Optional:
This script just exports all of your iTunes playlists and doesn’t allow you to pick and choose which ones you actually want in Sage. To fine tune this, you can optionally download and install the automated file manager Belvedere. Once installed, you can configure Belvedere to automatically:

  • “Prune” playlists that you don’t want in SageTV using a “name is” rule (eg. “TV Shows.m3u”, “Library.m3u”, etc)
  • Delete playlists that have not been modified within a certain amount of time (i.e. playlists that you have deleted in iTunes, but still exist in your “playlists” directory) using a “Date Last Modified” rule
  • Keep only playlists with a certain character string in them (eg. Sage-party-mix.m3u, Sage-mellow.m3u, etc.) using the “name does not contain” rule
  • Many more customizable options

It's not perfect iTunes integration, but for now it is part of the way there. Feel free to share any other tips you may have about iTunes playlists in Sage in this thread.
__________________
Server: SageTV Media Center 7.1.19, Windows 7 Home Premium x64, Pentium Core2Duo, 4GB RAM, (1) Hauppauge HVR-2250, (1) Hauppauge HVR-1600, 1.5 TB of recording space
Android MiniClient: Nvidia Shield TV (16GB) HDMI out to Samsung LN46C630 46" LCD
Extender: STP-HD300, beta firmware "20110506-0", HDMI out to LG 37LD450 37" LCD

Last edited by ptzink; 08-10-2010 at 08:33 AM.
Reply With Quote
  #2  
Old 08-09-2010, 11:30 PM
darcilicious's Avatar
darcilicious darcilicious is offline
Sage Icon
 
Join Date: Jul 2009
Location: Venus
Posts: 1,306
Oh my gosh, I'm so going to be trying this soon! Thank you SO much for taking the time to write up such a detailed how-to!
__________________
SageTV Server 7.1.x w/Gemstone and Plex Home Theater v1.0.10 w/PlexPass
HD-PVR w/v1.5.6 drivers / Hauppauge IR blaster / FiOS Extreme HD / Motorola QIP6200 / SPDIF+720p Fixed Output
on HP Media Center 8400F (Phenom 9500 QuadCore 2.2GHz, nVidia GeForce 8500 GT)
via Olevia 247TFHD/Onyko TX-SR606/Harmony 550/HP MediaSmart EX490 WHS w/12TB
Plex Media Server v0.9.9.5 on HP Touchsmart Envy 23 d16qd
Sonos Play:3, Connect / SimpleTV v2 / Roku 2 XS+Plex / iPhone 5 / iPad 2
Reply With Quote
  #3  
Old 08-10-2010, 07:32 AM
matt91's Avatar
matt91 matt91 is offline
Sage Icon
 
Join Date: Feb 2005
Location: Washington, DC
Posts: 1,185
THanks. I've been thinking about setting up itunes to manage my music, but I hadn't even realized that the playlists weren't directly compatible.

How long have you be using this procedure to produce and modify the playlists? It seems like there are a lot of things that potentially could go wrong.
__________________
Server: Ubuntu 16.04 running Sage for Linux v9
Reply With Quote
  #4  
Old 08-10-2010, 08:43 AM
ptzink ptzink is offline
Sage Aficionado
 
Join Date: Mar 2008
Posts: 300
Quote:
Originally Posted by darcilicious View Post
Oh my gosh, I'm so going to be trying this soon! Thank you SO much for taking the time to write up such a detailed how-to!
No problem. I just want to help those out who want to get updatingiTunes playlists in Sage like me. Also, you may want to check out the optional step I just added at the end of my post for "pruning" playlists that you don't necessarily want in Sage. Good luck and let me know how this works for you.
__________________
Server: SageTV Media Center 7.1.19, Windows 7 Home Premium x64, Pentium Core2Duo, 4GB RAM, (1) Hauppauge HVR-2250, (1) Hauppauge HVR-1600, 1.5 TB of recording space
Android MiniClient: Nvidia Shield TV (16GB) HDMI out to Samsung LN46C630 46" LCD
Extender: STP-HD300, beta firmware "20110506-0", HDMI out to LG 37LD450 37" LCD
Reply With Quote
  #5  
Old 08-10-2010, 08:52 AM
ptzink ptzink is offline
Sage Aficionado
 
Join Date: Mar 2008
Posts: 300
Quote:
Originally Posted by matt91 View Post
THanks. I've been thinking about setting up itunes to manage my music, but I hadn't even realized that the playlists weren't directly compatible.

How long have you be using this procedure to produce and modify the playlists? It seems like there are a lot of things that potentially could go wrong.
Well, SageTV 7.0.13 was the first version to have the "fully_reimport_playlists_every_scan" property and it has been out for less than a week. So, not very long. But it seems to be working well so far. I agree that the method is a little convoluted, but once configured properly it is "maintenance free". That's why I created a detailed guide so hopefully others can enjoy iTunes playlists after the initial "hurdle" of setting it up. Ideally in the future SageTV would support iTunes playlists (and ratings, play counts, etc.) better right "out of the box". Or more likely, someone could develop a plugin that integrates with iTunes making this tutorial obsolete. But until then, this is one method to get some of your iTunes experience in SageTV.
__________________
Server: SageTV Media Center 7.1.19, Windows 7 Home Premium x64, Pentium Core2Duo, 4GB RAM, (1) Hauppauge HVR-2250, (1) Hauppauge HVR-1600, 1.5 TB of recording space
Android MiniClient: Nvidia Shield TV (16GB) HDMI out to Samsung LN46C630 46" LCD
Extender: STP-HD300, beta firmware "20110506-0", HDMI out to LG 37LD450 37" LCD
Reply With Quote
  #6  
Old 08-10-2010, 09:30 AM
darcilicious's Avatar
darcilicious darcilicious is offline
Sage Icon
 
Join Date: Jul 2009
Location: Venus
Posts: 1,306
Yeah there are players / software out there that read the iTunes library directly for content now (AirVideo I think will pickup video playlists from iTunes) and Orb picks up all iTunes playlists / songs now -- I use this last function alot, espeically now that SimplifyMedia bit the dust (boy, do I miss that app!)
__________________
SageTV Server 7.1.x w/Gemstone and Plex Home Theater v1.0.10 w/PlexPass
HD-PVR w/v1.5.6 drivers / Hauppauge IR blaster / FiOS Extreme HD / Motorola QIP6200 / SPDIF+720p Fixed Output
on HP Media Center 8400F (Phenom 9500 QuadCore 2.2GHz, nVidia GeForce 8500 GT)
via Olevia 247TFHD/Onyko TX-SR606/Harmony 550/HP MediaSmart EX490 WHS w/12TB
Plex Media Server v0.9.9.5 on HP Touchsmart Envy 23 d16qd
Sonos Play:3, Connect / SimpleTV v2 / Roku 2 XS+Plex / iPhone 5 / iPad 2
Reply With Quote
  #7  
Old 11-14-2010, 01:09 PM
HuMan321's Avatar
HuMan321 HuMan321 is offline
Sage Aficionado
 
Join Date: Apr 2009
Location: Idaho
Posts: 365
What is the latest in this area of using ITunes Playlists in Sage?
Thanks,
Reply With Quote
  #8  
Old 11-15-2010, 11:06 AM
ptzink ptzink is offline
Sage Aficionado
 
Join Date: Mar 2008
Posts: 300
Quote:
Originally Posted by HuMan321 View Post
What is the latest in this area of using ITunes Playlists in Sage?
Thanks,
To the best of my knowledge, there are no plugins or 'official' support for iTunes playlists. In fact, I even abandon this convoluted method I detailed above because I was having problems with the playlist scan freezing up my SageTV server. Hopefully, there will be a better way to get iTunes playlists in Sage soon, but I am not a programmer, so I am of little assistance.
__________________
Server: SageTV Media Center 7.1.19, Windows 7 Home Premium x64, Pentium Core2Duo, 4GB RAM, (1) Hauppauge HVR-2250, (1) Hauppauge HVR-1600, 1.5 TB of recording space
Android MiniClient: Nvidia Shield TV (16GB) HDMI out to Samsung LN46C630 46" LCD
Extender: STP-HD300, beta firmware "20110506-0", HDMI out to LG 37LD450 37" LCD
Reply With Quote
Reply

Tags
itunes, m3u, playlist, smart playlist, updating


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Playlists Not Updating ptzink SageTV Beta Test Software 8 12-19-2010 02:10 PM
Itunes movie downloads - playable in SageTV? ukmgranger SageTV Software 0 06-04-2008 10:49 AM
Any way to have SageTV add a converted show to iTunes edbmdave SageTV Software 1 12-16-2007 06:14 PM
Automated SageTV --> iTunes (for video iPod) squidmarks SageTV Customizations 47 06-20-2006 02:02 PM
iTunes playlists into SageTV mscottsimon SageTV Software 2 05-28-2006 05:00 PM


All times are GMT -6. The time now is 05:16 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.