You are here: Home » Topic » perlscript to set path to itune music library.xml

perlscript to set path to itune music library.xml

FireFly Media Server (formerly mt-daapd) Firefly Media Server Forums Firefly Media Server Add-on Software perlscript to set path to itune music library.xml

This topic contains 0 replies, has 0 voices, and was last updated by  dutchm 9 years, 10 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2166

    dutchm

    For those who like me wish to store their music folder on a nas but create their play list in itunes I have created a simple perl script to make setting the path of the music folder simple and quick. It can be run from the command line on your nas with “perl -w musicpath.pl” as long as your nas has perl installed. Simply edit the paths in your favorite text editor to suit your needs. Enjoy!

    1. create playlist in itunes
    2. move “iTunes Music Library.xml” to your nas itunes folder location
    3. run perl script to edit .xml path locations
    4. rescan in firefly to pick up the new playlists

    [/code]
    #! /usr/bin/perl -w

    #Simple perl script to open the iTunes music library.xml and reset path to whatever
    #Useful if your itunes music folder is located on your nas instead of your local drive.
    #Enjoy

    #Enter the path of your music folder as seen by iTunes on your pc
    $find = ‘file://localhost//Mybookworld/music/’;

    #Enter the path of your music folder as seen on the nas
    $replace = ‘file://localhost/music/’;

    #Enter the path of the iTunes Music Library.xml
    open (IN, “+

    @file = ;

    seek IN,0,0;

    foreach $file (@file){
    $file =~ s/$find/$replace/g;
    print IN $file;
    }
    close IN; 💡

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.