further:allow right clicking blocked content for easier unblocking

This commit is contained in:
edideaur 2026-04-02 18:44:13 +00:00 committed by GitHub
parent a6082a5288
commit 2183610df1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 34 deletions

View file

@ -4060,14 +4060,14 @@
</button> </button>
<div class="eq-howto-tab autoeq" id="eq-howto-autoeq"> <div class="eq-howto-tab autoeq" id="eq-howto-autoeq">
<h4>AutoEQ &mdash; Headphone Correction</h4> <h4>AutoEQ - Headphone Correction</h4>
<ol> <ol>
<li> <li>
<b>Select your headphone</b> from the dropdown or search the <b>Select your headphone</b> from the dropdown or search the
database below. database below.
</li> </li>
<li> <li>
<b>Pick a target curve</b> &mdash; Harman is the most popular. You <b>Pick a target curve</b> - Harman is the most popular. You
can also import a custom target. can also import a custom target.
</li> </li>
<li> <li>
@ -4075,7 +4075,7 @@
default). default).
</li> </li>
<li> <li>
Click <b>AutoEQ</b> &mdash; the algorithm generates parametric Click <b>AutoEQ</b> - the algorithm generates parametric
filters that shape your headphone's response toward the target. filters that shape your headphone's response toward the target.
</li> </li>
<li> <li>
@ -4103,7 +4103,7 @@
id="eq-howto-parametric" id="eq-howto-parametric"
style="display: none" style="display: none"
> >
<h4>Parametric EQ &mdash; Manual Control</h4> <h4>Parametric EQ - Manual Control</h4>
<ol> <ol>
<li> <li>
Each band supports <b>peaking, low-shelf, and high-shelf</b> filter Each band supports <b>peaking, low-shelf, and high-shelf</b> filter
@ -4141,7 +4141,7 @@
</div> </div>
<div class="eq-howto-tab speaker" id="eq-howto-speaker" style="display: none"> <div class="eq-howto-tab speaker" id="eq-howto-speaker" style="display: none">
<h4>Speaker EQ &mdash; Room Correction</h4> <h4>Speaker EQ - Room Correction</h4>
<ol> <ol>
<li>Select your <b>speaker config</b> (2.0, 5.1, or 7.1).</li> <li>Select your <b>speaker config</b> (2.0, 5.1, or 7.1).</li>
<li> <li>
@ -4149,17 +4149,17 @@
a time. a time.
</li> </li>
<li> <li>
<b>Measure</b>: click the mic button &mdash; pink noise plays for 5 <b>Measure</b>: click the mic button - pink noise plays for 5
seconds while your microphone captures the room response. Or seconds while your microphone captures the room response. Or
<b>import</b> a measurement file from REW or similar. <b>import</b> a measurement file from REW or similar.
</li> </li>
<li> <li>
Pick a <b>target</b> &mdash; Harman In-Room is recommended for Pick a <b>target</b> - Harman In-Room is recommended for
speakers. speakers.
</li> </li>
<li> <li>
Set <b>Bass Limit</b> (don't EQ below this) and Set <b>Bass Limit</b> (don't EQ below this) and
<b>Room Limit</b> (don't EQ above this) &mdash; the colored lines on <b>Room Limit</b> (don't EQ above this) - the colored lines on
the graph show the active range. the graph show the active range.
</li> </li>
<li> <li>

View file

@ -73,7 +73,7 @@ const LONG_PRESS_DURATION = 500;
function handleTrackTouchStart(e) { function handleTrackTouchStart(e) {
if (!('ontouchstart' in window)) return; if (!('ontouchstart' in window)) return;
const trackItem = e.target.closest('.track-item'); const trackItem = e.target.closest('.track-item');
if (!trackItem || trackItem.classList.contains('unavailable') || trackItem.classList.contains('blocked')) return; if (!trackItem || trackItem.classList.contains('unavailable')) return;
isLongPress = false; isLongPress = false;
longPressTrackItem = trackItem; longPressTrackItem = trackItem;
@ -1336,7 +1336,8 @@ export async function handleTrackAction(
// Individual Track Actions // Individual Track Actions
// Check if track/artist is blocked // Check if track/artist is blocked
const { contentBlockingSettings } = await import('./storage.js'); const { contentBlockingSettings } = await import('./storage.js');
if (type === 'track' && action !== 'block-track' && contentBlockingSettings.shouldHideTrack(item)) { const BLOCKED_PLAY_ACTIONS = new Set(['play-card', 'add-to-queue', 'play-next', 'start-mix']);
if (type === 'track' && BLOCKED_PLAY_ACTIONS.has(action) && contentBlockingSettings.shouldHideTrack(item)) {
showNotification('This track is blocked'); showNotification('This track is blocked');
return; return;
} }
@ -2165,7 +2166,7 @@ export function initializeTrackInteractions(player, api, mainContent, contextMen
} }
const trackItem = e.target.closest('.track-item'); const trackItem = e.target.closest('.track-item');
if (trackItem && (trackItem.classList.contains('unavailable') || trackItem.classList.contains('blocked'))) { if (trackItem && trackItem.classList.contains('unavailable')) {
return; return;
} }
if (isLongPress && longPressTrackItem === trackItem) { if (isLongPress && longPressTrackItem === trackItem) {
@ -2173,6 +2174,7 @@ export function initializeTrackInteractions(player, api, mainContent, contextMen
} }
if ( if (
trackItem && trackItem &&
!trackItem.classList.contains('blocked') &&
!trackItem.dataset.queueIndex && !trackItem.dataset.queueIndex &&
!e.target.closest('.remove-from-playlist-btn') && !e.target.closest('.remove-from-playlist-btn') &&
!e.target.closest('.artist-link') && !e.target.closest('.artist-link') &&
@ -2256,17 +2258,13 @@ export function initializeTrackInteractions(player, api, mainContent, contextMen
const card = e.target.closest('.card'); const card = e.target.closest('.card');
if (card) { if (card) {
// Don't navigate if card is blocked (unless clicking menu button)
if (card.classList.contains('blocked') && !e.target.closest('.card-menu-btn')) {
return;
}
if (e.target.closest('.edit-playlist-btn') || e.target.closest('.delete-playlist-btn')) { if (e.target.closest('.edit-playlist-btn') || e.target.closest('.delete-playlist-btn')) {
return; return;
} }
const libraryTracksContainer = card.closest('#library-tracks-container'); const libraryTracksContainer = card.closest('#library-tracks-container');
if (libraryTracksContainer && card.dataset.trackId) { if (libraryTracksContainer && card.dataset.trackId) {
if (card.classList.contains('blocked')) return;
if ( if (
e.target.closest('.like-btn') || e.target.closest('.like-btn') ||
e.target.closest('.card-play-btn') || e.target.closest('.card-play-btn') ||

View file

@ -2881,13 +2881,13 @@ export const contentBlockingSettings = {
isTrackBlocked(trackId) { isTrackBlocked(trackId) {
if (!trackId) return false; if (!trackId) return false;
return this.getBlockedTracks().some((t) => t.id === trackId); return this.getBlockedTracks().some((t) => String(t.id) === String(trackId));
}, },
blockTrack(track) { blockTrack(track) {
if (!track || !track.id) return; if (!track || !track.id) return;
const blocked = this.getBlockedTracks(); const blocked = this.getBlockedTracks();
if (!blocked.some((t) => t.id === track.id)) { if (!blocked.some((t) => String(t.id) === String(track.id))) {
blocked.push({ blocked.push({
id: track.id, id: track.id,
title: track.title || 'Unknown Track', title: track.title || 'Unknown Track',
@ -2899,7 +2899,7 @@ export const contentBlockingSettings = {
}, },
unblockTrack(trackId) { unblockTrack(trackId) {
const blocked = this.getBlockedTracks().filter((t) => t.id !== trackId); const blocked = this.getBlockedTracks().filter((t) => String(t.id) !== String(trackId));
this.setBlockedTracks(blocked); this.setBlockedTracks(blocked);
}, },
@ -2919,13 +2919,13 @@ export const contentBlockingSettings = {
isAlbumBlocked(albumId) { isAlbumBlocked(albumId) {
if (!albumId) return false; if (!albumId) return false;
return this.getBlockedAlbums().some((a) => a.id === albumId); return this.getBlockedAlbums().some((a) => String(a.id) === String(albumId));
}, },
blockAlbum(album) { blockAlbum(album) {
if (!album || !album.id) return; if (!album || !album.id) return;
const blocked = this.getBlockedAlbums(); const blocked = this.getBlockedAlbums();
if (!blocked.some((a) => a.id === album.id)) { if (!blocked.some((a) => String(a.id) === String(album.id))) {
blocked.push({ blocked.push({
id: album.id, id: album.id,
title: album.title || 'Unknown Album', title: album.title || 'Unknown Album',
@ -2937,7 +2937,7 @@ export const contentBlockingSettings = {
}, },
unblockAlbum(albumId) { unblockAlbum(albumId) {
const blocked = this.getBlockedAlbums().filter((a) => a.id !== albumId); const blocked = this.getBlockedAlbums().filter((a) => String(a.id) !== String(albumId));
this.setBlockedAlbums(blocked); this.setBlockedAlbums(blocked);
}, },

View file

@ -3871,7 +3871,6 @@ input:checked + .slider::before {
/* Blocked content styling */ /* Blocked content styling */
.track-item.blocked { .track-item.blocked {
opacity: 0.4; opacity: 0.4;
pointer-events: none;
filter: grayscale(100%); filter: grayscale(100%);
} }
@ -3879,22 +3878,11 @@ input:checked + .slider::before {
text-decoration: line-through; text-decoration: line-through;
} }
.track-item.blocked .track-menu-btn {
pointer-events: auto;
opacity: 1;
}
.card.blocked { .card.blocked {
opacity: 0.4; opacity: 0.4;
pointer-events: none;
filter: grayscale(100%); filter: grayscale(100%);
} }
.card.blocked .card-menu-btn {
pointer-events: auto;
opacity: 1;
}
.card.blocked .card-title, .card.blocked .card-title,
.card.blocked .card-subtitle { .card.blocked .card-subtitle {
text-decoration: line-through; text-decoration: line-through;