mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
fix: replace umlaut characters with ASCII equivalents in cleanTitle (#481)
Update the cleanTitle() function in utils.ts to replace umlaut characters with their ASCII transliterations
This commit is contained in:
@@ -84,7 +84,11 @@ export function normaliseTitle(title: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function cleanTitle(title: string) {
|
export function cleanTitle(title: string) {
|
||||||
let cleaned = title.normalize('NFD');
|
const umlautMap: Record<string,string> = {
|
||||||
|
'Ä':'Ae','ä':'ae','Ö':'Oe','ö':'oe','Ü':'Ue','ü':'ue','ß':'ss'
|
||||||
|
};
|
||||||
|
// replace German umlauts with ASCII equivalents, then normalize to NFD
|
||||||
|
let cleaned = title.replace(/[ÄäÖöÜüß]/g, c => umlautMap[c]).normalize('NFD');
|
||||||
|
|
||||||
for (const char of ['♪', '♫', '★', '☆', '♡', '♥', '-']) {
|
for (const char of ['♪', '♫', '★', '☆', '♡', '♥', '-']) {
|
||||||
cleaned = cleaned.replaceAll(char, ' ');
|
cleaned = cleaned.replaceAll(char, ' ');
|
||||||
|
|||||||
Reference in New Issue
Block a user