Skip to content

Commit

Permalink
remove toLowerCase statements
Browse files Browse the repository at this point in the history
  • Loading branch information
vixalien committed Apr 20, 2023
1 parent 9b2ac73 commit febb28e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mixins/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
Expand Down
2 changes: 1 addition & 1 deletion parsers/browsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion parsers/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
};
Expand Down
3 changes: 2 additions & 1 deletion parsers/songs.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit febb28e

Please sign in to comment.