mirror of
https://github.com/FakeTV/pseudo-channel.git
synced 2025-12-19 01:33:33 +00:00
Added another config flag for debug mode. If set to false then commercials are not included in the html / xml. Will soon effect other input.
This commit is contained in:
@@ -23,8 +23,6 @@ import textwrap
|
||||
from xml.dom import minidom
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
import sched
|
||||
|
||||
from threading import Timer
|
||||
import signal
|
||||
|
||||
@@ -40,6 +38,7 @@ class PseudoChannel():
|
||||
PLEX = PlexServer(config.baseurl, config.token)
|
||||
MEDIA = []
|
||||
GKEY = config.gkey
|
||||
|
||||
USING_GOOGLE_CALENDAR = config.useGoogleCalendar
|
||||
|
||||
USING_COMMERCIAL_INJECTION = config.useCommercialInjection
|
||||
@@ -48,11 +47,18 @@ class PseudoChannel():
|
||||
|
||||
APP_TIME_FORMAT_STR = '%I:%M:%S %p'
|
||||
|
||||
DEBUG = config.debug_mode
|
||||
|
||||
def __init__(self):
|
||||
|
||||
self.db = PseudoChannelDatabase("pseudo-channel.db")
|
||||
|
||||
self.controller = PseudoDailyScheduleController(config.baseurl, config.token, config.plexClients)
|
||||
self.controller = PseudoDailyScheduleController(
|
||||
config.baseurl,
|
||||
config.token,
|
||||
config.plexClients,
|
||||
self.DEBUG
|
||||
)
|
||||
|
||||
"""Database functions.
|
||||
|
||||
@@ -1035,15 +1041,14 @@ if __name__ == '__main__':
|
||||
|
||||
"""
|
||||
|
||||
s = sched.scheduler(time, sleep)
|
||||
|
||||
the_daily_schedule = pseudo_channel.db.get_daily_schedule()
|
||||
|
||||
daily_update_time = datetime.datetime.strptime(
|
||||
pseudo_channel.translate_time(
|
||||
pseudo_channel.DAILY_UPDATE_TIME
|
||||
),
|
||||
pseudo_channel.APP_TIME_FORMAT_STR
|
||||
)
|
||||
, pseudo_channel.APP_TIME_FORMAT_STR)
|
||||
|
||||
try:
|
||||
|
||||
|
||||
@@ -63,3 +63,5 @@ useGoogleCalendar = True
|
||||
useCommercialInjection = True
|
||||
|
||||
dailyUpdateTime = "12:00 AM"
|
||||
|
||||
debug_mode = False
|
||||
|
||||
@@ -13,7 +13,7 @@ import logging.handlers
|
||||
|
||||
class PseudoDailyScheduleController():
|
||||
|
||||
def __init__(self, server, token, clients):
|
||||
def __init__(self, server, token, clients, debugMode = False):
|
||||
|
||||
self.PLEX = PlexServer(server, token)
|
||||
|
||||
@@ -23,6 +23,8 @@ class PseudoDailyScheduleController():
|
||||
|
||||
self.PLEX_CLIENTS = clients
|
||||
|
||||
self.DEBUG = debugMode
|
||||
|
||||
self.my_logger = logging.getLogger('MyLogger')
|
||||
self.my_logger.setLevel(logging.DEBUG)
|
||||
|
||||
@@ -73,6 +75,10 @@ class PseudoDailyScheduleController():
|
||||
|
||||
for row in datalist:
|
||||
|
||||
if str(row[11]) == "Commercials" and self.DEBUG == False:
|
||||
|
||||
continue
|
||||
|
||||
timeB = datetime.strptime(row[8], '%I:%M:%S %p')
|
||||
|
||||
if currentTime == None:
|
||||
@@ -184,6 +190,10 @@ class PseudoDailyScheduleController():
|
||||
|
||||
for row in datalist:
|
||||
|
||||
if str(row[11]) == "Commercials" and self.DEBUG == False:
|
||||
|
||||
continue
|
||||
|
||||
numberIncrease += 1
|
||||
|
||||
with tag('tbody'):
|
||||
|
||||
Reference in New Issue
Block a user