[mythtv-users] Automatically changing EIT title to title and subtitle.

Tomi Makinen makinen at gmail.com
Thu Aug 13 04:28:25 UTC 2009


Hey,

I put together a script containing couple of sql queries to make this thing
happen.
First sql removes ':'-characters from the beginning of recording titles,
then the title is separated to subtitle and title. If needed I will add
extra check what makes sure that the subtitle needs to be empty do this
thing.

#!/usr/bin/perl -w
use strict;
use MythTV;
my $jobid = -1;
my $mt = new MythTV();
my $db = $mt->{'dbh'};

sub Die($)
{
   print STDERR "@_\n";
   exit -1;
}

my ($query);

$query = $db->prepare("update recorded set title =
SUBSTRING_INDEX(title,\':\', -1) where title like \":\%\";");
$query->execute || Die "Unable to remove :";
$query->finish;

$query = $db->prepare("update recorded set subtitle = SUBSTRING_INDEX(title,
\':\', -1) where title like \"\%:\%\";");
$query->execute || Die "Unable to set subtitle";
$query->finish;

$query = $db->prepare("update recorded set title = SUBSTRING_INDEX(title,
\':\', 1) where title like \"\%:\%\";");
$query->execute || Die "Unable to update title";
$query->finish;


On Sat, Jul 18, 2009 at 7:14 PM, Tomi Makinen <makinen at gmail.com> wrote:

> thanks for the thread, looks promising.
>
> Well I think if the modification is done only when subtitle is empty, it
> would work, atleast for me ..
>
> Will look into this in more detail when I found enough time..
>
>
> On Tue, Jul 14, 2009 at 5:48 AM, Nick Rout <nick.rout at gmail.com> wrote:
>
>> Trouble is some programmes genuinely have a colon in the name, like
>> CSI:Miami.
>>
>> In the meantime you might like this thread:
>>
>> http://www.gossamer-threads.com/lists/mythtv/mythtvnz/362706
>>
>> On Tue, Jul 14, 2009 at 8:07 AM, Tomi Makinen<makinen at gmail.com> wrote:
>> > Thanks for replies...
>> >
>> > It might be that I try to make a script for this. The eit data does not
>> need
>> > any adjustment when changing to summer time or winter time.. thats the
>> main
>> > reason to sticking with it..
>>
>> Trouble is some programmes genuinely have a colon in the name, like
>> CSI:Miami.
>>
>> In the meantime you might like this thread:
>>
>> http://www.gossamer-threads.com/lists/mythtv/mythtvnz/362706
>>
>> >
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users at mythtv.org
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20090813/030b70ef/attachment.htm>


More information about the mythtv-users mailing list