From b92de9c4181d071d50a3aaf77957d0b8a1f03074 Mon Sep 17 00:00:00 2001 From: relikd Date: Fri, 9 Oct 2020 15:40:22 +0200 Subject: [PATCH] Fix empty ranking list after new contribution --- src/index_rank.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index_rank.py b/src/index_rank.py index f6eba41..0299ae9 100755 --- a/src/index_rank.py +++ b/src/index_rank.py @@ -94,6 +94,8 @@ def write_ranking_category_list(index, affected_ids): for _, json in mylib.enum_categories(): ids = [bid for bid, _ in json['apps']] ret = list(filter_by_list(index, ids, affected_ids)) + if len(ret) == 0: + continue cid = json['meta'][0] mylib.json_write(fname_rank_list('category', cid), ret, pretty=False) @@ -102,6 +104,8 @@ def write_ranking_custom_lists(index, affected_ids): make_rank_list_dir('custom', reset=affected_ids == ['*']) for list_id, json in mylib.enum_custom_lists(): ret = list(filter_by_list(index, json['apps'], affected_ids)) + if len(ret) == 0: + continue mylib.json_write(fname_rank_list('custom', list_id), ret, pretty=False)