style: auto-fix linting issues

This commit is contained in:
SamidyFR 2026-03-10 01:58:49 +00:00 committed by github-actions[bot]
parent ce4979bdb2
commit 4cb8b84f91
5 changed files with 65 additions and 41 deletions

View file

@ -2218,23 +2218,39 @@
<section class="content-section"> <section class="content-section">
<div class="header-actions"> <div class="header-actions">
<h2 class="section-title">Recommended Songs</h2> <h2 class="section-title">Recommended Songs</h2>
<div style="display: flex; gap: 8px;"> <div style="display: flex; gap: 8px">
<button <button
class="btn-primary" class="btn-primary"
id="home-start-infinite-radio-btn" id="home-start-infinite-radio-btn"
title="Start Infinite Radio" title="Start Infinite Radio"
style="display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 0.85rem;" style="
display: flex;
align-items: center;
gap: 8px;
padding: 6px 12px;
font-size: 0.85rem;
"
> >
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"> <svg
<path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9"/><path d="M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.4"/><circle cx="12" cy="12" r="2"/><path d="M16.2 7.8c2.3 2.3 2.3 6.1 0 8.4"/><path d="M19.1 4.9C23 8.8 23 15.2 19.1 19.1"/> xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2.5"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9" />
<path d="M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.4" />
<circle cx="12" cy="12" r="2" />
<path d="M16.2 7.8c2.3 2.3 2.3 6.1 0 8.4" />
<path d="M19.1 4.9C23 8.8 23 15.2 19.1 19.1" />
</svg> </svg>
Start Infinite Radio Start Infinite Radio
</button> </button>
<button <button class="btn-secondary" id="refresh-songs-btn" title="Refresh">
class="btn-secondary"
id="refresh-songs-btn"
title="Refresh"
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="16" width="16"

View file

@ -348,7 +348,6 @@ class AudioContextManager {
} }
} }
changeSource(audioElement) { changeSource(audioElement) {
if (!this.audioContext) { if (!this.audioContext) {
this.init(audioElement); this.init(audioElement);
@ -360,8 +359,7 @@ class AudioContextManager {
if (this.source) { if (this.source) {
try { try {
this.source.disconnect(); this.source.disconnect();
} catch (e) { } catch (e) {}
}
} }
this.audio = audioElement; this.audio = audioElement;
@ -389,8 +387,7 @@ class AudioContextManager {
// Disconnect everything first // Disconnect everything first
try { try {
this.source.disconnect(); this.source.disconnect();
} catch (e) { } catch (e) {}
}
this.outputNode.disconnect(); this.outputNode.disconnect();
if (this.volumeNode) { if (this.volumeNode) {
this.volumeNode.disconnect(); this.volumeNode.disconnect();

View file

@ -183,10 +183,18 @@ export function initializePlayerEvents(player, audioPlayer, scrobbler, ui) {
let errorMsg = 'Unknown error'; let errorMsg = 'Unknown error';
if (error) { if (error) {
switch (error.code) { switch (error.code) {
case 1: errorMsg = 'Playback aborted'; break; case 1:
case 2: errorMsg = 'Network error'; break; errorMsg = 'Playback aborted';
case 3: errorMsg = 'Decoding error'; break; break;
case 4: errorMsg = 'Source not supported'; break; case 2:
errorMsg = 'Network error';
break;
case 3:
errorMsg = 'Decoding error';
break;
case 4:
errorMsg = 'Source not supported';
break;
} }
if (error.message) errorMsg += `: ${error.message}`; if (error.message) errorMsg += `: ${error.message}`;
} }
@ -270,7 +278,6 @@ export function initializePlayerEvents(player, audioPlayer, scrobbler, ui) {
}); });
} }
// Waveform Masking Logic // Waveform Masking Logic
const updateWaveform = async () => { const updateWaveform = async () => {
const progressBar = document.getElementById('progress-bar'); const progressBar = document.getElementById('progress-bar');

View file

@ -103,7 +103,6 @@ export class Player {
} }
}); });
this._setupVideoSync(); this._setupVideoSync();
} }
@ -119,8 +118,7 @@ export class Player {
if (this.video.readyState >= 2 && (this.audio.readyState > 0 || this.audio.src)) { if (this.video.readyState >= 2 && (this.audio.readyState > 0 || this.audio.src)) {
this.audio.currentTime = this.video.currentTime; this.audio.currentTime = this.video.currentTime;
} }
} catch (err) { } catch (err) {}
}
} }
const syncedEvent = new Event(eventName, { bubbles: e.bubbles, cancelable: e.cancelable }); const syncedEvent = new Event(eventName, { bubbles: e.bubbles, cancelable: e.cancelable });
@ -467,8 +465,7 @@ export class Player {
this.hls = new Hls(); this.hls = new Hls();
this.hls.loadSource(url); this.hls.loadSource(url);
this.hls.attachMedia(video); this.hls.attachMedia(video);
this.hls.on(Hls.Events.MANIFEST_PARSED, () => { this.hls.on(Hls.Events.MANIFEST_PARSED, () => {});
});
this.hls.on(Hls.Events.ERROR, (event, data) => { this.hls.on(Hls.Events.ERROR, (event, data) => {
if (data.fatal) { if (data.fatal) {
console.warn('HLS fatal error:', data.type); console.warn('HLS fatal error:', data.type);
@ -706,10 +703,16 @@ export class Player {
if (!played) return; if (!played) return;
} else if (track.type === 'video') { } else if (track.type === 'video') {
if (window.monochromeUi) { if (window.monochromeUi) {
const isInFullscreen = document.getElementById('fullscreen-cover-overlay')?.style.display === 'flex'; const isInFullscreen =
document.getElementById('fullscreen-cover-overlay')?.style.display === 'flex';
if (!isInFullscreen) { if (!isInFullscreen) {
const lyricsManager = window.monochromeUi.lyricsManager; const lyricsManager = window.monochromeUi.lyricsManager;
window.monochromeUi.showFullscreenCover(track, this.getNextTrack(), lyricsManager, activeElement); window.monochromeUi.showFullscreenCover(
track,
this.getNextTrack(),
lyricsManager,
activeElement
);
} }
} }
@ -955,8 +958,8 @@ export class Player {
]); ]);
const knownTrackIds = new Set([ const knownTrackIds = new Set([
...favorites.map(t => t.id), ...favorites.map((t) => t.id),
...userPlaylists.flatMap(p => (p.tracks || []).map(t => t.id)) ...userPlaylists.flatMap((p) => (p.tracks || []).map((t) => t.id)),
]); ]);
const newTracks = recommendations.filter((t) => { const newTracks = recommendations.filter((t) => {

View file

@ -3168,6 +3168,7 @@ input:checked + .slider::before {
opacity: 0; opacity: 0;
transform: translate(-50%, 10px); transform: translate(-50%, 10px);
} }
to { to {
opacity: 1; opacity: 1;
transform: translate(-50%, 0); transform: translate(-50%, 0);