From 12baaaa55f27ab924e82d7a94ca8bfdede4d3221 Mon Sep 17 00:00:00 2001 From: SamidyFR <168582143+SamidyFR@users.noreply.github.com> Date: Wed, 11 Mar 2026 05:23:57 +0000 Subject: [PATCH] style: auto-fix linting issues --- js/api.js | 10 +++++----- js/player.js | 7 +++---- js/ui.js | 10 +++++----- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/js/api.js b/js/api.js index 201bcff..fd56dc2 100644 --- a/js/api.js +++ b/js/api.js @@ -1106,12 +1106,12 @@ export class LosslessAPI { const artistData = await this.getArtist(artist.id, { lightweight: true, skipCache: options.refresh }); if (artistData && artistData.tracks && artistData.tracks.length > 0) { const availableTracks = artistData.tracks.filter((track) => !seenTrackIds.has(track.id)); - - const newTracks = options.knownTrackIds - ? availableTracks.filter(t => !options.knownTrackIds.has(t.id)) + + const newTracks = options.knownTrackIds + ? availableTracks.filter((t) => !options.knownTrackIds.has(t.id)) : availableTracks; - const knownTracks = options.knownTrackIds - ? availableTracks.filter(t => options.knownTrackIds.has(t.id)) + const knownTracks = options.knownTrackIds + ? availableTracks.filter((t) => options.knownTrackIds.has(t.id)) : []; const shuffledNew = [...newTracks].sort(() => Math.random() - 0.5); diff --git a/js/player.js b/js/player.js index 2cc977d..040a34a 100644 --- a/js/player.js +++ b/js/player.js @@ -1024,9 +1024,8 @@ export class Player { } const shuffledSeeds = [...this.radioSeeds].sort(() => 0.5 - Math.random()); - const seeds = shuffledSeeds.length > 0 - ? shuffledSeeds.slice(0, 5) - : this.currentTrack ? [this.currentTrack] : []; + const seeds = + shuffledSeeds.length > 0 ? shuffledSeeds.slice(0, 5) : this.currentTrack ? [this.currentTrack] : []; if (seeds.length === 0) { return; @@ -1045,7 +1044,7 @@ export class Player { ]); const recommendations = await this.api.getRecommendedTracksForPlaylist(seeds, 20, { - knownTrackIds: knownTrackIds + knownTrackIds: knownTrackIds, }); if (recommendations && recommendations.length > 0) { diff --git a/js/ui.js b/js/ui.js index 6f90acb..dbf3225 100644 --- a/js/ui.js +++ b/js/ui.js @@ -2188,21 +2188,21 @@ export class UIRenderer { try { const seeds = providedSeeds || (await this.getSeeds()); - + const [favorites, playlists, history] = await Promise.all([ db.getFavorites('track'), db.getPlaylists(true), db.getHistory(), ]); const knownTrackIds = new Set([ - ...favorites.map(t => t.id), - ...playlists.flatMap(p => (p.tracks || []).map(t => t.id)), - ...history.map(t => t.id) + ...favorites.map((t) => t.id), + ...playlists.flatMap((p) => (p.tracks || []).map((t) => t.id)), + ...history.map((t) => t.id), ]); const recommendedTracks = await this.api.getRecommendedTracksForPlaylist(seeds, 20, { skipCache: forceRefresh, - knownTrackIds: knownTrackIds + knownTrackIds: knownTrackIds, }); const filteredTracks = await this.filterUserContent(recommendedTracks, 'track');