Enhance GridPlanner with SlotFactory for improved slot composition and management
Refactored the GridPlanner class to introduce a SlotFactory for better organization and clarity in slot composition. Added detailed summaries for methods to improve code documentation and understanding. Enhanced the logic for handling content and repeat slots, ensuring more efficient management of grid slots during generation. These changes contribute to improved readability and maintainability of the code.
This commit is contained in:
@@ -77,15 +77,17 @@ export function parseEpisodeName(name: string, opts?: ParseOptions): ParsedEpiso
|
||||
// и движок перебирает варианты впустую (у Sonar это «super-linear backtracking»).
|
||||
const SEASON_RANGES = [
|
||||
/(?:s|season|сезоны?)[\s._-]*\d{1,2}[\s._]*[-–][\s._]*(?:s|season)?\d{1,2}/i,
|
||||
/\d{1,2}[\s._]*[-–][\s._]*\d{1,2}[\s._-]*сезон/i,
|
||||
/\d{1,2}[\s._]*[-–][\s._]*\d{1,2}[\s._-]*(?:season|сезон)/i,
|
||||
]
|
||||
|
||||
/** Сезон в имени одного сегмента пути: «S02», «Season 2», «Сезон 2», «2 сезон». */
|
||||
/** Сезон в имени одного сегмента пути: «S02», «Season 2», «Сезон 2», «2 сезон», «3 Season». */
|
||||
const SEASON_PATTERNS = [
|
||||
// S02 — не часть более длинного числа (год «S2007» сезоном не считаем).
|
||||
/(?:^|[^a-z0-9])s[\s._-]*(\d{1,2})(?!\d)/i,
|
||||
/(?:season|сезон)[\s._-]*(\d{1,2})(?!\d)/i,
|
||||
/(\d{1,2})[\s._-]*сезон/i,
|
||||
// Номер перед словом — «3 Season», «2 сезон». Ограничение слева не даёт принять за сезон
|
||||
// хвост года: в «2007 Season» это не третий сезон, а сезон 2007 года.
|
||||
/(?:^|[^\d])(\d{1,2})[\s._-]*(?:season|сезон)/i,
|
||||
]
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user