We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b0063b commit 7e1666cCopy full SHA for 7e1666c
backend/src/module/utils/multi_version_filter.py
@@ -1,5 +1,7 @@
1
from collections import defaultdict
2
3
+from loguru import logger
4
+
5
from module.models.torrent import Torrent, TorrentInfo
6
from module.parser.analyser import torrent_name_parser
7
@@ -11,7 +13,14 @@ def filter_multi_version_torrents(torrents: list[Torrent]):
11
13
12
14
for torrent in torrents:
15
info = torrent_name_parser(torrent.name)
- key = f"{info.title}+{info.episode}"
16
+ if info is None:
17
+ logger.warning(
18
+ f"Failed to parse torrent name for torrent '{torrent}'. "
19
+ f"Fallback to using torrent.name: '{torrent.name}'."
20
+ )
21
+ key = torrent.name
22
+ else:
23
+ key = f"{info.title}+{info.episode}"
24
grouped_torrents[key].append((torrent, info))
25
26
for torrents_group in grouped_torrents.values():
0 commit comments