From 34851652c55298e4d8204f78735c15d154c4f4e0 Mon Sep 17 00:00:00 2001 From: blacktwin Date: Wed, 20 May 2020 23:46:53 -0400 Subject: [PATCH] sort most transcodes first --- utility/media_manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utility/media_manager.py b/utility/media_manager.py index 6d5a1c2..c6e030c 100644 --- a/utility/media_manager.py +++ b/utility/media_manager.py @@ -457,8 +457,9 @@ def transcode_work(sectionID, operator, value): elif not all([tt_history]): break start += count - - for rating_key, transcode_count in transcoding_count.items(): + + sorted_transcoding = sorted(transcoding_count.items(), key=lambda x: x[1], reverse=True) + for rating_key, transcode_count in sorted_transcoding: if operator(transcode_count, int(value)): _meta = tautulli_server.get_metadata(rating_key) if _meta: