0.22 Python bindings/MythDB

From MythTV Official Wiki
Jump to: navigation, search

This class is for general purpose access to the database, and contains several canned queries.

MythDB()

Open a connection to the database as defined by information in ~/.mythtv/config.xml

cursor()

Returns cursor for traditional database access.

getAllSettings(hostname=None)

Takes optional hostname, and returns all settings from database.

getSetting(value, hostname=None)

Takes optional hostname, and returns single setting from database.

setSetting(value, data, hostname=None)

Sets a setting with optional hostname. Insert setting if it does not already exist.

getStorageGroup(group=None, host=None)

Returns a tuple of dictionaries containing storage group directories. Contains the fields: id, group, host, and dirname. Takes optional group and host for filtering.

getCast(chanid, starttime, roles=None)

Returns cast members from a specified recording. If 'roles' is undefined, returns a dictionary of tuples indexed by role. If 'roles' is a string or tuple, return a tuple of members.

getChannels()

Returns a tuple containing all Channel objects.

getChannel(chanid)

Returns a single Channel object.

getGuideData(chanid,date)

Returns a tuple of Guide objects for one channel and day.