MythVideo integration

CaCtus491

16-02-2008 19:45:25

A solution that would allow me to automatically have renamed shows added to my MythVideo database including other metadata such as plot, etc.

sstteevvee

16-02-2008 20:01:34

I know how to talk to mysql through an ODBC connector whatsit, so if you can give me the mysql commands with 'fill in the blanks here', that'd be great. You'd also have to help me with the testing of it, since I don't use Myth myself.

It shouldn't be too hard to keep the filename info in sync with the database, if tvrename ends up renaming it to something else different in the future, either.

CaCtus491

18-02-2008 08:31:40

I'll put some queries together for you. However in the meantime here is some info about the DB tables:

Most importantly:
videometadata

And some others:
videometadatacountry
videogenre
videometadatagenre
videocategory

A single video is allowed to have multiple genres (hence the videogenre table and the videometadatagenre table to link video id to 0 or more genres in videogenre).
I see that tv.com lists the genres that a show belongs to which could be used here.

As for category, personally I would have tvrename setting this value to 'tv' for everything it does (as opposed to movie, etc). Not sure about how others organise their categories.
Country can probably be left blank.

CaCtus491

10-03-2008 15:36:57

Here is a sample query:
insert into videometadata (title, director, plot, rating, inetref, year, userrating, length, showlevel, filename, coverfile) values ("EPPISODE_TITLE:CHAR128", "DIRECTOR:CHAR128", "EPPISODE_SYNOPSIS:TEXT", "NR", "00000000", FIRSTAIRED_YEAR:INT, 0, DURATION_MINS:INT, 1, "PATH_TO_FILE:TEXT", "PATH_TO_COVER_JPG:TEXT")

I have included every field that isn't allowed to be null which also doesn't have a default value assigned.
If unknown, director is set to "Unknown".
I'm not sure if rating is meant to be 3 starts, or MA, etc, so for now we can leave it at "NR" which seems to be the default value Myth adds.
The two paths (to the video file, and to the cover art) appear to be absolute, as seen by the play back machine. Not sure the best way to handle this, as my mythfrontends see this as /home/media/videos/TV Series/Stargate SG1/Season 10/<eppisodes> where as the windows machine where I run tvrename sees the same files at \\192.168.90.51\media\videos\TV Series\Stargate SG1\Season 10\<eppisodes>. Perhaps we need an option to set the first part of the path?

primüs

10-03-2008 19:05:40

Im not sure but a program such as MythTV should have a way of using relative not absolute directories. But i havent looked ocmpletely at MythTV, i presume you set the folders yourself you dont have to use pre-set folders do you?

Best bet would be to have a 'Set your MythTV's media root directory' to the point of /home/blah/TV Series/ then do <showname> and <season> from the TVRename database of course.

CaCtus491

10-03-2008 19:18:22

Playback in MythTV is achieved through a plug-in called MythVideo. In the configuration if MythVideo, you can specify the location to the top level of your video files. MythVideo then has a utility that synchronises the database with the file system, adding entries for files it finds, and optionally removing ones that it can't. For files that it finds, you can perform an IMDB lookup to get plot info, etc, however this obviously doesn't work for TV shows. It would be possible to create a script to pull the info from TV.com, however TVRename already does all the hard work. Not to mention that TV Rename handles batches of files nicely where as Myth requires you to go through every file.

Anyways, I forgot what the point of my post was... ahh, yeah, I agree with what you are suggesting (I think). :)