Fixed the resource hogging issue. Also added custom daily update var to config.

This commit is contained in:
Justin Emter
2017-07-27 10:50:03 -07:00
parent 7d3028e6fa
commit 99e4b9838f
4 changed files with 97 additions and 22 deletions

View File

@@ -88,7 +88,7 @@ class PseudoChannelCommercial():
def get_commercials_to_place_between_media(self, last_ep, now_ep):
print last_ep.end_time, now_ep.start_time
#print last_ep.end_time, now_ep.start_time
prev_item_end_time = datetime.strptime(last_ep.end_time.strftime('%Y-%m-%d %H:%M:%S.%f'), '%Y-%m-%d %H:%M:%S.%f')
@@ -110,7 +110,7 @@ class PseudoChannelCommercial():
new_commercial_start_time = prev_item_end_time
print "here", time_diff.seconds
#print "here", time_diff.seconds
while curr_item_start_time > new_commercial_start_time and (count) < len(self.commercials)*100:

View File

@@ -10,7 +10,7 @@ class PseudoChannelDatabase():
self.db = db
self.conn = sqlite3.connect(self.db)
self.conn = sqlite3.connect(self.db, check_same_thread=False)
self.cursor = self.conn.cursor()
@@ -299,6 +299,8 @@ class PseudoChannelDatabase():
datalist = list(self.cursor.fetchall())
print "##### Getting Daily Schedule from DB."
return datalist
def get_movie(self, title):