fix: use shared normaliseTitle in filterer

This commit is contained in:
Viren070
2025-11-23 19:53:24 +00:00
parent abd802cc74
commit 2e739bc277
+5 -9
View File
@@ -15,7 +15,11 @@ import { StreamSelector } from '../parser/streamExpression.js';
import StreamUtils from './utils.js'; import StreamUtils from './utils.js';
import { MetadataService } from '../metadata/service.js'; import { MetadataService } from '../metadata/service.js';
import { Metadata } from '../metadata/utils.js'; import { Metadata } from '../metadata/utils.js';
import { preprocessTitle, titleMatch } from '../parser/utils.js'; import {
normaliseTitle,
preprocessTitle,
titleMatch,
} from '../parser/utils.js';
import { partial_ratio } from 'fuzzball'; import { partial_ratio } from 'fuzzball';
import { calculateAbsoluteEpisode } from '../builtins/utils/general.js'; import { calculateAbsoluteEpisode } from '../builtins/utils/general.js';
import { formatBytes } from '../formatters/utils.js'; import { formatBytes } from '../formatters/utils.js';
@@ -372,14 +376,6 @@ class StreamFilterer {
} }
} }
const normaliseTitle = (title: string) => {
return title
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.replace(/[^\p{L}\p{N}+]/gu, '')
.toLowerCase();
};
const applyDigitalReleaseFilter = () => { const applyDigitalReleaseFilter = () => {
logger.debug(`Applying digital release filter for ${id}`, { logger.debug(`Applying digital release filter for ${id}`, {
releaseDate: requestedMetadata?.releaseDate, releaseDate: requestedMetadata?.releaseDate,