<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 10, 2015 at 6:59 AM, Thomas Boehm <span dir="ltr"><<a href="mailto:mythtv-users@lists.boehmi.net" target="_blank">mythtv-users@lists.boehmi.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 09/10/15 22:05, Michael Wisniewski wrote:<br>
</span><span class="">> 1225_20150417133000.mp4<br>
><br>
> What I would like to do is rename these files to something more useful,<br>
> such as<br>
><br>
> <TV Show Name>\<Season x>\<Episode Name.mp4><br>
<br>
</span>Just query all these information from the database in your userjob<br>
script and rename the file at the end.<br>
<br>
I have this in my script<br>
<br>
-------------------<br>
...<br>
mysqlcommand() {<br>
        echo "$1"|mysql --skip-column-names --database=${DBName}<br>
--user=${DBUserName} --password=${DBPassword} --host=${DBHostName}<br>
}<br>
...<br>
TITLE=`mysqlcommand "SELECT title FROM recorded WHERE basename = '$FILE';"`<br>
SUBTITLE=`mysqlcommand "SELECT subtitle FROM recorded WHERE basename =<br>
'$FILE';"`<br>
DESCRIPTION=`mysqlcommand "SELECT description FROM recorded WHERE<br>
basename = '$FILE';"`<br>
SEASON=`mysqlcommand "SELECT season FROM recorded WHERE basename =<br>
'$FILE';"`<br>
EPISODE=`mysqlcommand "SELECT episode FROM recorded WHERE basename =<br>
'$FILE';"`<br>
SE=$(echo "S${SEASON}E${EPISODE}"|awk -F '[SE]' '/S/<br>
{printf("S%02dE%02d\n",$2,$3)}')<br>
...<br>
-------------------<br></blockquote><div><br></div><div>Thank you for the script.  I'm going to have to try this out and think about what I want to do.  Ideally, it would be nice to have all my videos in one place and named properly.  I run Kodi for my main video library and myth for my live tv/dvr stuff.  It would be nice to export the myth to kodi, but still be able to watch it in both locations.  </div><div><br></div><div>The above sql queries will come in handy when I start to get a better grip on it!  THank You! </div></div></div></div>