diff --git a/PseudoChannel.py b/PseudoChannel.py index e3e67fc..13b0aaf 100644 --- a/PseudoChannel.py +++ b/PseudoChannel.py @@ -660,12 +660,12 @@ class PseudoChannel(): def import_queue(self): """Dropping previous shows table before adding the imported data""" - self.db.clear_shows_table() + #self.db.clear_shows_table() with open('pseudo-queue.json') as data_file: data = json.load(data_file) - #pprint(data) + #print(data) for row in data: - print row + print "lastEpisodeTitle:", row[5] self.db.import_shows_table_by_row( row[2], row[3], @@ -693,7 +693,7 @@ class PseudoChannel(): data = json.load(data_file) #pprint(data) for row in data: - print row + """print row""" self.db.import_daily_schedule_table_by_row( row[2], row[3], diff --git a/src/PseudoChannelDatabase.py b/src/PseudoChannelDatabase.py index 7785bbd..39abb7c 100644 --- a/src/PseudoChannelDatabase.py +++ b/src/PseudoChannelDatabase.py @@ -332,22 +332,7 @@ class PseudoChannelDatabase(): unix = int(time.time()) try: - self.cursor.execute('''REPLACE INTO shows - (unix, - mediaID, - title, - duration, - lastEpisodeTitle, - fullImageURL, - plexMediaID - ) VALUES (?, ?, ?, ?, ?, ?, ?)''', - (unix, - mediaID, - title, - duration, - lastEpisodeTitle, - fullImageURL, - plexMediaID)) + self.cursor.execute('UPDATE shows SET lastEpisodeTitle = ? WHERE title = ?', (lastEpisodeTitle, title)) self.conn.commit() # Catch the exception except Exception as e: