mirror of
https://github.com/FakeTV/pseudo-channel.git
synced 2026-01-09 11:43:15 +00:00
Applied fix for customSectionName = next_episode[9]
IndexError: tuple index out of range, error.
This commit is contained in:
@@ -423,7 +423,7 @@ class PseudoChannelDatabase():
|
||||
def get_first_episode(self, tvshow):
|
||||
|
||||
sql = ("SELECT id, unix, mediaID, title, duration, MIN(episodeNumber), MIN(seasonNumber), "
|
||||
"showTitle FROM episodes WHERE ( showTitle LIKE ?) COLLATE NOCASE")
|
||||
"showTitle, plexMediaID, customSectionName FROM episodes WHERE ( showTitle LIKE ?) COLLATE NOCASE")
|
||||
self.cursor.execute(sql, (tvshow, ))
|
||||
first_episode = self.cursor.fetchone()
|
||||
return first_episode
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
"""
|
||||
PseudoChannelRandomMovie
|
||||
|
||||
In order to get a better randomization by avoiding movie repeates,
|
||||
In order to get a better randomization by avoiding movie repeats,
|
||||
this class helps get a random movie based on its "lastPlayedDate".
|
||||
A list of all the movies are passed into this class ordered by
|
||||
"lastPlayedDate". The function then runs through the array to
|
||||
find the first movie that satisfies the delta of "lastPlayedDate"
|
||||
and "TIME_GAP_MONTHS". Then a new array with the rest of the movies
|
||||
and "TIME_GAP_DAYS". Then a new array with the rest of the movies
|
||||
that satisfy the condition is created. From there a random movie
|
||||
is picked and returned. If however, the function hits the end of the
|
||||
array of movies and the condition is not satisfied (all movies have
|
||||
been played more recently than the "TIME_GAP_MONTHS"), a random movie
|
||||
been played more recently than the "TIME_GAP_DAYS"), a random movie
|
||||
is then returned.
|
||||
|
||||
For smaller movie libraries it'll be useful to calculate a reasonable
|
||||
"TIME_GAP_MONTHS".
|
||||
"TIME_GAP_DAYS".
|
||||
"""
|
||||
import datetime
|
||||
import random
|
||||
|
||||
Reference in New Issue
Block a user