Skip to content
Snippets Groups Projects
Commit b6c599f4 authored by David Trattnig's avatar David Trattnig
Browse files

Removed unused code and added comments.

parent cd9f90f0
No related branches found
No related tags found
No related merge requests found
......@@ -251,6 +251,7 @@ class Playlist(DB.Model, AuraDatabaseModel):
@staticmethod
def select_playlist(playlist_id):
# TODO Returns multiple playlists - Hence, order playlists also by "latest version". Maybe cleanup others before?
return DB.session.query(Playlist).filter(Playlist.playlist_id == playlist_id).order_by(Playlist.schedule_start).all()
@hybrid_property
......@@ -288,7 +289,7 @@ class PlaylistEntry(DB.Model, AuraDatabaseModel):
@hybrid_property
def volume(self):
return 100
@hybrid_property
def type(self):
if self.uri.startswith("http"):
......
......@@ -169,7 +169,7 @@ class LiquidSoapCommunicator(ExceptionLogger):
self.enable_transaction()
self.__send_lqc_command__(self.client, "http", cmd)
self.disable_transaction()
except LQConnectionError as e:
except LQConnectionError:
# we already caught and handled this error in __send_lqc_command__, but we do not want to execute this function further
pass
......@@ -290,8 +290,9 @@ class LiquidSoapCommunicator(ExceptionLogger):
# grab the actual active entry
(show, old_entry) = self.scheduler.get_active_entry()
# determine its type
# FIXME Move to <get_active_entry>
old_type = ScheduleEntryType.FILESYSTEM
# TODO Move to <get_active_entry>
# FIXME No need to switch if current type = new type
old_type = ScheduleEntryType.FILESYSTEM # Set default if no previous track is available
if old_entry:
old_type = old_entry.type
......@@ -312,7 +313,7 @@ class LiquidSoapCommunicator(ExceptionLogger):
# insert playlist entry
self.logger.critical("Trackservice entry not written here anymore")
# self.insert_track_service_entry(new_entry)
except LQConnectionError as e:
except LQConnectionError:
# we already caught and handled this error in __send_lqc_command__, but we do not want to execute this function further and pass the exception
pass
......
......@@ -49,7 +49,8 @@ class ServerRedisAdapter(threading.Thread, RedisMessenger):
redisclient = None
# connection_tester = None
liquidsoapcommunicator = None
socket = None
# ------------------------------------------------------------------------------------------ #
def __init__(self, config):
threading.Thread.__init__(self)
......@@ -67,7 +68,7 @@ class ServerRedisAdapter(threading.Thread, RedisMessenger):
self.components = {'controller':'01', 'scheduling':'02', 'playd':'03', 'recorder':'04', 'helpers':'09'}
self.fromMail = ''
self.adminMails = ''
self.can_send = None
self.redisclient = ClientRedisAdapter(config)
# self.connection_tester = ConnectionTester()
......@@ -237,6 +238,8 @@ class ServerRedisAdapter(threading.Thread, RedisMessenger):
Send a message to the client
:param message: string
"""
# FIXME Review logic
if not self.can_send:
self.logger.info("sending a "+str(len(message))+" long message via REDIS.")
self.socket.send(message.encode("utf-8"))
......
......@@ -264,9 +264,10 @@ class RedisMessenger():
@param state: Der State
@return result
"""
# FIXME Make Mailer functional: Invalid constructor
if self.fromMail and self.adminMails:
subject = "Possible comba problem on job " + state['job'] + " - " + level
#subject = "Possible comba problem on job " + state['job'] + " - " + level
mailmessage = "Hi Admin,\n comba reports a possible problem\n\n"
mailmessage = mailmessage + level + "!\n"
mailmessage = mailmessage + message + "\n\n"
......@@ -275,8 +276,9 @@ class RedisMessenger():
mailmessage = mailmessage + "Job:\t" + state['job'] + "\n"
mailmessage = mailmessage + "Code:\t" + state['code'] + "\n"
mailmessage = mailmessage + "Value:\t" + str(state['value']) + "\n"
mailer = AuraMailer(self.adminMails, self.fromMail)
mailer.send_admin_mail(subject, mailmessage)
#mailer = AuraMailer(self.adminMails, self.fromMail)
#mailer.send_admin_mail(subject, mailmessage)
else:
return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment