[mythtv-users] Generating better recording filenames

daniel åkerud daniel.akerud at gmail.com
Sun Apr 20 17:26:21 UTC 2008


I wanted to share my recording with other units on the network, and since
the upnp support has been very shaky for me I had to come up with another
solution. What I do now is have a script run that gets all the recordings
from the database and generates links with good names that point to the
recordings. For example,

The link:
/home/da/storage/recordings/TV5.0420.Desperate Housewives(Del 6 säsong
4).mpg
points to:
/home/da/storage/.recordings/2099_20080420151600.mpg

Then I just share the folder with the links using samba and it is easily
browseable by any unit on the network. If anyone is interested the ruby
script is here:
http://pastebin.com/f5ec6e882

I have a cronjob running every minute (crontab -e):
* * * * * /home/da/scripts/genreclinks.rb

The script does the following:
1. connects to the database and gets all the information about all
recordings
2. generates names for links
3. removes old links in the link-directory
4. creates the new links

Output:
da at brutus:~/scripts$ ./genreclinks.rb
Created link: /home/da/storage/recordings/TV4.0420.Rent hus.mpg =>
/home/da/storage/.recordings/3004_20080420152258.mpg
Created link: /home/da/storage/recordings/TV3.0420.Top Model 9(Del 9 säsong
9).mpg => /home/da/storage/.recordings/2101_20080420190300.mpg

If you want to run it you need the mysql gem.

Cheers
Daniel Åkerud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20080420/fac0c282/attachment.htm 


More information about the mythtv-users mailing list