From febb28e016c29e4eeab4a0b2b71156d56fa9f7b8 Mon Sep 17 00:00:00 2001 From: Angelo Verlain Date: Thu, 20 Apr 2023 14:21:17 +0200 Subject: [PATCH] remove toLowerCase statements --- mixins/search.ts | 2 +- parsers/browsing.ts | 2 +- parsers/search.ts | 2 +- parsers/songs.ts | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mixins/search.ts b/mixins/search.ts index 39f7396..36b1510 100644 --- a/mixins/search.ts +++ b/mixins/search.ts @@ -304,7 +304,7 @@ export async function search( if (category_search_results.length > 0) { search_results.categories.push({ - title: category?.toLowerCase() ?? null, + title: category ?? null, results: category_search_results, }); } diff --git a/parsers/browsing.ts b/parsers/browsing.ts index e0c78ac..0c1f716 100644 --- a/parsers/browsing.ts +++ b/parsers/browsing.ts @@ -686,7 +686,7 @@ export interface ParsedPlaylist { export function parse_playlist(data: any) { const subtitles = j(data, "subtitle.runs"); - const has_data = subtitles[0]?.text.toLowerCase() === _("playlist"); + const has_data = subtitles[0]?.text === _("playlist"); const has_songs = subtitles.length > 3; const playlist: ParsedPlaylist = { diff --git a/parsers/search.ts b/parsers/search.ts index 94b8b5a..39d947c 100644 --- a/parsers/search.ts +++ b/parsers/search.ts @@ -157,7 +157,7 @@ export function parse_search_album(result: any): SearchAlbum { browseId: j(result, NAVIGATION_BROWSE_ID), isExplicit: jo(result, BADGE_LABEL) != null, thumbnails: j(result, THUMBNAILS), - album_type: runs[0].text.toLowerCase(), + album_type: runs[0].text, year: runs[runs.length - 1].text, artists: parse_song_artists_runs(runs.slice(2, -1)), }; diff --git a/parsers/songs.ts b/parsers/songs.ts index cbaef19..59eb18b 100644 --- a/parsers/songs.ts +++ b/parsers/songs.ts @@ -1,5 +1,6 @@ import { FEEDBACK_TOKEN, NAVIGATION_BROWSE_ID, TOGGLE_MENU } from "../nav.ts"; import { jo } from "../util.ts"; +import { _ } from "./browsing.ts"; import type { AudioFormat, BaseFormat, VideoFormat } from "./types.d.ts"; import { get_browse_id, @@ -102,7 +103,7 @@ export function parse_song_runs(runs: any[], slice_start = 0) { parsed.duration_seconds = parse_duration(text); } else if (text.match(/^\d{4}$/)) { parsed.year = text; - } else if (text.toLowerCase() != "song") { + } else if (text != _("song")) { // artist without id parsed.artists.push({ name: text,