Media Library

From AwkwardTV
Revision as of 17:02, 24 March 2007 by Czarcats (talk | contribs) (added link to gnupod)
Jump to: navigation, search

The Media Library file (in /mnt/Media/Media Library) is similar to iTunesDB on the iPod. The path to the actual media files are relative to /mnt/Media/Media Files/

Patch for gnupod (http://www.gnu.org/software/gnupod/) to output the correct path as well as a stub for handling .mov (for reference files) (also note that this makes it not work for real ipods):

--- gnupod-orig/src/ext/FileMagic.pm    2006-09-27 02:52:23.000000000 -0700
+++ gnupod-0.99.1/src/ext/FileMagic.pm  2007-03-24 16:48:43.000000000 -0700
@@ -73,6 +73,20 @@
   elsif(!-r $file) {
    warn "FileMagic.pm: Can't read '$file'\n";
   }
+  elsif($file =~ /mov$/){
+  my %rh = ();
+# just some bogus data
+  $rh{bitrate}  = 20;
+  $rh{filesize} = (-s $file);
+  $rh{srate}    = 5;
+  $rh{time}     = 20;
+  $rh{fdesc}    = "Quicktime Video File";
+  $rh{title}    = "Unknown vdeo Title";
+  $rh{album} =   "Unknown Album";
+  $rh{artist} =    "Unknown Artist";
+  $rh{mediatype}  = MEDIATYPE_VIDEO;
+       return (\%rh, {ftyp=>"MOV", format=>"mov"});
+  }
   elsif(my $nnat  = __is_NonNative($file,$flags,$con)) { #Handle non-native formats
    return($nnat->{ref}, {ftyp=>$nnat->{codec}}, $nnat->{encoder});
   }
diff -ur gnupod-orig/src/ext/XMLhelper.pm gnupod-0.99.1/src/ext/XMLhelper.pm
--- gnupod-orig/src/ext/XMLhelper.pm    2006-02-03 12:47:24.000000000 -0800
+++ gnupod-0.99.1/src/ext/XMLhelper.pm  2007-03-24 16:48:53.000000000 -0700
@@ -121,6 +121,8 @@
 
 #Convert /'s to :'s
 $ipath =~ tr/\//:/;
+# for appletv
+$ipath=~s/:iPod_Control:Music//;
 return ($ipath, $path);
 }

After gnupod is built:

  • mkdir MediaNew
  • export IPOD_MOUNTPOINT=`pwd`/MediaNew
  • gnupod_INIT.pl
  • gnupod_addsong.pl <whatever>
  • mktunes.pl

Copy these files to the appletv:

  • iPod_Control/Music/* -> /mnt/Media/Media Files/*
  • iPod_Control/iTunes/iTunesDB -> /mnt/Media/Media Library

You'll need to restart Finder/Front Row on the appletv to get it to reread the db