From d3b06fac45c023cebe5723bd54ddeaa77bf4a331 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 30 May 2024 17:04:01 +0200 Subject: [PATCH 1/2] Add shell.nix for nix users --- shell.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..034cb515 --- /dev/null +++ b/shell.nix @@ -0,0 +1,19 @@ +{pkgs ? import {}}: let + python = pkgs.python312.withPackages (ps: + with ps; [ + rebulk + babelfish + python-dateutil + pytest + pytest-mock + pytest-benchmark + pytest-cov + pylint + pyyaml + ]); +in + pkgs.mkShell { + packages = [ + python + ]; + } From 78deaba42fd5deec0b1aed49bc888e22d9aacbd3 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 30 May 2024 17:04:13 +0200 Subject: [PATCH 2/2] Enable Filepart2EpisodeTitle rule with absolute episodes --- guessit/rules/properties/episode_title.py | 6 +++++- guessit/test/episodes.yml | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/guessit/rules/properties/episode_title.py b/guessit/rules/properties/episode_title.py index 2c4fab66..2dc05f94 100644 --- a/guessit/rules/properties/episode_title.py +++ b/guessit/rules/properties/episode_title.py @@ -6,6 +6,7 @@ from collections import defaultdict from rebulk import Rebulk, Rule, AppendMatch, RemoveMatch, RenameMatch, POST_PROCESS +from rebulk.rebulk import Matches from ..common import seps, title_seps from ..common.formatters import cleanup @@ -272,6 +273,9 @@ class Filepart2EpisodeTitle(Rule): If BBBB contains season and episode and AAA contains a hole then title is to be found in AAAA. + + If BBBB contais the episode and no season is found (absolute numbering) + then title is to be found in AAAA. """ consequence = AppendMatch('title') @@ -290,7 +294,7 @@ def when(self, matches, context): # pylint:disable=inconsistent-return-statemen if episode_number: season = (matches.range(directory.start, directory.end, lambda match: match.name == 'season', 0) or matches.range(filename.start, filename.end, lambda match: match.name == 'season', 0)) - if season: + if season or not matches.named("season"): hole = matches.holes(directory.start, directory.end, ignore=or_(lambda match: 'weak-episode' in match.tags, TitleBaseRule.is_ignored), formatter=cleanup, seps=title_seps, diff --git a/guessit/test/episodes.yml b/guessit/test/episodes.yml index 7de7da15..1c2301cc 100644 --- a/guessit/test/episodes.yml +++ b/guessit/test/episodes.yml @@ -4770,3 +4770,10 @@ video_codec: H.264 release_group: NOGRP type: episode + +? video/zettai karen children/01 - Absolutely Lovely! Their Name Is The Children.mkv +: title: "zettai karen children" + episode: 1 + episode_title: "Absolutely Lovely! Their Name Is The Children" + container: mkv + type: episode