Skip to content
Snippets Groups Projects
Commit c5448469 authored by Gottfried Gaisbauer's avatar Gottfried Gaisbauer
Browse files

removed delete/insert playlist. its also not necessary at engine level

parent 4d736ff4
No related branches found
No related tags found
No related merge requests found
......@@ -122,10 +122,6 @@ class Guru(AuraConfig):
self.parser.add_argument("-fnp", "--fetch-new-programmes", action="store_true", dest="fetch_new_programme", default=False, help="Fetch new programmes from calendarurl in comba.ini")
self.parser.add_argument("-pmq", "--print-message-queue", action="store_true", dest="print_message_queue", default=False, help="Prints message queue")
# playlist manipulation
self.parser.add_argument("-dpe", "--delete-playlist-entry", action="store", dest="delete_playlist_entry", default=0, metavar="INDEX", nargs=1, help="Delete Playlistentry at INDEX")
self.parser.add_argument("-ipe", "--insert-playlist-entry", action="store", dest="insert_playlist_entry", default=0, metavar=("FROMTIME", "SOURCE"), nargs=2, help="Add a new Playlistentry at a given index. Set fromtime with this format: 2017-12-31T13:30:00") # , type=valid_playlist_entry)
# send a redis message
self.parser.add_argument("-rm", "--redis-message", action="store", dest="redis_message", default=False, metavar=("CHANNEL", "MESSAGE"), nargs=2, help="Send a redis message to the Listeners")
......
......@@ -224,18 +224,6 @@ class Padavan:
self.send_redis(channel, message)
self.stringreply = "Message '"+message+"' sent to channel '"+channel+"'"
# ------------------------------------------------------------------------------------------ #
def delete_playlist_entry(self, index):
json_reply = self.send_and_wait_redis("aura", "delete_playlist_entry " + str(index), RedisChannel.DPE_REPLY)
actprogramme = simplejson.loads(json_reply)
self.print_programme(actprogramme)
# ------------------------------------------------------------------------------------------ #
def insert_playlist_entry(self, fromtime, source):
json_reply = self.send_and_wait_redis("aura", "insert_playlist_entry " + fromtime + " " + source, RedisChannel.IPE_REPLY)
actprogramme = simplejson.loads(json_reply)
self.print_programme(actprogramme)
# ------------------------------------------------------------------------------------------ #
def print_message_queue(self):
self.stringreply = self.send_and_wait_redis("aura", "print_message_queue", RedisChannel.PMQ_REPLY)
......
......@@ -162,16 +162,6 @@ class ServerRedisAdapter(threading.Thread, RedisMessenger):
elif item["data"] == "print_message_queue":
self.execute(RedisChannel.PMQ_REPLY.value, self.scheduler.print_message_queue)
elif item["data"].find("delete_playlist_entry") >= 0:
entrynum = item["data"].split()[1]
self.logger.info("entry to del: " + str(entrynum))
self.execute(RedisChannel.DPE_REPLY.value, self.scheduler.delete_playlist_entry, entrynum)
elif item["data"].find("insert_playlist_entry") >= 0:
extracted = item["data"].split()[1:3]
param = {"fromtime": extracted[0], "source": extracted[1]}
self.execute(RedisChannel.IPE_REPLY.value, self.scheduler.insert_playlist_entry, param)
elif item["data"].find("set_next_file") >= 0:
playlist = item["data"].split()[1]
playlist = playlist[0:len(playlist)-8]
......
......@@ -337,39 +337,6 @@ class AuraScheduler(ExceptionLogger, threading.Thread):
return message_queue
# ------------------------------------------------------------------------------------------ #
def delete_playlist_entry(self, index):
found = False
for p in self.programme:
if p.programme_index == int(index):
p.delete(True)
self.load_programme_from_db()
found = True
break
if not found:
self.logger.warning("Nothing to delete")
return self.get_act_programme_as_string()
# ------------------------------------------------------------------------------------------ #
def insert_playlist_entry(self, fromtime_source):
fromtime = fromtime_source["fromtime"]
source = fromtime_source["source"]
entry = ScheduleEntry()
entry.entry_start = fromtime
entry.source = source
entry.playlist_id = 0
entry.schedule_id = 0
entry.entry_num = ScheduleEntry.select_next_manual_entry_num()
entry.store(add=True, commit=True)
self.load_programme_from_db()
return self.get_act_programme_as_string()
# ------------------------------------------------------------------------------------------ #
def fetch_new_programme(self):
self.logger.info("trying to fetch new programme")
......
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