Added random movie logic but commenting it out for now.

This commit is contained in:
Justin Emter
2017-11-30 13:03:39 -08:00
parent 00ed0eb205
commit 0ee6922b39
3 changed files with 130 additions and 12 deletions

View File

@@ -29,6 +29,7 @@ from src import Music
from src import Video
from src import PseudoDailyScheduleController
from src import PseudoChannelCommercial
from src import PseudoChannelRandomMovie
import pseudo_config as config
reload(sys)
@@ -62,6 +63,9 @@ class PseudoChannel():
self.CONTROLLER_SERVER_PORT,
self.DEBUG
)
self.movieMagic = PseudoChannelRandomMovie()
"""Database functions.
update_db(): Grab the media from the Plex DB and store it in the local pseudo-channel.db.
drop_db(): Drop the local database. Fresh start.
@@ -423,11 +427,30 @@ class PseudoChannel():
d[key] = val.split(',')
for movie in movies.search(None, **d):
movies_list.append(movie)
"""the_movie = self.db.get_movie(self.movieMagic.get_random_movie_xtra(
self.db.get_movies(),# Movies DB
movies_list # XTRA List
)
)"""
"""Updating movies table in the db with lastPlayedDate entry"""
self.db.update_movies_table_with_last_played_date(the_movie[3])
the_movie = self.db.get_movie(random.choice(movies_list).title)
except:
print("For some reason, I've failed getting movie with xtra args.")
the_movie = self.db.get_random_movie()
else:
"""the_movie = self.db.get_movie(self.movieMagic.get_random_movie(
self.db.get_movies(),# Movies DB
)
)"""
"""Updating movies table in the db with lastPlayedDate entry"""
self.db.update_movies_table_with_last_played_date(the_movie[3])
the_movie = self.db.get_random_movie()
else:
the_movie = self.db.get_movie(entry[3])