diff --git a/libraries/database/broadcasts.py b/libraries/database/broadcasts.py index 7fcc5b3ecce4ec2eb880222e6b66f254a6c91468..736f472dea52b579261c865e20be17c105c39cba 100644 --- a/libraries/database/broadcasts.py +++ b/libraries/database/broadcasts.py @@ -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"): diff --git a/modules/communication/liquidsoap/communicator.py b/modules/communication/liquidsoap/communicator.py index d5a37a9f66cfc19971d3340b39331191d91cad35..33869e4f6e19526a4a2fd852e502f7d921c62456 100644 --- a/modules/communication/liquidsoap/communicator.py +++ b/modules/communication/liquidsoap/communicator.py @@ -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 diff --git a/modules/communication/redis/adapter.py b/modules/communication/redis/adapter.py index ad97f8d8f47b1ed59a348308e51467cad4d990f9..f095dced939bd1a272a8de3e0ea12c9bc6f122e3 100644 --- a/modules/communication/redis/adapter.py +++ b/modules/communication/redis/adapter.py @@ -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")) diff --git a/modules/communication/redis/messenger.py b/modules/communication/redis/messenger.py index be3bf587daec2b678cea8c42600bb34d96f531f2..d489205dff6909a4cd841e285f16d2afe3be6f3b 100644 --- a/modules/communication/redis/messenger.py +++ b/modules/communication/redis/messenger.py @@ -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