1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Screen size / resolution patterns.
#
# ARCHITECTURE NOTE (v0.2):
# Most resolution patterns are handled here using exact lookups and
# capture-group templates ({N} syntax) for WxH and fps-suffixed tokens.
# The legacy screen_size.rs matcher is kept only for:
# - Bare resolution before Hi10p profile ([720.Hi10p] → "720p")
# This requires context from the *next* token, which TOML rules
# cannot express yet.
= "screen_size"
# ── Single-token exact matches (case-insensitive) ─────────────────────────
[]
# Progressive scan
= "240p"
= "360p"
= "368p"
= "480p"
= "540p"
= "576p"
= "720p"
= "900p"
= "1080p"
= "1440p"
= "2160p"
= "4320p"
# Interlaced scan
= "480i"
= "576i"
= "720i"
= "1080i"
# Shorthand aliases
= "4320p"
= "2160p"
= "1080p"
= "1440p"
= "1080p"
# HD suffix (e.g., 720hd, 720phd)
= "720p"
= "1080p"
= "720p"
= "1080p"
# ── Regex patterns (still fixed-value — no capture groups) ──────────────────
[[]]
# 4K — skip when followed by edition qualifiers ("4K Restored", "4K Remastered")
= '(?i)^4k$'
= "2160p"
= ["restored", "remastered", "restoration"]
[[]]
# 4K UHD / 4K.UHD (2-token window: "4K" + "UHD")
= '(?i)^4k[-. ]?uhd$'
= "2160p"
[[]]
# UHD 4K (2-token)
= '(?i)^uhd[-. ]?4k$'
= "2160p"
# NOTE: Frame-rate-suffixed variants (720p60, 1080p25) and WxH dimensions
# (1920x1080) now use capture-group value templates ({N} syntax).
[[]]
# Frame-rate suffixed: 720p60, 1080p25, 2160p50 → strip the fps part.
= '(?i)^(\d{3,4})[pi](\d{2,3})$'
= "{1}p"
[[]]
# WxH dimensions: 1920x1080, 1280*720 → use the height + "p".
= '(?i)^\d{3,4}[x*](\d{3,4})$'
= "{1}p"
[[]]
# Bare resolution before Hi10p profile: [720.Hi10p] → 720p
= '(?i)^(720|1080|480|2160)$'
= "{1}p"
= ["hi10p", "hi8p", "hip", "hi10"]