[mythtv-users] MythWeb filename to actual filename

Michael T. Dean mtdean at thirdcontact.com
Wed Apr 8 05:36:05 UTC 2009


On 04/07/2009 11:07 PM, David Fishburn wrote:
> My rudimentary shell scripting produced this script which does what I need.
> If someone can offer any improvements on it terrific.
> I actually have to check 2 locations, since I stored recordings in 2
> different locations.  I just removed the second check from the script.
> I don't know if it is possible to ask Myth for the recording directory
> locations (to make the script more generic) but it is a simple change
> as is if things move.
>   
...
> # Example call
> # /home/mythtv/bin/mythweb_file.sh
> http://fishburns.homedns.org/mythweb/tv/detail/1010/1238025600
>   

Or, after running mythrename.pl (i.e. in a cron job at 5 and 35--or 1 
and 31 or 2 and 32--after the hour or whatever), you can just say:

$ ls -l /path/to/pretty/views/original_airdate/Chuck*

and look at the link reference:

lrwxrwxrwx 1 me group 59 2009-04-08 01:04 
/path/to/pretty/views/original_airdate/Chuck-20090406-_Chuck_Versus_the_Dream_Job.mpg 
-> /path/to/recordings/1021_20090406200000.mpg

Or, if you wanna get fancy:

$ ls -l /path/to/pretty/views/original_airdate/Chuck* |
  awk '{ print $10 }'

/path/to/recordings/1021_20090406200000.mpg

Or if you want both the link name and the file name:

$ ls -l /path/to/pretty/views/original_airdate/Chuck* |
  awk '{ print $8 "\n" $10 }'

/path/to/pretty/views/original_airdate/Chuck-20090406-_Chuck_Versus_the_Dream_Job.mpg
/path/to/recordings/1021_20090406200000.mpg

Or, you can just use the link with the pretty name to do whatever you 
need...

cp /path/to/pretty/views/original_airdate/Chuck-20090406-* /some/other/place
scp /path/to/pretty/views/original_airdate/Chuck-20090406-* laptop:TV/

or whatever...

(And by running mythrename.pl multiple times--each time specifying a 
different format--you can have separate views sorted by different 
criteria, such as original airdate, start time, recgroup, category, 
title, ...)

mythrename.pl --link /path/to/pretty/views/original_airdate \
              --format '%T-%oY%om%od-%S' --underscores \
              --separator '-' --replacement '_'

just try it...  :)

Mike


More information about the mythtv-users mailing list