[mythtv-users] Meaningful file names

Lasse Knudsen lasse.h.knudsen at gmail.com
Fri May 26 22:01:13 UTC 2006


Thanks Michael

This was just what i was looking for :)

-Lasse
----- Original Message ----- 
From: "Michael T. Dean" <mtdean at thirdcontact.com>
To: "Discussion about mythtv" <mythtv-users at mythtv.org>
Sent: Friday, May 26, 2006 8:50 PM
Subject: Re: [mythtv-users] Meaningful file names


> On 05/26/2006 02:37 PM, Tom Lichti wrote:
>> Robert Johnston wrote:
>>
>>> Personally, I use a customised script that creates folders of links
>>> for different "Views" (By Title, By Category, By Channel, By Date).
>>>
>> mythrename.pl can do this
>
> So you could probably simplify your script to something like the
> attached.  It does views as
>
> starttime-endtime-title-subtitle
> title/starttime-endtime-subtitle
> recgroup-title-starttime-endtime-subtitle
> category-title-starttime-endtime-subtitle
> title-originalairdate-subtitle
>
> but the views (FORMATS)--and more--are easily customized (as described
> in the comments).
>
> Mike
>


--------------------------------------------------------------------------------


> #!/bin/bash
> #
> # mythlink.sh
> #
> # Creates readable symlinks referring to MythTV recordings using the
> # mythrename.pl script
>
> ### Modify these values for your installation ###
>
> # The path in which the views ("pretty" links) will be created
> VIEWS_PATH=/var/storage/mythtv/views
>
> # The location of the mythrename.pl script
> # The default value assumes mythrename.pl is in the user's PATH
> COMMAND=mythrename.pl
>
>
> ### The following directory names and formats may be customized ###
>
> # Formats may be constructed using the format specifiers listed in the
> # output of "mythrename.pl --help"
>
> # Files will be sorted "alphabetically" so the appropriate fields on which 
> you
> # would like to sort should be placed at the beginning of the format
>
> # To add a custom format, simply include a directory name and format in 
> the
> # environment variables below using the syntax shown below.
>
> # The names of the directories containing the views
> DIRECTORIES=(
>             'time'
>             'title'
>             'group'
>             'category'
>             'original_airdate'
>            )
> # The formats used for the respective directories specified above
> FORMATS=(
>         '%Y%m%d-%H%i-%eH%ei-%T-%S'
>         '%T/%Y%m%d-%H%i-%eH%ei-%S'
>         '%U-%T-%Y%m%d-%H%i-%eH%ei-%S'
>         '%C-%T-%Y%m%d-%H%i-%eH%ei-%S'
>         '%T-%oY%om%od-%S'
>        )
>
> # The string used to separate sections of the link name
> SEPARATOR='-'
>
> # The string used to replace illegal characters in the filename
> REPLACEMENT='_'
>
> # Whether to use underscores instead of spaces.
> # Use '' to allow spaces
> UNDERSCORES='--underscores'
> #UNDERSCORES=''
>
> # Whether to create links for LiveTV recordings.
> # Use '' to skip LiveTV
> LIVETV=''
> #LIVETV='--live'
>
> ### The following should not require changes ###
>
> # Ensure word splitting occurs only for newlines as some control devices 
> have
> # spaces in their names
> IFS=$'\n'
>
> # Make the links by calling mythlink.pl with the appropriate arguments
> last_index=$(( ${#DIRECTORIES[@]} - 1 ))
> for directory in `seq 0 $last_index`; do
>  ${COMMAND} --link ${VIEWS_PATH}/${DIRECTORIES[$directory]} ${LIVETV} \
>             --format ${FORMATS[$directory]} ${UNDERSCORES} \
>             --separator ${SEPARATOR} --replacement ${REPLACEMENT}
> done
>
>


--------------------------------------------------------------------------------


_______________________________________________
mythtv-users mailing list
mythtv-users at mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users



More information about the mythtv-users mailing list