From 91d20a2d5a00a2a4266f125528f81f1513419932 Mon Sep 17 00:00:00 2001 From: Justin Emter Date: Sat, 2 Dec 2017 14:04:51 -0800 Subject: [PATCH] Fixed play() err, custom-section-names should be working now. --- PseudoChannel.py | 11 ++----- src/PseudoChannelDatabase.py | 45 ++++++++++++++++++++++++---- src/PseudoDailyScheduleController.py | 4 +++ 3 files changed, 47 insertions(+), 13 deletions(-) diff --git a/PseudoChannel.py b/PseudoChannel.py index dbab6a4..9edac8b 100644 --- a/PseudoChannel.py +++ b/PseudoChannel.py @@ -398,14 +398,9 @@ class PseudoChannel(): else: next_episode = self.db.get_next_episode(entry[3]) if next_episode != None: - try: - print "next_episode[9]", next_episode[9] - except: - pass - try: - customSectionName = next_episode[9] - except: - customSectionName = "TV Shows" + + customSectionName = next_episode[9] + episode = Episode( section, # section_type next_episode[3], # title diff --git a/src/PseudoChannelDatabase.py b/src/PseudoChannelDatabase.py index f6f7397..5045d41 100644 --- a/src/PseudoChannelDatabase.py +++ b/src/PseudoChannelDatabase.py @@ -115,7 +115,13 @@ class PseudoChannelDatabase(): """Database functions. Setters, etc. """ - def add_movies_to_db(self, mediaID, title, duration, plexMediaID, customSectionName): + def add_movies_to_db( + self, + mediaID, + title, + duration, + plexMediaID, + customSectionName): unix = int(time.time()) try: @@ -129,7 +135,13 @@ class PseudoChannelDatabase(): self.conn.rollback() raise e - def add_videos_to_db(self, mediaID, title, duration, plexMediaID, customSectionName): + def add_videos_to_db( + self, + mediaID, + title, + duration, + plexMediaID, + customSectionName): unix = int(time.time()) try: @@ -144,7 +156,15 @@ class PseudoChannelDatabase(): self.conn.rollback() raise e - def add_shows_to_db(self, mediaID, title, duration, lastEpisodeTitle, fullImageURL, plexMediaID, customSectionName): + def add_shows_to_db( + self, + mediaID, + title, + duration, + lastEpisodeTitle, + fullImageURL, + plexMediaID, + customSectionName): unix = int(time.time()) try: @@ -158,7 +178,16 @@ class PseudoChannelDatabase(): self.conn.rollback() raise e - def add_episodes_to_db(self, mediaID, title, duration, episodeNumber, seasonNumber, showTitle, plexMediaID, customSectionName): + def add_episodes_to_db( + self, + mediaID, + title, + duration, + episodeNumber, + seasonNumber, + showTitle, + plexMediaID, + customSectionName): unix = int(time.time()) try: @@ -172,7 +201,13 @@ class PseudoChannelDatabase(): self.conn.rollback() raise e - def add_commercials_to_db(self, mediaID, title, duration, plexMediaID, customSectionName): + def add_commercials_to_db( + self, + mediaID, + title, + duration, + plexMediaID, + customSectionName): unix = int(time.time()) try: diff --git a/src/PseudoDailyScheduleController.py b/src/PseudoDailyScheduleController.py index fc1671b..003ba96 100644 --- a/src/PseudoDailyScheduleController.py +++ b/src/PseudoDailyScheduleController.py @@ -376,6 +376,7 @@ class PseudoDailyScheduleController(): try: if mediaType == "TV Shows": + print "Here, Trying to play custom type: ", customSectionName mediaItems = self.PLEX.library.section(customSectionName).get(mediaParentTitle).episodes() for item in mediaItems: if item.title == mediaTitle: @@ -449,6 +450,9 @@ class PseudoDailyScheduleController(): if self.DEBUG: print str(row).encode('UTF-8') timeB = datetime.strptime(row[8], '%I:%M:%S %p') + + print "Here, row[13]", row[13] + self.play_media(row[11], row[6], row[3], offset, row[13]) self.write_schedule_to_file( self.get_html_from_daily_schedule(