Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hikavdh committed Apr 28, 2019
1 parent ae34a02 commit f592a5b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tvgrabpyAPI/tv_grab_IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -2594,6 +2594,13 @@ def get_credits(tbl, **values):
if len(rec) > 0:
self.execute(make_add_string('epcount'), *rec)

elif table in self.table_definitions.keys():
for c in item:
rec.append(make_val_list(table, **c))

if len(rec) > 0:
self.execute(make_add_string(table), *rec)

def update(self, table, **item):
if table == 'toggle_alt_url':
if not 'sourceid'in item.keys():
Expand All @@ -2605,7 +2612,7 @@ def update(self, table, **item):
set = {'use_alt_url': not uau},
where = {'sourceid': item['sourceid']})

else:
elif table in self.table_definitions.keys():
wfields = item.get('where', None)
sfields = item.get('set', None)
if not (table in self.table_definitions.keys() and isinstance(wfields, dict) and isinstance(wfields, dict)):
Expand Down Expand Up @@ -2741,7 +2748,7 @@ def delete(self, table, **item):
self.execute(u"DELETE FROM programdetails WHERE sourceid = ? AND channelid = ?",
(item['sourceid'], item['channelid']))

elif table == 'ttvdb':
elif table == 'ttvdb' and 'tid' in item.keys():
with self.pconn:
self.pconn.execute(u"DELETE FROM ttvdb_alias WHERE tid = ?", (int(item['tid']), ))
self.pconn.execute(u"DELETE FROM ttvdb WHERE tid = ?", (int(item['tid']), ))
Expand Down

0 comments on commit f592a5b

Please sign in to comment.