From 15952044f7effb5ff0863ddda475db51a6fcaf32 Mon Sep 17 00:00:00 2001 From: Shane Frischkorn Date: Fri, 5 Jul 2013 14:48:21 +1000 Subject: [PATCH] Added mythtv logic --- libmythtv.py | 14 ++++++++++++++ libtvdatasource.py | 7 +++++++ 2 files changed, 21 insertions(+) create mode 100644 libtvdatasource.py diff --git a/libmythtv.py b/libmythtv.py index a3ab093..5789d8a 100644 --- a/libmythtv.py +++ b/libmythtv.py @@ -5,3 +5,17 @@ Created on Fri Jul 5 14:10:47 2013 @author: shanef """ +import MySQLdb as mdb +from libtvdatasource import TVShow + +class MythTV: + def RetrieveEpisodeData(serverAddress, user, password, database, inputFile): + con = mdb.connect(serverAddress, user, password, database) + + with con: + cur = con.cursor(mdb.cursors.DictCursor) + cur.execute("select episode, season, title, subtitle, description from mythconverg.recorded where basename = '{0}'".format(inputFile)) + result = cur.fetchone() + + return TVShow(result['episode'], result['season'], result['title'], result['subtitle'], result['description']) + \ No newline at end of file diff --git a/libtvdatasource.py b/libtvdatasource.py new file mode 100644 index 0000000..b73fc16 --- /dev/null +++ b/libtvdatasource.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +""" +Created on Fri Jul 5 14:42:47 2013 + +@author: shanef +""" +