fix linting errors/warnings

This commit is contained in:
BlackSigkill 2026-02-20 15:48:23 +01:00
parent b7e6572743
commit bddf5a0d73
9 changed files with 16 additions and 54 deletions

View file

@ -919,7 +919,7 @@
>
<img
id="status-preview-img"
src=""
alt="Status preview"
style="width: 32px; height: 32px; border-radius: 4px; object-fit: cover"
/>
<div style="flex: 1; min-width: 0">
@ -1697,7 +1697,7 @@
</svg>
<img
id="header-account-img"
src=""
alt="Account avatar"
style="width: 100%; height: 100%; object-fit: cover; display: none"
/>
</button>

View file

@ -459,7 +459,7 @@ const syncManager = {
user_playlists: this.safeParseInternal(record.user_playlists, 'user_playlists', {}),
favorite_albums: this.safeParseInternal(record.favorite_albums, 'favorite_albums', []),
};
} catch (error) {
} catch {
return null;
}
},
@ -485,7 +485,7 @@ const syncManager = {
try {
const list = await this.pb.collection('DB_users').getList(1, 1, { filter: `username="${username}"` });
return list.totalItems > 0;
} catch (e) {
} catch {
return false;
}
},

View file

@ -2287,7 +2287,6 @@ document.addEventListener('DOMContentLoaded', async () => {
if (contextMenu.style.display === 'block') {
const track = contextMenu._contextTrack;
const albumItem = contextMenu.querySelector('[data-action="go-to-album"]');
const artistItem = contextMenu.querySelector('[data-action="go-to-artist"]');
if (track) {
if (albumItem) {

View file

@ -198,7 +198,7 @@ export async function parseCSV(csvText, api, onProgress) {
} else {
missingTracks.push({ title: trackTitle, artist: artistNames, album: albumName });
}
} catch (e) {
} catch {
missingTracks.push({ title: trackTitle, artist: artistNames, album: albumName });
}
}
@ -255,7 +255,7 @@ export async function parseJSPF(jspfText, api, onProgress) {
} else {
missingTracks.push({ title: trackTitle, artist: trackCreator, album: trackAlbum });
}
} catch (e) {
} catch {
missingTracks.push({ title: trackTitle, artist: trackCreator, album: trackAlbum });
}
}
@ -319,7 +319,7 @@ export async function parseXSPF(xspfText, api, onProgress) {
} else {
missingTracks.push({ title, artist: creator, album });
}
} catch (e) {
} catch {
missingTracks.push({ title, artist: creator, album });
}
}
@ -397,7 +397,7 @@ export async function parseXML(xmlText, api, onProgress) {
} else {
missingTracks.push({ title, artist, album });
}
} catch (e) {
} catch {
missingTracks.push({ title, artist, album });
}
}
@ -472,7 +472,7 @@ export async function parseM3U(m3uText, api, onProgress) {
} else {
missingTracks.push({ title: info.title, artist: info.artist, album: '' });
}
} catch (e) {
} catch {
missingTracks.push({ title: info.title, artist: info.artist, album: '' });
}
}

View file

@ -33,7 +33,6 @@ const saveProfileBtn = document.getElementById('edit-profile-save');
const cancelProfileBtn = document.getElementById('edit-profile-cancel');
const usernameError = document.getElementById('username-error');
let currentProfileUsername = null;
let currentFavoriteAlbums = [];
const api = new MusicAPI(apiSettings);
@ -103,7 +102,7 @@ function setupImageUploadControl(idPrefix) {
setTimeout(() => {
statusEl.style.display = 'none';
}, 2000);
} catch (error) {
} catch {
statusEl.textContent = 'Failed - try URL';
statusEl.style.color = '#ef4444';
} finally {
@ -170,8 +169,6 @@ export async function loadProfile(username) {
return;
}
currentProfileUsername = username;
document.getElementById('profile-display-name').textContent = profile.display_name || username;
if (profile.banner) document.getElementById('profile-banner').style.backgroundImage = `url('${profile.banner}')`;
if (profile.avatar_url) document.getElementById('profile-avatar').src = profile.avatar_url;
@ -233,8 +230,6 @@ export async function loadProfile(username) {
}
}
const dataSource = profile.profile_data_source || (profile.lastfm_username ? 'lastfm' : null);
if (profile.lastfm_username && profile.privacy?.lastfm !== 'private') {
const lfmEl = document.getElementById('profile-lastfm');
lfmEl.href = `https://last.fm/user/${profile.lastfm_username}`;
@ -856,7 +851,7 @@ async function fetchFallbackCover(title, artist, imgId) {
if (!foundCover) {
await fetchFallbackArtistImage(artist, imgId);
}
} catch (e) {
} catch {
await fetchFallbackArtistImage(artist, imgId);
}
}
@ -883,7 +878,7 @@ async function fetchFallbackAlbumCover(title, artist, imgId) {
if (!foundCover) {
await fetchFallbackArtistImage(artist, imgId);
}
} catch (e) {
} catch {
await fetchFallbackArtistImage(artist, imgId);
}
}
@ -900,7 +895,9 @@ async function fetchFallbackArtistImage(artistName, imgId) {
if (imgEl) imgEl.src = newUrl;
}
}
} catch (e) {}
} catch {
// Silently ignore errors
}
}
async function fetchLastFmRecentTracks(username) {

View file

@ -59,7 +59,6 @@ export function initializeSettings(scrobbler, player, api, ui) {
const toggleEmailBtn = document.getElementById('toggle-email-auth-btn');
const cancelEmailBtn = document.getElementById('cancel-email-auth-btn');
const authModal = document.getElementById('email-auth-modal');
const authButtonsContainer = document.getElementById('auth-buttons-container');
const emailInput = document.getElementById('auth-email');
const passwordInput = document.getElementById('auth-password');
const signInBtn = document.getElementById('email-signin-btn');

View file

@ -29,7 +29,7 @@ export const apiSettings = {
if (isSimpleArray) {
groupedInstances.api = [...data.api];
} else {
for (const [_key, config] of Object.entries(data.api)) {
for (const [, config] of Object.entries(data.api)) {
if (config.cors === false && Array.isArray(config.urls)) {
groupedInstances.api.push(...config.urls);
}

View file

@ -327,7 +327,6 @@ export class UIRenderer {
const trackNumberHTML = `<div class="track-number">${showCover ? trackImageHTML : displayIndex}</div>`;
const explicitBadge = hasExplicitContent(track) ? this.createExplicitBadge() : '';
const qualityBadge = createQualityBadgeHTML(track);
const trackArtists = getTrackArtists(track);
const trackTitle = getTrackTitle(track);
const isCurrentTrack = this.player?.currentTrack?.id === track.id;
@ -3746,13 +3745,9 @@ export class UIRenderer {
const albumSection = document.getElementById('track-album-section');
const albumTracksContainer = document.getElementById('track-detail-album-tracks');
const similarSection = document.getElementById('track-similar-section');
const similarTracksContainer = document.getElementById('track-detail-similar-tracks');
const playBtn = document.getElementById('play-track-btn');
const lyricsBtn = document.getElementById('track-lyrics-btn');
const shareBtn = document.getElementById('share-track-btn');
const likeBtn = document.getElementById('like-track-btn');
const downloadBtn = document.getElementById('download-track-btn');
imageEl.src = '';
imageEl.style.backgroundColor = 'var(--muted)';

View file

@ -7517,31 +7517,3 @@ textarea:focus {
text-align: left;
justify-content: flex-start;
}
.dropdown-menu {
display: none;
position: absolute;
top: 100%;
left: 0;
background: var(--card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 0.5rem;
z-index: 2000;
min-width: 200px;
margin-top: 0.5rem;
box-shadow: var(--shadow-lg);
flex-direction: column;
gap: 0.25rem;
}
.dropdown-menu.active {
display: flex;
animation: scale-in 0.1s ease-out;
}
.dropdown-menu button {
width: 100%;
text-align: left;
justify-content: flex-start;
}