fix linting errors/warnings
This commit is contained in:
parent
b7e6572743
commit
bddf5a0d73
9 changed files with 16 additions and 54 deletions
|
|
@ -919,7 +919,7 @@
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
id="status-preview-img"
|
id="status-preview-img"
|
||||||
src=""
|
alt="Status preview"
|
||||||
style="width: 32px; height: 32px; border-radius: 4px; object-fit: cover"
|
style="width: 32px; height: 32px; border-radius: 4px; object-fit: cover"
|
||||||
/>
|
/>
|
||||||
<div style="flex: 1; min-width: 0">
|
<div style="flex: 1; min-width: 0">
|
||||||
|
|
@ -1697,7 +1697,7 @@
|
||||||
</svg>
|
</svg>
|
||||||
<img
|
<img
|
||||||
id="header-account-img"
|
id="header-account-img"
|
||||||
src=""
|
alt="Account avatar"
|
||||||
style="width: 100%; height: 100%; object-fit: cover; display: none"
|
style="width: 100%; height: 100%; object-fit: cover; display: none"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,7 @@ const syncManager = {
|
||||||
user_playlists: this.safeParseInternal(record.user_playlists, 'user_playlists', {}),
|
user_playlists: this.safeParseInternal(record.user_playlists, 'user_playlists', {}),
|
||||||
favorite_albums: this.safeParseInternal(record.favorite_albums, 'favorite_albums', []),
|
favorite_albums: this.safeParseInternal(record.favorite_albums, 'favorite_albums', []),
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -485,7 +485,7 @@ const syncManager = {
|
||||||
try {
|
try {
|
||||||
const list = await this.pb.collection('DB_users').getList(1, 1, { filter: `username="${username}"` });
|
const list = await this.pb.collection('DB_users').getList(1, 1, { filter: `username="${username}"` });
|
||||||
return list.totalItems > 0;
|
return list.totalItems > 0;
|
||||||
} catch (e) {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -2287,7 +2287,6 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
if (contextMenu.style.display === 'block') {
|
if (contextMenu.style.display === 'block') {
|
||||||
const track = contextMenu._contextTrack;
|
const track = contextMenu._contextTrack;
|
||||||
const albumItem = contextMenu.querySelector('[data-action="go-to-album"]');
|
const albumItem = contextMenu.querySelector('[data-action="go-to-album"]');
|
||||||
const artistItem = contextMenu.querySelector('[data-action="go-to-artist"]');
|
|
||||||
|
|
||||||
if (track) {
|
if (track) {
|
||||||
if (albumItem) {
|
if (albumItem) {
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ export async function parseCSV(csvText, api, onProgress) {
|
||||||
} else {
|
} else {
|
||||||
missingTracks.push({ title: trackTitle, artist: artistNames, album: albumName });
|
missingTracks.push({ title: trackTitle, artist: artistNames, album: albumName });
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
missingTracks.push({ title: trackTitle, artist: artistNames, album: albumName });
|
missingTracks.push({ title: trackTitle, artist: artistNames, album: albumName });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -255,7 +255,7 @@ export async function parseJSPF(jspfText, api, onProgress) {
|
||||||
} else {
|
} else {
|
||||||
missingTracks.push({ title: trackTitle, artist: trackCreator, album: trackAlbum });
|
missingTracks.push({ title: trackTitle, artist: trackCreator, album: trackAlbum });
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
missingTracks.push({ title: trackTitle, artist: trackCreator, album: trackAlbum });
|
missingTracks.push({ title: trackTitle, artist: trackCreator, album: trackAlbum });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -319,7 +319,7 @@ export async function parseXSPF(xspfText, api, onProgress) {
|
||||||
} else {
|
} else {
|
||||||
missingTracks.push({ title, artist: creator, album });
|
missingTracks.push({ title, artist: creator, album });
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
missingTracks.push({ title, artist: creator, album });
|
missingTracks.push({ title, artist: creator, album });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -397,7 +397,7 @@ export async function parseXML(xmlText, api, onProgress) {
|
||||||
} else {
|
} else {
|
||||||
missingTracks.push({ title, artist, album });
|
missingTracks.push({ title, artist, album });
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
missingTracks.push({ title, artist, album });
|
missingTracks.push({ title, artist, album });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -472,7 +472,7 @@ export async function parseM3U(m3uText, api, onProgress) {
|
||||||
} else {
|
} else {
|
||||||
missingTracks.push({ title: info.title, artist: info.artist, album: '' });
|
missingTracks.push({ title: info.title, artist: info.artist, album: '' });
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
missingTracks.push({ title: info.title, artist: info.artist, album: '' });
|
missingTracks.push({ title: info.title, artist: info.artist, album: '' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ const saveProfileBtn = document.getElementById('edit-profile-save');
|
||||||
const cancelProfileBtn = document.getElementById('edit-profile-cancel');
|
const cancelProfileBtn = document.getElementById('edit-profile-cancel');
|
||||||
const usernameError = document.getElementById('username-error');
|
const usernameError = document.getElementById('username-error');
|
||||||
|
|
||||||
let currentProfileUsername = null;
|
|
||||||
let currentFavoriteAlbums = [];
|
let currentFavoriteAlbums = [];
|
||||||
const api = new MusicAPI(apiSettings);
|
const api = new MusicAPI(apiSettings);
|
||||||
|
|
||||||
|
|
@ -103,7 +102,7 @@ function setupImageUploadControl(idPrefix) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
statusEl.style.display = 'none';
|
statusEl.style.display = 'none';
|
||||||
}, 2000);
|
}, 2000);
|
||||||
} catch (error) {
|
} catch {
|
||||||
statusEl.textContent = 'Failed - try URL';
|
statusEl.textContent = 'Failed - try URL';
|
||||||
statusEl.style.color = '#ef4444';
|
statusEl.style.color = '#ef4444';
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -170,8 +169,6 @@ export async function loadProfile(username) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentProfileUsername = username;
|
|
||||||
|
|
||||||
document.getElementById('profile-display-name').textContent = profile.display_name || 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.banner) document.getElementById('profile-banner').style.backgroundImage = `url('${profile.banner}')`;
|
||||||
if (profile.avatar_url) document.getElementById('profile-avatar').src = profile.avatar_url;
|
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') {
|
if (profile.lastfm_username && profile.privacy?.lastfm !== 'private') {
|
||||||
const lfmEl = document.getElementById('profile-lastfm');
|
const lfmEl = document.getElementById('profile-lastfm');
|
||||||
lfmEl.href = `https://last.fm/user/${profile.lastfm_username}`;
|
lfmEl.href = `https://last.fm/user/${profile.lastfm_username}`;
|
||||||
|
|
@ -856,7 +851,7 @@ async function fetchFallbackCover(title, artist, imgId) {
|
||||||
if (!foundCover) {
|
if (!foundCover) {
|
||||||
await fetchFallbackArtistImage(artist, imgId);
|
await fetchFallbackArtistImage(artist, imgId);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
await fetchFallbackArtistImage(artist, imgId);
|
await fetchFallbackArtistImage(artist, imgId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -883,7 +878,7 @@ async function fetchFallbackAlbumCover(title, artist, imgId) {
|
||||||
if (!foundCover) {
|
if (!foundCover) {
|
||||||
await fetchFallbackArtistImage(artist, imgId);
|
await fetchFallbackArtistImage(artist, imgId);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
await fetchFallbackArtistImage(artist, imgId);
|
await fetchFallbackArtistImage(artist, imgId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -900,7 +895,9 @@ async function fetchFallbackArtistImage(artistName, imgId) {
|
||||||
if (imgEl) imgEl.src = newUrl;
|
if (imgEl) imgEl.src = newUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch {
|
||||||
|
// Silently ignore errors
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchLastFmRecentTracks(username) {
|
async function fetchLastFmRecentTracks(username) {
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@ export function initializeSettings(scrobbler, player, api, ui) {
|
||||||
const toggleEmailBtn = document.getElementById('toggle-email-auth-btn');
|
const toggleEmailBtn = document.getElementById('toggle-email-auth-btn');
|
||||||
const cancelEmailBtn = document.getElementById('cancel-email-auth-btn');
|
const cancelEmailBtn = document.getElementById('cancel-email-auth-btn');
|
||||||
const authModal = document.getElementById('email-auth-modal');
|
const authModal = document.getElementById('email-auth-modal');
|
||||||
const authButtonsContainer = document.getElementById('auth-buttons-container');
|
|
||||||
const emailInput = document.getElementById('auth-email');
|
const emailInput = document.getElementById('auth-email');
|
||||||
const passwordInput = document.getElementById('auth-password');
|
const passwordInput = document.getElementById('auth-password');
|
||||||
const signInBtn = document.getElementById('email-signin-btn');
|
const signInBtn = document.getElementById('email-signin-btn');
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ export const apiSettings = {
|
||||||
if (isSimpleArray) {
|
if (isSimpleArray) {
|
||||||
groupedInstances.api = [...data.api];
|
groupedInstances.api = [...data.api];
|
||||||
} else {
|
} 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)) {
|
if (config.cors === false && Array.isArray(config.urls)) {
|
||||||
groupedInstances.api.push(...config.urls);
|
groupedInstances.api.push(...config.urls);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5
js/ui.js
5
js/ui.js
|
|
@ -327,7 +327,6 @@ export class UIRenderer {
|
||||||
const trackNumberHTML = `<div class="track-number">${showCover ? trackImageHTML : displayIndex}</div>`;
|
const trackNumberHTML = `<div class="track-number">${showCover ? trackImageHTML : displayIndex}</div>`;
|
||||||
const explicitBadge = hasExplicitContent(track) ? this.createExplicitBadge() : '';
|
const explicitBadge = hasExplicitContent(track) ? this.createExplicitBadge() : '';
|
||||||
const qualityBadge = createQualityBadgeHTML(track);
|
const qualityBadge = createQualityBadgeHTML(track);
|
||||||
const trackArtists = getTrackArtists(track);
|
|
||||||
const trackTitle = getTrackTitle(track);
|
const trackTitle = getTrackTitle(track);
|
||||||
const isCurrentTrack = this.player?.currentTrack?.id === track.id;
|
const isCurrentTrack = this.player?.currentTrack?.id === track.id;
|
||||||
|
|
||||||
|
|
@ -3746,13 +3745,9 @@ export class UIRenderer {
|
||||||
const albumSection = document.getElementById('track-album-section');
|
const albumSection = document.getElementById('track-album-section');
|
||||||
const albumTracksContainer = document.getElementById('track-detail-album-tracks');
|
const albumTracksContainer = document.getElementById('track-detail-album-tracks');
|
||||||
const similarSection = document.getElementById('track-similar-section');
|
const similarSection = document.getElementById('track-similar-section');
|
||||||
const similarTracksContainer = document.getElementById('track-detail-similar-tracks');
|
|
||||||
|
|
||||||
const playBtn = document.getElementById('play-track-btn');
|
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 likeBtn = document.getElementById('like-track-btn');
|
||||||
const downloadBtn = document.getElementById('download-track-btn');
|
|
||||||
|
|
||||||
imageEl.src = '';
|
imageEl.src = '';
|
||||||
imageEl.style.backgroundColor = 'var(--muted)';
|
imageEl.style.backgroundColor = 'var(--muted)';
|
||||||
|
|
|
||||||
28
styles.css
28
styles.css
|
|
@ -7517,31 +7517,3 @@ textarea:focus {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
justify-content: flex-start;
|
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;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue