ImageMagick book
MythTV book
|
 |
|
 |
|
This is my page for MythTV information, including details of my book on the topic.
|
|
|
|
|
 |
|
 |
|
Sun, 13 Apr 2008
|
|
|
|
|
 |
|
 |
|
init script
#! /bin/sh
#
# mythbackend
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
BACKEND=/usr/local/bin/mythbackend
BACKEND_NAME=mythbackend
MYTHUSER="myth"
test -x $BACKEND || exit 0
set -e
case "$1" in
start)
echo -n "Starting MythTV: $BACKEND_NAME"
su ${MYTHUSER} -c "$BACKEND -v all -d -l ${MBE_LOGFILE}" &
echo "."
;;
stop)
echo -n "Stopping MythTV: $BACKEND_NAME"
killall $BACKEND
echo "."
;;
*)
echo "Usage: $0 {start|stop}" >&2
exit 1
;;
esac
exit 0
Tags for this post: mythtv( ) book( )
posted at: 10:53 | path: /mythtv/book | permanent link to this entry
There are no comments on this post which have survived moderation. 10 posts have been culled and 0 blocked. Be the first to make a non-spam comment here, please!
|
|
|
|
|
 |
|
 |
|
Fri, 12 Oct 2007
|
|
|
|
|
 |
|
 |
|
The book is doing ok
I must say I am pleased with the Amazon rank for the MythTV book. The ranks seem volatile though -- the other day it was doing well in "Linux books", now its doing well in "video books".
Tags for this post: mythtv( ) book( )
posted at: 03:43 | path: /mythtv/book | permanent link to this entry
There are no comments on this post which have survived moderation. 30 posts have been culled and 150 blocked. Be the first to make a non-spam comment here, please!
|
|
|
|
|
 |
|
 |
|
Sat, 15 Sep 2007
|
|
|
|
|
 |
|
 |
|
Illegal download sites for the MythTV book
In the last week, I have discovered three download sites offering illegal downloads of the MythTV book e-book. If I can find three without really trying, I assume there are a lot more of them out there. This raises a question for which I don't have a good answer. Do illegal downloads of books increase, or decrease sales? I can see arguments either way, but I'm tending towards the belief that they don't increase sales.
Does anyone out there have any data which isn't merely anecdotal? Want to share it?
Tags for this post: mythtv( ) book( )
posted at: 02:43 | path: /mythtv/book | permanent link to this entry
There are 4 comments on this post, and 108 comments which didn't survive moderation. 160 were blocked by trained gerbils. Click here to see them.
|
|
|
|
|
 |
|
 |
|
Tue, 04 Sep 2007
|
|
|
|
|
 |
|
 |
|
MythNetTV release 2
This release has bug fixes (including code from "nickca" for FLV support), and some new minor features. Enjoy!
- Started working harder to ensure video filenames are unique once imported into MythTV, I now prepend video files with epoch seconds at time of import
- DIVX (not divx) doesn't need transcode, added. Check for the existence of the video directory, and return an error if it needs creating.
- Handle storage groups, check for the existence of the data directory
- Updated docs
- Complained about the poor state of SWF support
- WMV support
- FLV support
Get it here if you care: http://www.stillhq.com/mythtv/mythnettv/
Tags for this post: mythtv( ) mythnettv( )
posted at: 13:24 | path: /mythtv/mythnettv | permanent link to this entry
There are 2 comments on this post, and 32 comments which didn't survive moderation. 69 were blocked by trained gerbils. Click here to see them.
|
|
|
|
|
 |
|
 |
|
Sun, 26 Aug 2007
|
|
|
|
|
 |
|
 |
|
Schedules direct is live!
Ok, for those of us in the US, we'll be glad to know that Schedules Direct is now live with two weeks to spare. It seems that the easiest way to perform the upgrade is to upgrade to 0.20.2, and then change the configuration to use SD instead of Zap2IT. Note that I haven't done it myself yet, but that there are instructions on the MythTV wiki.
Tags for this post: mythtv( ) guidedata( ) usa( ) zap2it( )
posted at: 09:36 | path: /mythtv/guidedata/usa/zap2it | permanent link to this entry
There are no comments on this post which have survived moderation. 93 posts have been culled and 148 blocked. Be the first to make a non-spam comment here, please!
|
|
|
|
|
 |
|
 |
|
Thu, 23 Aug 2007
|
|
|
|
|
 |
|
 |
|
Guide data update
Its been a while since I have commented on the state of US guide data for MythTV here. That's mainly been because I have been waiting for the situation to become more clear. At this stage there are some interesting things to report:
Tags for this post: mythtv( ) guidedata( ) usa( ) zap2it( )
posted at: 07:50 | path: /mythtv/guidedata/usa/zap2it | permanent link to this entry
There are no comments on this post which have survived moderation. 80 posts have been culled and 155 blocked. Be the first to make a non-spam comment here, please!
|
|
|
|
|
 |
|
 |
|
Video and slides from the Google talk
I'm a little slow at posting this, because I've been really busy. Google had the video of the MythTV talk online a day after the talk, which was nice. I haven't watched it myself, but hopefully it turned out ok. The talk got a little exciting when I had to reboot one of the machines mid talk because it wasn't seated in its dock properly. Such is life I suppose.
Here are the slides for the talk. Hopefully they'll help someone.
Tags for this post: mythtv( )
posted at: 06:57 | path: /mythtv | permanent link to this entry
There are 1 comments on this post, and 83 comments which didn't survive moderation. 145 were blocked by trained gerbils. Click here to see them.
|
|
|
|
|
 |
|
 |
|
Tue, 14 Aug 2007
|
|
|
|
|
 |
|
 |
|
MythTV talk at Google
I'm giving a MythTV talk at Google in the next week (although I can't find it on the events calendar at the moment, I'll update this post when I do) so I've been playing with MythTV 0.21 a little more than I have in the past. Its pretty cool.
I'm still writing the talk, so I don't know 100% what it will cover, but I'm thinking it would be good to include some of the stuff from 0.21 as a teaser. Storage groups, the flash player in MythWeb, and the tweaks to the theme system seem like good things to include. Does anyone have other things they think are really cool in 0.21?
Oh, and I'll have to cover guide data for the US, so it might be time to catch up with my MythTV email backlog once again.
Hopefully in you live near Silicon Valley you can come along to the talk and we can chat afterwards.
Update: I found a Google blog post with the details. To quote the most important information:
Like all sessions of the Open Source Developers @ Google Speaker Series, Michael's presentation will be open to the public. Doors open at 6:30 PM at our Mountain View campus; guests should plan to sign in at Building 43 reception upon arrival. Refreshments will be served and all are welcome and encouraged to attend. Michael's presentation will also be taped and published along with all of the public Google Tech Talks.
Tags for this post: mythtv( )
posted at: 08:01 | path: /mythtv | permanent link to this entry
There are 2 comments on this post, and 124 comments which didn't survive moderation. 290 were blocked by trained gerbils. Click here to see them.
|
|
|
|
|
 |
|
 |
|
Mon, 13 Aug 2007
|
|
|
|
|
 |
|
 |
|
MediaMVP
Here is a nice video explaining the MediaMVP. I've been looking for silent ways to park MythTV front ends in the kids bedrooms for a while, and this might end up being the way to go. The xbox that Matthew uses at the moment is simply too loud for most use.
I am left wondering if ad skipping works on the device though. I guess there is only one way to find out...
Tags for this post: mythtv( )
posted at: 03:34 | path: /mythtv | permanent link to this entry
There are no comments on this post which have survived moderation. 102 posts have been culled and 158 blocked. Be the first to make a non-spam comment here, please!
|
|
|
|
|
 |
|
 |
|
Mon, 16 Jul 2007
|
|
|
|
|
 |
|
 |
|
More reviews
I just got back from a lovely four days in Tasmania, and am just now catching up with the resulting email backlog. There are some new alerts about reviews of the MythTV book in there which are worth pointing out:
I'm surprised and disappointed that the installation of MythTV through pre-built packages or a CD distributions like KnoppMyth or MythDora were not covered deeper than a sentence or two in passing. This is likely to be a turn off for readers who were hoping for a quick and simple method of getting MythTV up and going.
...
On the whole I consider this a good book that is excellent for the new to intermediate MythTV user, although advanced users may pick a few good pieces of information out of it as well. It was well written and covered most items at just about the right introductory (yes -- practical) level. Once it has taught you the basics, you can then go and look up more details online for features you want to get more information about.
I think the comments about installation technique are fair, although the method described in the book is very likely to result in a nicely working MythTV system, which was not true for the MythTV packages that shipped with Ubuntu at the time of writing (they were a quite old version). Additionally, if you already have a Linux system you want to add MythTV to, then the way described in the book is better than the CD distributions because it doesn't involve a reinstall. I think it's horses for courses -- CD distributions are better for new users, but not for advanced users.
I'll add coverage of CD distributions to my TODO list of things to cover here sometime in the future.
Another review:
My main concern would be the assumption of prior Linux knowledge. The introduction states you need limited or no experience with Linux or Unix. I think that in this case, some time should have been taken to introduce complete Linux newcomers into the Ubuntu environment, which is something that wasn't touched on an awful lot. The installation of Ubuntu was well-covered and is generally a very simple process, but after that not much time was given to familiarise the user with the Ubuntu environment used throughout the book.
The rest of the book is extremely well written, clear and is a very good companion to MythTV. True to its name, it takes a practical approach to solving problems and if you're a Linux user interested in setting up a MythTV installation, it will make a very good resource.
Again, it is fair comment to say that we don't spend much time introducing Ubuntu apart from the bits needed to get MythTV working (we talk about installing Ubuntu on bare metal, apt, packages, LVM, disk resizing and so forth). Then again, I imagine that most people who build a PVR machine for their living room only run the PVR software on the machine, and don't tend to use the machine as a general purpose system. After all, who wants to write email on a TV sitting on the couch? Laptops are much better for that. There are also many excellent Ubuntu and Debian books out there already, so it would be a shame to lose focus on our core content and try to be too general. For those needing a more complete Ubuntu introduction I highly recommend Beginning Ubuntu , The Official Ubuntu Book and Ubuntu Hacks .
So, I'm going to chalk that up as two positive reviews, both with useful comments to consider for next time.
Tags for this post: mythtv( ) book( )
posted at: 11:41 | path: /mythtv/book | permanent link to this entry
There are no comments on this post which have survived moderation. 118 posts have been culled and 142 blocked. Be the first to make a non-spam comment here, please!
|
|
|
|
|
 |
|
 |
|
Sat, 07 Jul 2007
|
|
|
|
|
 |
|
 |
|
Zap2IT shutdown update
I've been silent on the Zap2IT shutdown issue for a week or so now, mainly because of travel, and also because I was waiting for something useful to happen. I've ready literally hundreds of emails of the users mailing list -- many proposing architectures for distribution of data, or placing various demands about how much someone would be willing to pay for the data. I am yet to see someone actually sit down and write some code though.
So hence this update. There isn't any useful news yet, except for a general reassurance that the developers promise that they are still working on a solution. So, keep on waiting is the plan for now...
Tags for this post: mythtv( ) guidedata( ) usa( ) zap2it( )
posted at: 19:44 | path: /mythtv/guidedata/usa/zap2it | permanent link to this entry
There are 2 comments on this post, and 5 comments which didn't survive moderation. 0 were blocked by trained gerbils. Click here to see them.
|
|
|
|
|
 |
|
 |
|
Sat, 23 Jun 2007
|
|
|
|
|
 |
|
 |
|
MythNetTV release 1
I figured it was time for another release of MythNetTV, especially since I've fixed some bugs recently and rolled in code generously provided by George Nassas. New things in this release:
- Initial work on transcoding smaller files to something else
- Better error checking for MySQL configuration and accessibility
- Fixed bug where MythNetTV was unhappy if there were no channels configured in the MySQL database
- Found, and hopefully fixed, a bug where program dates were not always being tracked correctly. Also added a check to make sure this doesn't happen again
- Added --markread, which lets you mark old shows as already downloaded
The code has seen a fair bit of use now, so it should be fairly stable. Let me know if you find any problems...
$ ./mythnettv --statistics
Programs tracked: 735
Google EngEdu: 350
Scoble Show: 85
linux.conf.au 2007: 74
Mobuzz TV: 82
dl.tv: 32
Net Cafe: 2
Foo: 1
ABC News: 2
Australia: 1
Play School: 1
Diggnation: 72
Programs still to download: 50
Google EngEdu: 49
Diggnation: 1
Data transferred: 103 gb (111017264341 bytes)
Get it here if you care: http://www.stillhq.com/mythtv/mythnettv/
Tags for this post: mythtv( ) mythnettv( )
posted at: 04:49 | path: /mythtv/mythnettv | permanent link to this entry
There are 2 comments on this post, and 20 comments which didn't survive moderation. 39 were blocked by trained gerbils. Click here to see them.
|
|
|
|
|
 |
|
 |
|
Fri, 22 Jun 2007
|
|
|
|
|
 |
|
 |
|
...and then there was a pause...
I guess we're at a different phase of the Zap2IT guide data thing now. The story has broken, there's been tons of email on the mythtv-users mailing list (remember, don't panic!), and now things have quietened down. I think that's probably a good thing, because it almost certainly means people are now no longer distracted from actually sitting down and working on the problem.
I imagine that journalists would make up some sensational thing to say to keep the story rolling during this quiet news cycle. I can't think of any such thing to say, and it wouldn't be ethical anyway.
I must say that I think
coverage like
this
isn't always helpful.
Tags for this post: mythtv( ) guidedata( ) usa( ) zap2it( )
posted at: 02:30 | path: /mythtv/guidedata/usa/zap2it | permanent link to this entry
There are no comments on this post which have survived moderation. 117 posts have been culled and 174 blocked. Be the first to make a non-spam comment here, please!
|
|
|
|
|
 |
|
 |
|
Thu, 21 Jun 2007
|
|
|
|
|
 |
|
 |
|
Some quick further thoughts on the Zap2IT shutdown
The Zap2IT forums has a thread about the shutdown (you need to have a Zap2IT login to get to the forum). One of the posts on the thread about the shutdown expands on the reasons for the free guide data shutting down:
- Continued use of the service to support commercial products, in violation of the agreement.
- Commercial products continued to grow despite previous appeals that this activity stop.
- There are significant changes to the supporting data structure forthcoming and we could not devote resources to the continued upkeep and enhancements of the service.
- Maintenance of the service is impacting our resource pool for other projects.
- We sought alternative options but were unable to find a solution.
- We recognize the hardship this creates for the user community. We are open to alternative solutions and would consider proposals that met the needs of the user community and our company.
- We looked into options to turn this into a paid service however we do not have the infrastructure at this time.
So it seems that the folks selling MythTV based solutions which used the guide data, as well as possible other commercial uses (the was no real way to check what system was connecting to the guide data) are the main reasons for the service shutdown.
That seems reasonable to me... It's inconvenient for MythTV users in the US, but there are other guide data sources. It is certainly disappointing that people we misusing the free service and caused it's shutdown for everyone.
Tags for this post: mythtv( ) guidedata( ) usa( ) zap2it( )
posted at: 02:17 | path: /mythtv/guidedata/usa/zap2it | permanent link to this entry
There are no comments on this post which have survived moderation. 104 posts have been culled and 163 blocked. Be the first to make a non-spam comment here, please!
|
|
|
|
|
 |
|
 |
|
An initial analysis of the removal of Zap2IT guide data in the US
(I had some spare time while waiting for the kids to finish their breakfast, so this is posted earlier than I planned).
As mentioned briefly earlier today MythTVnews.com is reporting that Tribune Media Services (TMS) is turning off their free guide data service for MythTV on 1 September 2007. This is mainly because of claims of abuse -- the theory on the MythTV users mailing list is that this abuse is vendors selling pre-configured MythTV systems for profit, which use the not-for-commercial-use guide data service from Zap2IT.
The announcement from TMS reads:
IMPORTANT MESSAGE:
For several years we have offered a free TV listings service to hobbyists for their own personal, noncommercial use. In October of 2004 we posted here an open letter saying the future of Zap2it Labs was at risk because of certain growing misuses of the Zap2it Labs data. Unfortunately this misuse has continued and grown. These misuses, combined with other business factors have led to the decision to discontinue Zap2it Labs effective September 1, 2007.
We thank those users who have honoured the terms of the agreement, and we suggest you consider the many TV listings options offered by the commercial licensees of TMS TV listings data.
If you would like to discuss how to license TV listings for commercial use, please let us know by e-mail (labs@zap2it.com) and include your company name, telephone number and the best time to reach you. We will respond to your inquiry as soon as possible.
We anticipate this decision will generate discussion and invite you to respond via the Zap2it Labs forum. We will do our best to respond to relevant questions posted on this forum in a timely manner.
There has been much consternation on the MythTV users mailing list about this announcement. There haven't been a lot of helpful suggestions yet though. There is the assurance that the development team is looking into options, and some users are suggesting rounding up enough people to pay for a commercial license. The reality however is that this is likely not a big deal. I can think of a few possible outcomes:
- Doom! The guide data stops, we all go home. This seems particularly unlikely though. It would take many people ignoring the problem, and just accepting that their MythTV systems are going to stop working.
- Some sort of scraper using XMLTV is written. This is in fact how guide data is obtained for most other countries at the moment. This technique is discussed in my MythTV book (Amazon), and is well understood. I would expect new XMLTV grabbers for the US to start appearing in the next few days.
- A conglomerate is formed to buy a commercial license to the guide data, and then sells that in XMLTV form to US based MythTV users. This option seems less likely to me, although not impossible. It would take someone being willing to buy the license for the data, on the assumption that enough people would actually pay for a XML feed. Lots of people have said they would, but there is already arguments over how much they would b willing to pay and it's yet to be seen if those people will actually front up with the cash. It should also be noted that this sort of arrangement has been tried in other countries, and seems to invariably fail.
- Another company steps up to provide guide data for free. There are lots of companies which have this data for their own uses now. Examples include the various TV guide web sites out there. They might chose to provide the data as a way of generating good will, as well as because providing the XML will cause less load on their systems than being automatically scraped to produce a third party XMLTV feed (the second option). This was the reason that the Zap2IT feed started being provided in the first place after all.
So, no doom yet. I'll post more analysis as it appears.
Tags for this post: mythtv( ) guidedata( ) usa( ) zap2it( )
posted at: 01:21 | path: /mythtv/guidedata/usa/zap2it | permanent link to this entry
There are 2 comments on this post, and 204 comments which didn't survive moderation. 170 were blocked by trained gerbils. Click here to see them.
|
|
|
|
|
 |
|
 |
|
|
|
|
|
|
 |
|
 |
|
Mon, 18 Jun 2007
|
|
|
|
|
 |
|
 |
|
Implementing parental filters with MythTV
The other morning I walked out to my five year old watching Robot Chicken. This isn't what I would call the highlight of my parenting career, but it did leave me with an immediate need to come up with a solution to stopping the kids from watching inappropriate things now that they're big enough to work their way through the MythTV user interface without our assistance. Its now quite common for me to wake up in the morning and discover that the kids have turned the monitor on in the living room, have found one of their shows, and are happily watching.
(I guess it says something about the ease of use of the MythTV user interface that my four and five year olds have no trouble navigating it without assistance. Specifically, the video thumbnail of the various recordings is a killer feature because it helps kids who can't read yet find the shows they want.)
The animated thumbnail of the recording appears in the bottom right of this example image.
Back to my need to filter recordings. Unfortunately this isn't covered in the MythTV book (Amazon), mainly because it didn't seem to me to be a killer feature at the time of laying out the chapters, and because we wanted to focus on getting the important aspects of Myth working well. I'm going to make up for that by writing up everything I've learnt about it in the last couple of days here.
You'll find the filtering setup, which can be used for both parental filtering and filtering based on your random other needs (like perhaps only wanting to display sports programs at the moment, or only documentaries when you're trying to impress visitors), in Utilities / Setup -> Setup -> TV Settings -> Playback -> View Recordings (Recording Groups), which is the fourth screen of the playback settings wizard. That location might be slightly different depending on what theme you are using. The screen looks like this:
Enabling a filter
You can see here my super secret password, which is used to escape the currently active filter, which I will show you how to do in a moment. You can also see that I've selected a filter called "Children" as the default filter to use when Media Library -> Watch Recordings is selected. The relevant options on this screen include whether to prompt for a filter when entering the Media Library -> Watch Recordings screen, which I disabled as I want the default to be the Children filter to stop my kids from selecting another filter. You can also have the filter default to whatever it was last time, which doesn't work for me because that would mean it was almost always set to showing all programs, but might be convenient to others. You can also choose to show the name of the filter instead of the words "All Programs" in the Media Library -> Watch Recordings view -- this is useful for reminding you what filter you are currently using, although you should turn this option off if you don't want people to know that you are using a filter at all.
The list of filters you can apply is based off the categories of the recordings currently in your MythTV database. These are stored in the category column of the recorded table, and for my back end the list is currently like this:
mysql> select distinct(category) from recorded;
+--------------------------+
| category |
+--------------------------+
| banana |
| |
| Children |
| Sitcom |
| Holiday-children special |
| Cooking |
| Crime drama |
| Reality |
| Documentary |
| House/garden |
| Talk |
| Special |
| Comedy |
| Children-special |
| Animated |
| Science fiction |
| Auto |
| Docudrama |
| Travel |
| Science |
| Drama |
| Home improvement |
| Fantasy |
| Suspense |
+--------------------------+
24 rows in set (0.00 sec)
The "banana" category is me testing to see if the statement above is really true. It must be, because after I changed a recording to have a category of banana, this was then presented as an option in the user interface:
Bananas make for good filters
The currently active filter is stored in the settings table of the MySQL database. Look for entries named "DisplayRecGroup" if you are inclined to poke around in your database.
This level of filtering is sufficient if you only want to show one category at a time in the Media Library -> Watch Recordings screen. However, there is no facility to filter based on the rating of the program, and no way to combine filters to display more than one category at once. For example, there is no way to display Children's shows, and Children's holiday specials at the same time. This is a bit of a shame. Conceivably you could implement custom filtering like this by changing the values for the category column in the recording table, but I wouldn't recommend this approach.
Anyway, on to how to use the filter now that you have it set up. Go to the Media Library -> Watch Recordings screen with the filter set, and you'll see that the view has changed to only include those things in your default category. You'll be able to tell that the filter is on if you selected the option to display the category name instead of "All Programs". My recordings screen looks like this when filtered to only include children's recordings:
Filtering to only show Children's recordings
As opposed to what it used to look like:
No filtering at all
To change the filter, press the menu key on your remote, or the M key on the keyboard. You'll see this menu:
The recordings menu
Select "Change Group Filter" from the menu. If you configured a password to change between filters, then the user interface to enter that password is displayed:
Entering a password
Enter your super secret password, and then you'll be prompted with a list of possible filters. If you didn't enable a password, you will of course end up going directly to this menu:
Selecting a new filter
And you've escaped the tyranny of the filter!
It would be nice for the filtering to be more granular, and there have been some proposals in that direction, although that proposal isn't a perfect solution either.
Tags for this post: mythtv( ) filter( ) parental( )
posted at: 11:33 | path: /mythtv/filter/parental | permanent link to this entry
There are 1 comments on this post, and 114 comments which didn't survive moderation. 58 were blocked by trained gerbils. Click here to see them.
|
|
|
|
|
 |
|
 |
|
Sun, 17 Jun 2007
|
|
|
|
|
 |
|
 |
|
How to transcode video for the Nokia N800
I have a Nokia N800 that I haven't had much time to play with, but I am about to go away on a trip which will involve a lot of time commuting on buses, so I figure I should start thinking about it again. Luckily for me, this page has pretty good instructions of what settings to use with mencoder to make it all look good on the N800. I haven't tried them yet, but I will report back when I do.
Tags for this post: mythtv( ) transcode( )
posted at: 06:47 | path: /mythtv/transcode | permanent link to this entry
There are no comments on this post which have survived moderation. 645 posts have been culled and 160 blocked. Be the first to make a non-spam comment here, please!
|
|
|
|
|
 |
|
 |
|
Sun, 10 Jun 2007
|
|
|
|
|
 |
|
 |
|
Building a symlink tree for MythTV recordings
I wanted to build a directory of symlinks that pointed to my MythTV recordings, so I wrote a little python script to do it for me. I figure someone else might find this useful too...
#!/usr/bin/python
# Copyright (C) Michael Still (mikal@stillhq.com) 2007
# Released under the terms of the GNU GPL
import MySQLdb
import os
import re
from socket import gethostname
# Connect to the MythTV database based on the MythTV config
config_values = {}
home = os.environ.get('HOME')
config = open(home + '/.mythtv/mysql.txt')
for line in config.readlines():
if not line.startswith('#') and len(line) > 5:
(key, value) = line.rstrip('\n').split('=')
config_values[key] = value
db_connection = MySQLdb.connect(host = config_values['DBHostName'],
user = config_values['DBUserName'],
passwd = config_values['DBPassword'],
db = config_values['DBName'])
cursor = db_connection.cursor(MySQLdb.cursors.DictCursor)
# Regexp for what is allowed in the symlink name
unsafe = re.compile('[^a-zA-Z0-9\-\:_]+')
# Find the recordings directory -- this assumes you haven't used an
# identifier string for this machine...
cursor.execute('select * from settings where value="RecordFilePrefix" and '
'hostname="%s";' % gethostname())
row = cursor.fetchone()
basedir = row['data']
# Now find all the recordings we have at the moment
cursor.execute('select title, subtitle, starttime, basename from recorded;')
for i in range(cursor.rowcount):
row = cursor.fetchone()
title = row['title']
subtitle = row['subtitle']
if subtitle == '':
subtitle = str(row['starttime'])
title = title.replace(' ', '_')
title = unsafe.sub('', title)
subtitle = subtitle.replace(' ', '_')
subtitle = unsafe.sub('', subtitle)
extn = row['basename'].split('.')[1]
try:
os.mkdir(title)
except:
pass
try:
os.symlink('%s/%s' %(basedir, row['basename']),
'%s/%s.%s' %(title, subtitle, extn))
except:
pass
This creates a tree of symlinks in the current directory that looks like this:
$ find . -type l
./Masterminds/Air_America
./Tech_Now/Getting_Famous
./Babar/To_Tell_or_Not_to_Tell
./Babar/The_Intruder
./Babar/Special_Delivery
./Babar/Conga_the_Terrible
./Babar/The_Celestville_Enquirer
./The_Backyardigans/Viking_Voyage
./The_Backyardigans/Cops_and_Robots
./The_Backyardigans/Eureka
./The_Backyardigans/Movers_of_Arabia
./The_Backyardigans/Save_the_Day
./Go_Diego_Go/Rainforest_Race
./Go_Diego_Go/Cool_Water_for_Ana_the_Anaconda
./Go_Diego_Go/Great_Jaguar_to_the_Rescue
./Go_Diego_Go/Diego_Saves_the_River_Dolphin
./Go_Diego_Go/Jorge_the_Little_Hawk_Learns_to_Migrate
./How_Its_Made/2007-06-08_09:30:00
Tags for this post: mythtv( )
posted at: 14:35 | path: /mythtv | permanent link to this entry
There are no comments on this post which have survived moderation. 148 posts have been culled and 161 blocked. Be the first to make a non-spam comment here, please!
|
|
|
|
|
 |
|
 |
|
Mon, 04 Jun 2007
|
|
|
|
|
 |
|
 |
|
Review
"If you're interested in setting up a PVR, then this is definitely a book to check out. Apress sells the paper version for $30, and offers an eBook for $15. Amazon offers it for $19.79, but I doubt that price will last long. I definitely give this book a 5 out of 5..."
Tags for this post: mythtv( ) book( )
posted at: 08:37 | path: /mythtv/book | permanent link to this entry
There are no comments on this post which have survived moderation. 103 posts have been culled and 165 blocked. Be the first to make a non-spam comment here, please!
|
|
|
|
|
|