fix: confusing when episode have multiple video files
@@ -29,7 +29,11 @@ def get_player(bangumi_name: str) -> Dict[int, Dict[str, str]]:
else:
episode = -1
- for bangumi in files:
+ sorted_files = sorted(
+ files, key=lambda f: os.path.getsize(os.path.join(root, f)), reverse=True
+ )
+
+ for bangumi in sorted_files:
if any(bangumi.lower().endswith(x) for x in [".mp4", ".mkv", ".webm"]):
video_file_path = os.path.join(base_path, bangumi)
video_file_path = os.path.join(
