Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion guessit/rules/properties/episode_title.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')

Expand All @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions guessit/test/episodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 19 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{pkgs ? import <nixpkgs> {}}: let
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file allows nix users to automatically have all dependencies in a devshell. If you don't want this included in the repository just ping me and I'll remove it/gitignore it.

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
];
}