diff --git a/guru.py b/guru.py index e60ca20cdcfdb8c1d7d4772a8344e6ba1b70c0f7..79f38d9d1f2d83290b02727fb74c347219d8113c 100755 --- a/guru.py +++ b/guru.py @@ -123,7 +123,6 @@ class Guru(AuraConfig): 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("-spe", "--swap-playlist-entries", action="store", dest="swap_playlist_entries", default=0, metavar=("FROM", "TO"), nargs=2, help="Swaps the sources of two Playlistentries") 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) diff --git a/modules/cli_tool/padavan.py b/modules/cli_tool/padavan.py index 54e1341908977e28385ed47ff75e3f7e9f9a7dab..6154b7952b8d75bdbc4a7ea78eef07435f7169b6 100644 --- a/modules/cli_tool/padavan.py +++ b/modules/cli_tool/padavan.py @@ -76,9 +76,6 @@ class Padavan: elif self.args.set_volume: self.set_volume(self.args.set_volume[0], self.args.set_volume[1]) - elif self.args.swap_playlist_entries: - self.swap_playlist_entries(self.args.swap_playlist_entries[0], self.args.swap_playlist_entries[1]) - elif self.args.delete_playlist_entry: self.delete_playlist_entry(self.args.delete_playlist_entry[0]) @@ -227,12 +224,6 @@ class Padavan: self.send_redis(channel, message) self.stringreply = "Message '"+message+"' sent to channel '"+channel+"'" - # ------------------------------------------------------------------------------------------ # - def swap_playlist_entries(self, from_index, to_index): - json_reply = self.send_and_wait_redis("aura", "swap_playlist_entries " + str(from_index) + " " + str(to_index), RedisChannel.MPE_REPLY) - actprogramme = simplejson.loads(json_reply) - self.print_programme(actprogramme) - # ------------------------------------------------------------------------------------------ # def delete_playlist_entry(self, index): json_reply = self.send_and_wait_redis("aura", "delete_playlist_entry " + str(index), RedisChannel.DPE_REPLY) diff --git a/modules/communication/redis/adapter.py b/modules/communication/redis/adapter.py index 9945e99547c44d45063b3fd45776a72e2e165f7f..3f9da422ff5b28495a05a471dc9c69340513f7cf 100644 --- a/modules/communication/redis/adapter.py +++ b/modules/communication/redis/adapter.py @@ -162,11 +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("swap_playlist_entries") >= 0: - extracted = item["data"].split()[1:3] - param = {"from_index": extracted[0], "to_index": extracted[1]} - self.execute(RedisChannel.MPE_REPLY.value, self.scheduler.swap_playlist_entries, param) - elif item["data"].find("delete_playlist_entry") >= 0: entrynum = item["data"].split()[1] self.logger.info("entry to del: " + str(entrynum)) diff --git a/modules/scheduling/scheduler.py b/modules/scheduling/scheduler.py index d88ed536e0c4ff3823a84b597809498a68f554cd..6d808df785c0bfa275eb7f0698abc726af5a1a07 100644 --- a/modules/scheduling/scheduler.py +++ b/modules/scheduling/scheduler.py @@ -337,41 +337,6 @@ class AuraScheduler(ExceptionLogger, threading.Thread): return message_queue - # ------------------------------------------------------------------------------------------ # - def swap_playlist_entries(self, indexes): - from_entry = None - to_entry = None - from_idx = indexes["from_index"] - to_idx = indexes["to_index"] - - # find the entries - for p in self.programme: - if p.programme_index == int(from_idx): - from_entry = p - - if p.programme_index == int(to_idx): - to_entry = p - - # break out of loop, if both entries found - if from_entry is not None and to_entry is not None: - break - - # check if entries are found - if from_entry is None or to_entry is None: - return "From or To Entry not found!" - - # swap sources - swap = from_entry.source - from_entry.source = to_entry.source - to_entry.source = swap - - # store to database - from_entry.store(add=False, commit=False) - to_entry.store(add=False, commit=True) - - # and return the programme with swapped entries - return self.get_act_programme_as_string() - # ------------------------------------------------------------------------------------------ # def delete_playlist_entry(self, index): found = False