0.22 Python bindings/MythVideo

From MythTV Official Wiki
Jump to: navigation, search

This class provides several canned queries for interfacing with database data of the MythVideo plugin.

MythVideo()

Returns an initialized class.

getcastId(cast_name)

Returns ID of cast member from table videocast.

getGenreId(genre_name)

Returns ID of genre from table videogenre.

getMetadata(id)

Returns tuple of metadata for the specified video id

getMetadataId(path)

Returns intid from videometadata from file path.

hasMetadata(path)

Returns bool if file path exists in videometadata.

pruneMetadata()

Removes videos from videometadata with no matching file.

setCast(cast_name, idvideo)

Adds entry in videometadatacast to add a cast member to a video in videometadata. Adds cast member in videocast if necessary.

setMetadata(data, id=None)

Updates videometadata with data as a dictionary indexed by field name in videometadata. Inserts new video if 'id' is undefined.

getTitleId(title, subtitle=None, season=None, episode=None, array=False)

Returns ID for video of specified title, with optional additional search fields

getTableFieldNames(tablename)

Returns list of fieldnames for specified table

getMetadataDictionary(id)

Returns dictionary of metadata for specified video id, indexed by field name

getCategoryID(category_name)

Returns category IDs from videocategory, insert if not found

getFieldID(field, name)

setField(field, name, idvideo)

getGenresId(genre_name)

Returns genre ID from videogenre, insert if not found

setGenres(genre_name, idvideo)

Add video to genre, add genre if needed

getCountryId(country_name)

Returns Country id from videocountry, insert if not found

setCountry(country_name, idvideo)

Add video to country, add country if needed

cleanGenres(idvideo)

Remove all genre cross-references in videometadatagenres for specified video, does not remove genres from videogenre

cleanCountry(idvideo)

Remove all country cross-references in videometadatacountry for specified video, does not remove countries from videocountry

cleanCast(idvideo)

Remove all cast cross-references in videometadatacast for specified video, does not remove cast from videocast