[mythtv-users] Mythlink Questions

Michael Wisniewski mikewiz38 at gmail.com
Sat Oct 10 18:42:46 UTC 2015


On Sat, Oct 10, 2015 at 6:59 AM, Thomas Boehm <mythtv-users at lists.boehmi.net
> wrote:

> On 09/10/15 22:05, Michael Wisniewski wrote:
> > 1225_20150417133000.mp4
> >
> > What I would like to do is rename these files to something more useful,
> > such as
> >
> > <TV Show Name>\<Season x>\<Episode Name.mp4>
>
> Just query all these information from the database in your userjob
> script and rename the file at the end.
>
> I have this in my script
>
> -------------------
> ...
> mysqlcommand() {
>         echo "$1"|mysql --skip-column-names --database=${DBName}
> --user=${DBUserName} --password=${DBPassword} --host=${DBHostName}
> }
> ...
> TITLE=`mysqlcommand "SELECT title FROM recorded WHERE basename = '$FILE';"`
> SUBTITLE=`mysqlcommand "SELECT subtitle FROM recorded WHERE basename =
> '$FILE';"`
> DESCRIPTION=`mysqlcommand "SELECT description FROM recorded WHERE
> basename = '$FILE';"`
> SEASON=`mysqlcommand "SELECT season FROM recorded WHERE basename =
> '$FILE';"`
> EPISODE=`mysqlcommand "SELECT episode FROM recorded WHERE basename =
> '$FILE';"`
> SE=$(echo "S${SEASON}E${EPISODE}"|awk -F '[SE]' '/S/
> {printf("S%02dE%02d\n",$2,$3)}')
> ...
> -------------------
>

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.

The above sql queries will come in handy when I start to get a better grip
on it!  THank You!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20151010/fc145795/attachment.html>


More information about the mythtv-users mailing list