<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.2900.3020" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006>Wrote a script for 
mythvideo in PHP4 that you might find useful.&nbsp; I got to the point where I 
didn't want to reorganize my video files because I didn't want to break their 
entries in the mythvideo db.&nbsp; Didn't want to lose the files' categories and 
association with cover art.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=703022820-20122006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006>This script 
will:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN class=co2>1) 
Confirm that each entry in the mythvideo db is still in its proper 
place.</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN 
class=co2></SPAN><SPAN class=co2>&nbsp;&nbsp;&nbsp; If a file is missing, it 
will look for it in the videos dir and all subdirs.</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN 
class=co2></SPAN><SPAN class=co2>&nbsp;&nbsp;&nbsp; If $FINDFILESUPDATE is set 
to 1 below, it will update the location in the db</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN 
class=co2></SPAN><SPAN class=co2>&nbsp; &nbsp; otherwise it will just print what 
it wants to do.</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN class=co2>2) 
For mythvideo entries that do not already have cover art, look for .jpg or 
.gif</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN 
class=co2>&nbsp;</SPAN><SPAN class=co2>&nbsp;&nbsp;&nbsp; files with an 
otherwise identical name in the video file's dir or the .covers 
dir.</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN 
class=co2>&nbsp;&nbsp;&nbsp;&nbsp; Failing that, if the folder has a folder.jpg 
file it will use that.</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN 
class=co2>&nbsp;&nbsp;&nbsp;&nbsp; e.g. /myth/video/Movies/Charade.avi can find 
/myth/video/Movies/Charade.jpg or</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN 
class=co2>&nbsp;&nbsp;&nbsp;&nbsp; 
/myth/video/.covers/Charade.jpg</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN 
class=co2>&nbsp;&nbsp;&nbsp;&nbsp; also 
/myth/video/TV/Sopranos/S1/Sopranos_S1E1.avi probably would not have a 
Sopranos_S1E1.jpg,</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN 
class=co2>&nbsp;&nbsp;&nbsp;&nbsp; but it (and other episodes) would find 
/myth/video/TV/Sopranos/S1/folder.jpg.</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN 
class=co2>&nbsp;&nbsp;&nbsp;&nbsp; If $FINDARTUPDATE is set to 1 below, it will 
update the db to point to the art file</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=703022820-20122006><SPAN 
class=co2>&nbsp;</SPAN><SPAN class=co2>&nbsp;&nbsp;&nbsp; otherwise it will just 
print what it wants to do.</SPAN></DIV></SPAN></FONT>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=703022820-20122006><FONT face=Arial size=2>Here's the 
code:</FONT></SPAN></DIV>
<DIV><A href="http://pastebin.ca/286614">http://pastebin.ca/2866<SPAN 
class=703022820-20122006>1</SPAN>4</A></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=703022820-20122006><FONT face=Arial size=2>I'm not the most 
experienced coder, so there's probably better ways to do things.&nbsp; I'll 
incorporate any comments and suggestions.&nbsp; e.g. any ideas for other things 
to tidy up from command line?&nbsp; Or other scriptable functions to make 
mythvideo easier to manage?&nbsp; Anyone want to test it/debug in 
PHP5?</FONT></SPAN></DIV>
<DIV><SPAN class=703022820-20122006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=703022820-20122006><FONT face=Arial size=2>If there are 
material changes and people are interested, I'll find a better host than 
pastebin.</FONT></SPAN></DIV>
<DIV><SPAN class=703022820-20122006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=703022820-20122006><FONT face=Arial size=2>I'm thinking of 
adding a feature to set the category (if none is set) based on text in braces in 
the filename.&nbsp; e.g. Sopranos_S1E1[TV].&nbsp; If I recall correctly, braced 
text does not make it into the title of a mythvideo entry.</FONT></SPAN></DIV>
<DIV><SPAN class=703022820-20122006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=703022820-20122006><FONT face=Arial size=2>Greyfoxx suggested a 
(separate) script to relocate or rename&nbsp;a file and update the mythvideo 
db.&nbsp; Shouldn't be too tough.</FONT></SPAN></DIV>
<DIV><SPAN class=703022820-20122006><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=703022820-20122006><FONT face=Arial 
size=2>Enjoy!</FONT></SPAN></DIV>
<P><FONT size=2>Mark S. Kasson, Principal<BR>SIG Management<BR></FONT></P>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BODY></HTML>