[mythtv-users] iTunes and MythMusic

Shanon Mulley shanonmulleyster at gmail.com
Thu Jun 1 00:20:49 UTC 2006


ok. I just dug out my old emails. Here is the copy/paste of
instructions, along with the scripts.

A few notes/assumptions/bugs:
1) This script assumes that all your music files (well, mp3's) are all
under one directory on your windows machine. You can have your music
organised in subdirectories within this, so long as they are all under
the one directory. This script in its current form wont work if some
of your music is in "d:\music\", and some is in "c:\music\"
2) I've only really tested this with mp3's. I think I specifically
target mp3's, and leave other files behind.
3) If a file or directory has some special characters in it, it wont
copy across. Special characters such as []() &' have been accounted
for, but some special characters wont - most notably pronunciations in
characters (like ā and ă). The output will tell you which files
failed. I just rename the files/directories.
4) I don't believe there are any special dependencies for this. Using
Fedora Core 4, perl and the xml parser were already installed. (Just
make sure they are installed).
5) While this script will copy across the playlists and music files
from itunes, it is not recommended you use this to copy across your
whole music collection. It will copy across each music file
separately, and this is very slow. For the first run, copy across your
music manually, and then run the scripts. After you add new music to
itunes, run the script again to update the few tracks you added.
Rough instructions:
I'm writing these instructions from memory - they might be a bit shaky.
1) Share the directories where you keep your music and itunes database
on your windows machine. They can be read only if you like. On my
machine, I shared "C:\Documents and Settings\username\My Documents\My
Music" as "mymusic", and "d:\My Documents\mp3" as "mp3". (This is
assuming your itunes database and your music are stored in different
locations)
2) mount the windows shares on your linux machine. If you don't know
what your doing, you'll probably have to edit your fstab file
(/etc/fstab on Fedora). I added the two following lines to my fstab
file:
---fstab start---
//free-snr/mp3  /mnt/mp3  smbfs username=username,password=password 0 0
//free-snr/mymusic  /mnt/mymusic  smbfs username=username,password=password 0 0
---fstab end---
3) On your myth machine, create a new database in the mysql database.
I called mine "itunes". I used the following lines to create the
tables/fields/keys necessary:
---mysql statements start---
create table Track (ID int, Name varchar(100), Artist varchar(100),
Location varchar(255), mythfilename text, mythintid int);
create table Playlist (ID int, Name varchar(100), PlaylistItems text);
alter table Track add primary key (ID);
alter table Playlist add primary key (ID);
---mysql statements end---
4) Give the mythtv sql user read/write access to the itunes database
(I forget the commands for that).
5) copy the three files (two scripts, one configuration file) onto
your linux machine, and make them executable ("chmod 755 filename.pl"
I think).
6) edit the itunes.conf file with your configuration info. I have
included instructions within the file to assist with this.
7) That's it! (I think)
Running the scripts
1) Run step1.pl (./step1.pl) (This populates the mysql itunes
database, and copies across the music files)
2) open up mythtv, run the "scan for new" function within mythmusic.
3) run step2.pl (./step2.pl) (This deletes all existing itunes
playlists [denoted with a (i)], and re-creates them all. NOTE - It
will not delete playlists you have created in mythmusic - it will only
delete those which have (i) in the playlist name).


On 6/1/06, Shanon Mulley <shanonmulleyster at gmail.com> wrote:
> Sure I can share it.
>
> Actually, I already have. If you search through the archives of this
> mailing list, you should see two postings of mine where I put the
> details up. The first one will include the files, plus detailed
> instructions on how to use them. The second will be an update of the
> files.
>
> Let me know if you need further help.
>
> On 5/31/06, Phill Edwards <philledwards at gmail.com> wrote:
> > > I manage my mythmuisc playlists using itunes. The way I manage this is:
> > > 1) Make some changes in itunes (on my windows machine) - either
> > > adding/editing playlists, or adding new music. (All these mp3's are
> > > stored on the windows machine)
> > > 2) On the mythtv machine, run a script to read through the itunes xml
> > > database file, and copy any new music from the windows machine to the
> > > linux machine.
> > > 3) In mythtv, run the "scan for new music" function.
> > > 4) Run a second script to update the playlists.
> > >
> > > If no new music has been added, just new playlists, I can skip steps 2 and 3.
> > >
> > > Yes this means all my mp3's are on two machines, but that was my
> > > intention - sort of a backup. I'm sure these scripts could be modified
> > > to use a central repositry for thet mp3 files. I just find this
> > > easier.
> >
> > Any chance you could share your scripts with the group?
> >
> > Regards,
> > Phill
> > _______________________________________________
> > mythtv-users mailing list
> > mythtv-users at mythtv.org
> > http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
> >
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itunestomythmusicsyncing.zip
Type: application/zip
Size: 4872 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20060601/872ec39d/attachment.zip 


More information about the mythtv-users mailing list