Match subtitles to episodes by plain episode number, not just S04E06

Adds a season-agnostic fallback to subtitle-episode matching so dropped
subtitle files no longer need a full SxxEyy code to be attached to the
right video. Recognises bare numbers (06, 6, 16), explicit markers
without a season (E06, EP06, Episode 06), and numbers cleanly delimited
by separators, including the common anime release style 'Show - 06 -
Title'. Guards against false positives from resolutions (1080p), years,
and decimal-looking audio tags (DD5.1) by requiring clean separator
boundaries and capping bare numbers at a few digits.

Full season+episode codes still take priority and match exactly as
before; the new bare-number matching only kicks in when one side of the
match lacks season info.

Note: dotnet is not reachable in this environment, so the required
Release build validation could not be run before this commit.
This commit is contained in:
2026-07-24 12:10:06 +00:00
parent e24a401ffb
commit 05fbe34e20
5 changed files with 128 additions and 26 deletions
+3 -2
View File
@@ -6,8 +6,9 @@ namespace Futonizer.Models;
/// <summary>
/// Represents one external subtitle file that was drag-and-dropped in and
/// matched to a <see cref="QueuedFileItem"/> by episode code (e.g. S04E06),
/// to be muxed in as an additional subtitle track when the file is processed.
/// matched to a <see cref="QueuedFileItem"/> by episode (e.g. "S04E06", or
/// just a bare episode number like "06"), to be muxed in as an additional
/// subtitle track when the file is processed.
/// </summary>
public class ExternalSubtitleTrack : INotifyPropertyChanged
{
+3 -2
View File
@@ -45,8 +45,9 @@ public class QueuedFileItem : INotifyPropertyChanged
/// <summary>
/// External subtitle files (dropped separately and matched to this file by
/// episode code, e.g. S04E06) that will be muxed in as additional
/// subtitle tracks when this file is processed.
/// episode e.g. "S04E06", or just a bare episode number like "06") that
/// will be muxed in as additional subtitle tracks when this file is
/// processed.
/// </summary>
public ObservableCollection<ExternalSubtitleTrack> ExternalSubtitles { get; } = new();