1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-23 00:03:33 +00:00
bazarr/custom_libs/subzero/score_range.py

25 lines
916 B
Python
Raw Normal View History

2018-10-31 16:08:29 +00:00
# coding=utf-8
2019-09-17 02:04:27 +00:00
from __future__ import absolute_import
from __future__ import print_function
2018-10-31 16:08:29 +00:00
import sys
from itertools import chain, combinations, permutations
from subliminal.video import Episode
def permute(x):
return [base_score + i + j for i in x for j in x]
if __name__ == "__main__":
scores = Episode.scores
base_score_keys = ["series", "season", "episode"]
leftover_keys = list(set(scores.keys()) - set(base_score_keys))
base_score = sum([val for key, val in scores.items() if key in base_score_keys])
leftover_scores = set([score for key, score in scores.items() if key in leftover_keys])
2019-09-17 02:04:27 +00:00
print("base score:", base_score)
print("leftover:", sorted(set(leftover_scores)))
2018-10-31 16:08:29 +00:00
# print sum_possible_scores(base_score, leftover_scores)
# print list(permutations(leftover_scores))
2019-09-17 02:04:27 +00:00
print(",\n".join(['"%s"' % x for x in ["66"] + sorted(set(permute(leftover_scores)))]))