mirror of
https://github.com/FakeTV/pseudo-channel.git
synced 2025-12-17 00:33:17 +00:00
database storage updates
This commit is contained in:
@@ -893,6 +893,7 @@ class PseudoChannel():
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
show_title = entry[3]
|
show_title = entry[3]
|
||||||
|
notes_data = "Rated " + str(next_episode[10]) + "</br>" + str(next_episode[12])
|
||||||
if next_episode != None:
|
if next_episode != None:
|
||||||
customSectionName = next_episode[9]
|
customSectionName = next_episode[9]
|
||||||
episode = Episode(
|
episode = Episode(
|
||||||
@@ -913,6 +914,7 @@ class PseudoChannel():
|
|||||||
next_episode[5], # episode_number
|
next_episode[5], # episode_number
|
||||||
next_episode[6], # season_number
|
next_episode[6], # season_number
|
||||||
advance_episode, # advance_episode
|
advance_episode, # advance_episode
|
||||||
|
notes_data #notes
|
||||||
)
|
)
|
||||||
self.MEDIA.append(episode)
|
self.MEDIA.append(episode)
|
||||||
else:
|
else:
|
||||||
@@ -1327,6 +1329,7 @@ class PseudoChannel():
|
|||||||
#get plex metadata
|
#get plex metadata
|
||||||
plex_movie = self.PLEX.fetchItem(the_movie[6])
|
plex_movie = self.PLEX.fetchItem(the_movie[6])
|
||||||
last_data = ""
|
last_data = ""
|
||||||
|
notes_data = ""
|
||||||
if str(entry[3]).lower() == "kevinbacon":
|
if str(entry[3]).lower() == "kevinbacon":
|
||||||
actors_list_old = actors_list
|
actors_list_old = actors_list
|
||||||
actors_list = {}
|
actors_list = {}
|
||||||
@@ -1340,10 +1343,12 @@ class PseudoChannel():
|
|||||||
if actor_match == "":
|
if actor_match == "":
|
||||||
actor_match = actor.tag
|
actor_match = actor.tag
|
||||||
if actor_match != "":
|
if actor_match != "":
|
||||||
last_data = actor_match + "," + last_movie
|
notes_data = "This movie derived from " + last_movie + " through " + actor_match + "\n"
|
||||||
else:
|
else:
|
||||||
last_data = ""
|
notes_data = ""
|
||||||
last_movie = the_movie[3]
|
last_movie = the_movie[3]
|
||||||
|
actors_data = the_movie[12].strip('][').split(',')
|
||||||
|
notes_data = notes_data + "Rated " + the_movie[8] + "</br>Starring: " + actors_data[0] + ", " + actors_data[1] + " and " + actors_data[2] + "</br>" + the_movie[10] + "</br>" + the_movie[14]
|
||||||
movie = Movie(
|
movie = Movie(
|
||||||
section, # section_type
|
section, # section_type
|
||||||
the_movie[3], # title
|
the_movie[3], # title
|
||||||
@@ -1357,7 +1362,7 @@ class PseudoChannel():
|
|||||||
the_movie[6], # plex id
|
the_movie[6], # plex id
|
||||||
the_movie[7], # custom lib name
|
the_movie[7], # custom lib name
|
||||||
media_id, # media_id
|
media_id, # media_id
|
||||||
last_data # notes (for storing kevin bacon data)
|
notes_data # notes (for storing kevin bacon data)
|
||||||
)
|
)
|
||||||
self.MEDIA.append(movie)
|
self.MEDIA.append(movie)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ class Commercial(Media):
|
|||||||
overlap_max,
|
overlap_max,
|
||||||
plex_media_id,
|
plex_media_id,
|
||||||
custom_section_name,
|
custom_section_name,
|
||||||
media_id
|
media_id,
|
||||||
|
notes
|
||||||
):
|
):
|
||||||
|
|
||||||
super(Commercial, self).__init__(
|
super(Commercial, self).__init__(
|
||||||
@@ -46,3 +47,4 @@ class Commercial(Media):
|
|||||||
custom_section_name,
|
custom_section_name,
|
||||||
media_id
|
media_id
|
||||||
)
|
)
|
||||||
|
self.notes = notes
|
||||||
@@ -36,7 +36,8 @@ class Episode(Media):
|
|||||||
show_series_title,
|
show_series_title,
|
||||||
episode_number,
|
episode_number,
|
||||||
season_number,
|
season_number,
|
||||||
advance_episode
|
advance_episode,
|
||||||
|
notes
|
||||||
):
|
):
|
||||||
|
|
||||||
super(Episode, self).__init__(
|
super(Episode, self).__init__(
|
||||||
@@ -58,3 +59,4 @@ class Episode(Media):
|
|||||||
self.episode_number = episode_number
|
self.episode_number = episode_number
|
||||||
self.season_number = season_number
|
self.season_number = season_number
|
||||||
self.advance_episode = advance_episode
|
self.advance_episode = advance_episode
|
||||||
|
self.notes = notes
|
||||||
@@ -124,7 +124,8 @@ class PseudoChannelCommercial():
|
|||||||
"0", # overlap_max
|
"0", # overlap_max
|
||||||
random_commercial[5], # plex_media_id
|
random_commercial[5], # plex_media_id
|
||||||
random_commercial[6], # custom lib name
|
random_commercial[6], # custom lib name
|
||||||
"3" #media_id
|
"3", #media_id,
|
||||||
|
None #notes
|
||||||
)
|
)
|
||||||
last_commercial = new_commercial
|
last_commercial = new_commercial
|
||||||
if new_commercial_end_time > curr_item_start_time:
|
if new_commercial_end_time > curr_item_start_time:
|
||||||
@@ -169,7 +170,8 @@ class PseudoChannelCommercial():
|
|||||||
"0", # overlap_max
|
"0", # overlap_max
|
||||||
random_final_comm[5], # plex_media_id
|
random_final_comm[5], # plex_media_id
|
||||||
random_final_comm[6], # custom lib name
|
random_final_comm[6], # custom lib name
|
||||||
"3" #media_id
|
"3", #media_id
|
||||||
|
None #notes
|
||||||
)
|
)
|
||||||
commercial_list.append(final_commercial)
|
commercial_list.append(final_commercial)
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ class PseudoChannelDatabase():
|
|||||||
#print(str("{}: {} - {}".format(media.start_time, media.title, media.custom_section_name)).encode('UTF-8'))
|
#print(str("{}: {} - {}".format(media.start_time, media.title, media.custom_section_name)).encode('UTF-8'))
|
||||||
except:
|
except:
|
||||||
print("ERROR: Not outputting media info due to ascii code issues.")
|
print("ERROR: Not outputting media info due to ascii code issues.")
|
||||||
if media.media_id == 112:
|
if media.media_id != 3:
|
||||||
notes = media.notes
|
notes = media.notes
|
||||||
else:
|
else:
|
||||||
notes = ""
|
notes = ""
|
||||||
@@ -368,7 +368,7 @@ class PseudoChannelDatabase():
|
|||||||
else:
|
else:
|
||||||
seriesTitle = ''
|
seriesTitle = ''
|
||||||
self.add_daily_schedule_to_db(
|
self.add_daily_schedule_to_db(
|
||||||
media.media_id if media.__class__.__name__ == "Movie" else 0,
|
media.media_id,
|
||||||
media.title,
|
media.title,
|
||||||
media.episode_number if media.__class__.__name__ == "Episode" else 0,
|
media.episode_number if media.__class__.__name__ == "Episode" else 0,
|
||||||
media.season_number if media.__class__.__name__ == "Episode" else 0,
|
media.season_number if media.__class__.__name__ == "Episode" else 0,
|
||||||
|
|||||||
@@ -145,10 +145,18 @@ for channel_dir in channel_dirs:
|
|||||||
entryList['endTime'] = datetime.datetime.fromtimestamp(float(entryList['startTimeUnix']) + the_show[4]/1000).strftime("%H:%M:%S")
|
entryList['endTime'] = datetime.datetime.fromtimestamp(float(entryList['startTimeUnix']) + the_show[4]/1000).strftime("%H:%M:%S")
|
||||||
entryList['timeShift'] = 15
|
entryList['timeShift'] = 15
|
||||||
entryList['overlapMax'] = 15
|
entryList['overlapMax'] = 15
|
||||||
entryList['xtra'] = ""
|
entryList['xtra'] = None
|
||||||
|
entryList['rerun'] = 0
|
||||||
|
entryList['year'] = None
|
||||||
|
entryList['genres'] = None
|
||||||
|
entryList['actors'] = None
|
||||||
|
entryList['collections'] = None
|
||||||
|
entryList['rating'] = None
|
||||||
|
entryList['studio'] = None
|
||||||
|
entryList['seasonEpisode'] = None
|
||||||
print("INFO: Adding "+entryList['startTime']+" - "+entryList['title']+"\033[K",end='\n')
|
print("INFO: Adding "+entryList['startTime']+" - "+entryList['title']+"\033[K",end='\n')
|
||||||
sql = "INSERT INTO schedule(id,unix,mediaID,title,duration,startTime,endTime,dayOfWeek,startTimeUnix,section,strictTime,timeShift,overlapMax,xtra) \
|
sql = "INSERT INTO schedule(id,unix,mediaID,title,duration,startTime,endTime,dayOfWeek,startTimeUnix,section,strictTime,timeShift,overlapMax,xtra,rerun,year,genres,actors,collections,rating,studio,seasonEpisode) \
|
||||||
VALUES(:id,:unix,:mediaID,:title,:duration,:startTime,:endTime,:dayOfWeek,:startTimeUnix,:section,:strictTime,:timeShift,:overlapMax,:xtra)"
|
VALUES(:id,:unix,:mediaID,:title,:duration,:startTime,:endTime,:dayOfWeek,:startTimeUnix,:section,:strictTime,:timeShift,:overlapMax,:xtra,:genres,:actors,:collections,:rating,:studio,:seasonEpisode)"
|
||||||
table.execute(sql,entryList)
|
table.execute(sql,entryList)
|
||||||
timediff = datetime.datetime.strptime("23:59:59", "%H:%M:%S") - datetime.datetime.strptime(entryList['startTime'], "%H:%M:%S")
|
timediff = datetime.datetime.strptime("23:59:59", "%H:%M:%S") - datetime.datetime.strptime(entryList['startTime'], "%H:%M:%S")
|
||||||
print("INFO: "+str(timediff.seconds)+" to midnight\033[K",end='\n')
|
print("INFO: "+str(timediff.seconds)+" to midnight\033[K",end='\n')
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -440,7 +440,7 @@ def ps_update():
|
|||||||
git.Repo.clone_from('https://github.com/FakeTV/pseudo-channel', '../temp', branch=ps_branch)
|
git.Repo.clone_from('https://github.com/FakeTV/pseudo-channel', '../temp', branch=ps_branch)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("ERROR GETTING DOWNLOADING FROM GIT")
|
print("ERROR GETTING DOWNLOADING FROM GIT")
|
||||||
print("e")
|
print(e)
|
||||||
mainFiles = glob.glob('../temp/main-dir/*')
|
mainFiles = glob.glob('../temp/main-dir/*')
|
||||||
bothFiles = glob.glob('../temp/both-dir/*')
|
bothFiles = glob.glob('../temp/both-dir/*')
|
||||||
srcFiles = glob.glob('../temp/both-dir/src/*')
|
srcFiles = glob.glob('../temp/both-dir/src/*')
|
||||||
|
|||||||
Reference in New Issue
Block a user