Skip to content

Commit

Permalink
Add playback group support.
Browse files Browse the repository at this point in the history
  • Loading branch information
managementboy committed Aug 3, 2012
1 parent 486a1de commit be81ff9
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
8 changes: 7 additions & 1 deletion database.py
Expand Up @@ -34,7 +34,7 @@
'Output debugging messages for the database') 'Output debugging messages for the database')




CURRENT_SCHEMA='22' CURRENT_SCHEMA='23'
HAVE_WARNED_OF_DEFAULTS = False HAVE_WARNED_OF_DEFAULTS = False




Expand Down Expand Up @@ -598,6 +598,12 @@ def UpdateTables(self):
'add column chanid int(11);') 'add column chanid int(11);')
self.version = '22' self.version = '22'


if self.version == '22':
self.Log('Upgrading schema from 22 to 23')
self.db_connection.query('alter table mythnettv_subscriptions '
'add column playgroup text;')
self.version = '23'

if self.version != CURRENT_SCHEMA: if self.version != CURRENT_SCHEMA:
print 'Unknown schema version. This is a bug. Please report it to' print 'Unknown schema version. This is a bug. Please report it to'
print 'managementboy@gmail.com' print 'managementboy@gmail.com'
Expand Down
Binary file modified database.pyc
Binary file not shown.
8 changes: 4 additions & 4 deletions mythnettv
Expand Up @@ -141,10 +141,10 @@ def Usage(out):
subtitle subtitle
(subscription management) (subscription management)
subscribe <url> <title> <inetref*> <chanid*> subscribe <url> <title> <inetref*> <chanid*> <playbackgroup*>
: subscribe to a URL, and specify the show : subscribe to a URL, and specify the show
title, inetref, chanid (*optional, but title, inetref, chanid, playbackgroup
nice to have) (*optional, but nice to have)
list : list subscriptions list : list subscriptions
unsubscribe <url> <title> unsubscribe <url> <title>
: unsubscribe from a feed, and remove feed : unsubscribe from a feed, and remove feed
Expand Down Expand Up @@ -434,7 +434,7 @@ def main(argv, out=sys.stdout):
elif argv[1] == 'subscribe': elif argv[1] == 'subscribe':
# Subscribe to an RSS feed # Subscribe to an RSS feed
if len(argv) > 4: if len(argv) > 4:
mythnettvcore.Subscribe(argv[2], argv[3], argv[4], argv[5]) mythnettvcore.Subscribe(argv[2], argv[3], argv[4], argv[5], argv[6])
else: else:
mythnettvcore.Subscribe(argv[2], argv[3], None, None) mythnettvcore.Subscribe(argv[2], argv[3], None, None)
out.write('Subscribed to %s\n' % argv[3]) out.write('Subscribed to %s\n' % argv[3])
Expand Down
5 changes: 3 additions & 2 deletions mythnettvcore.py
Expand Up @@ -136,15 +136,16 @@ def DownloadAndImport(db, guid, out=sys.stdout):
return False return False




def Subscribe(url, title, inetref, chanid): def Subscribe(url, title, inetref, chanid, playgroup):
"""Subscribe -- subscribe to a new RSS or ATOM feed""" """Subscribe -- subscribe to a new RSS or ATOM feed"""


db = database.MythNetTvDatabase() db = database.MythNetTvDatabase()
db.WriteOneRow('mythnettv_subscriptions', 'url', {'url':url, db.WriteOneRow('mythnettv_subscriptions', 'url', {'url':url,
'title':title, 'title':title,
'inactive':None, 'inactive':None,
'inetref':inetref, 'inetref':inetref,
'chanid':chanid}) 'chanid':chanid,
'playgroup':playgroup})


def Update(out, title=None): def Update(out, title=None):
"""Update -- download updates for all feeds""" """Update -- download updates for all feeds"""
Expand Down
Binary file modified mythnettvcore.pyc
Binary file not shown.
6 changes: 6 additions & 0 deletions program.py
Expand Up @@ -795,6 +795,12 @@ def Import(self, out=sys.stdout):
if FLAGS.verbose: if FLAGS.verbose:
out.write('Setting the inetref to %s\n' % row['inetref']) out.write('Setting the inetref to %s\n' % row['inetref'])
tmp_recorded[u'inetref'] = row['inetref'] tmp_recorded[u'inetref'] = row['inetref']

# stet the playgroup if available
if row:
if FLAGS.verbose:
out.write('Setting the playgroup to %s\n' % row['playgroup'])
tmp_recorded[u'playgroup'] = row['playgroup']


tmp_recorded[u'audioprop'] = audioprop tmp_recorded[u'audioprop'] = audioprop
tmp_recorded[u'subtitletypes'] = subtitletypes tmp_recorded[u'subtitletypes'] = subtitletypes
Expand Down
Binary file modified program.pyc
Binary file not shown.

0 comments on commit be81ff9

Please sign in to comment.