[mythtv-users] mythtv dropping mysql???

Håkon Alstadheim hakon at alstadheim.priv.no
Tue Oct 21 16:35:02 UTC 2014


On 21. okt. 2014 17:08, jedi wrote:
> On Mon, Oct 20, 2014 at 09:39:42PM -0400, Ronald Frazier wrote:
>>> IMHO, the biggest problem with providing easy access to the underlying,
>>> internal-use data is that it provides a means by which people can selfishly
>>> solve problems for themselves rather than helping to solve the problem for
>>> everyone.
>>>
>> So is that your promise that any feature someone unselfishly develops will
>> get incorporated into mythtv? Please, don't answer...obviously the answer
>> is no, but that's exactly the point. Sometimes people do things to solve
>> problems that nobody else really even cares about (because, for them, it's
>> not a problem).
>     I've brought up a couple of ideas and have gotten a cold response from the
> developers. Tweaking the database for personal reasons seem to be a taboo
> subject so people probably don't bring up all of these little ideas that they
> have. So developers don't get feedback that could be useful. It probably also
My problem is that the mysql data is so easily avaliable through 
phpmyadmin. If I had some examples using the api, I'd probably use the 
api instead.

I arrived at the ball-of-twine below through several iterations, using 
very few brain-cells and just eyeballing my schedules table. So a 
convenient way to see everything in mythconverg, and interactively 
experimenting with various queries against the data is a must.

And, yes, I have had my myth system grinding to a total halt several 
times with bad schedules data, always populated through myth's internal 
EIT processing.


  Does anybody have the api-equvalent for the following:
-------/us/local/bin/mythconverg-baddies-----
#!/bin/bash
exec > /var/log/mythconveg-gremlins.log
## program.programid
echo before, program.programid:
# show any gremlins in programid
echo 'select chanid,starttime,programid  from program;' \
|mysql -h garbo -umythtv -pmythtv mythconverg \
| perl -lne 'chomp;print $_ if m([\x00-\x08\x0a-\x1f])'

# tell user what will happen
echo 'select chanid,starttime,programid  from program;' \
|mysql -h garbo -umythtv -pmythtv mythconverg \
| perl -lne 'chomp;print $_ if m([\x00-\x08\x0a-\x1f])' \
| perl -ane '{print "update program set programid = " . chr(39) . 
chr(39). " where chanid =  " . chr(39). "$F[0]" . chr(39). " and 
starttime = " . chr(39). "$F[1] $F[2]" . chr(39).  "; \n"}'

#do it
echo 'select chanid,starttime,programid  from program;' \
|mysql -h garbo -umythtv -pmythtv mythconverg \
| perl -lne 'chomp;print $_ if m([\x00-\x08\x0a-\x1f])' \
| perl -ane '{print "update program set programid = " . chr(39) . 
chr(39). " where chanid =  " . chr(39). "$F[0]" . chr(39). " and 
starttime = " . chr(39). "$F[1] $F[2]" . chr(39).  "; \n"}' |mysql -h 
garbo -umythtv -pmythtv mythconverg

echo after:
# show any gremlins in programid after fix
echo 'select chanid,starttime,programid  from program;' \
|mysql -h garbo -umythtv -pmythtv mythconverg \
| perl -lne 'chomp;print $_ if m([\x00-\x08\x0a-\x1f])'
-----
(the script continues with equivalent actions for the other text-fields)



More information about the mythtv-users mailing list