[mythtv] db schema, metadata and season/episode numbering
Torbjörn Jansson
torbjorn.jansson at mbox200.swipnet.se
Mon Apr 30 22:25:19 UTC 2012
> Since he's no longer here to block it I'd be interested in pushing
> forward, at
> least in the UK it's pretty decent information. There's no reason to
> simply
> ignore it, especially when the current metadata lookup is so hit and
> miss (tv
> espiodes frequently given film metadata and vice-versa), having
> season/episode
> information would either make it more reliable or as reliable, but
> certainly
> not less. Even if the air order differs from the order at tvdb.com
> (subtitle
> etc) can always take precedence over episode number.
>
> If nothing else it could be inserted as airepisode/airseason - let
> those of us
> who get this data use it in the UI and for sorting.
> --
> Stuart Morgan
I'm all for it.
That’s why I started to look into this.
What I have now is a bit of a hack and takes advantage of the syndicatedepisodenumber being updated with the right info by mythfilldatabase with the xmltv season and episode info.
The query below is can probably be done better and it would have been nice with some regexp matching.
UPDATE `mythconverg`.`recorded`,(
SELECT
chanid,
starttime,
IF(INSTR(syndicatedepisodenumber,'S')>0,SUBSTRING(syndicatedepisodenumber,2,INSTR(syndicatedepisodenumber,'S')-2),SUBSTRING(syndicatedepisodenumber,2,LENGTH(syndicatedepisodenumber))) AS e,
IF(INSTR(syndicatedepisodenumber,'S')=0,0,SUBSTRING(syndicatedepisodenumber,INSTR(syndicatedepisodenumber,'S')+1,99)) AS s
FROM
`mythconverg`.`recordedprogram`
WHERE
LENGTH(syndicatedepisodenumber)>0
) AS A SET `mythconverg`.`recorded`.season=A.s, `mythconverg`.`recorded`.episode=A.e
WHERE
`mythconverg`.`recorded`.`chanid`=A.`chanid`
AND `mythconverg`.`recorded`.`starttime`=A.`starttime`
AND episode=0
AND season=0
More information about the mythtv-dev
mailing list