summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/indexer/title_parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/indexer/title_parse.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/indexer/title_parse.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/indexer/title_parse.py b/packages/meshbay-node/src/meshbay_node/indexer/title_parse.py
index 24b423e..24c23bc 100644
--- a/packages/meshbay-node/src/meshbay_node/indexer/title_parse.py
+++ b/packages/meshbay-node/src/meshbay_node/indexer/title_parse.py
@@ -146,6 +146,16 @@ def parse_movie_filename(filename: str) -> ParsedName:
title = str(title).strip() if title else None
if title:
title = _strip_editions(title)
+ # guessit peels a "Volume 2"/"Part 2" token off the title into its
+ # own field, so both parts of a two-part film parse to the same bare
+ # title. That collapsed the two on one TMDB search (the more popular
+ # first part won for both), and — since "Fix match" groups every
+ # entry sharing a display_title — left no way to correct one without
+ # the other. Fold the number back on so the two stay distinct in the
+ # query, the card and the override.
+ part = g.get("part") or g.get("volume")
+ if isinstance(part, int) and not isinstance(part, bool):
+ title = f"{title} {part}"
alt = g.get("alternative_title")
alt = _strip_editions(str(alt).strip()) if alt else None
year = g.get("year")