fix: artist page song clicks bypass shuffle — play exact song in order
This commit is contained in:
1 parent
64c107da0b
commit
4e6f8782ca
2 files changed
+4
-3
No files matched your search
+3
-2
@@ -356,14 +356,15 @@ let _playGen = 0;
|
|||||||
// from the previous queue can detect they're stale and bail out.
|
// from the previous queue can detect they're stale and bail out.
|
||||||
let _queueGen = 0;
|
let _queueGen = 0;
|
||||||
|
|
||||||
export function playQueue(songs, startIdx) {
|
export function playQueue(songs, startIdx, opts = {}) {
|
||||||
_queueGen++;
|
_queueGen++;
|
||||||
_radioFilling = false; // cancel any in-flight radio fill for the old queue
|
_radioFilling = false; // cancel any in-flight radio fill for the old queue
|
||||||
S._origQueue = null;
|
S._origQueue = null;
|
||||||
_histClear();
|
_histClear();
|
||||||
// Shuffle: fully random order, no pinning — startIdx is ignored.
|
// Shuffle: fully random order, no pinning — startIdx is ignored.
|
||||||
// Both web and Android traverse this fixed shuffled order sequentially.
|
// Both web and Android traverse this fixed shuffled order sequentially.
|
||||||
if (S.shuffle && songs.length > 1) {
|
// opts.noShuffle = true skips shuffle (e.g. clicking a specific song on the artist page).
|
||||||
|
if (S.shuffle && songs.length > 1 && !opts.noShuffle) {
|
||||||
S._origQueue = songs.map(s => ({...s}));
|
S._origQueue = songs.map(s => ({...s}));
|
||||||
S.queue = [...songs].sort(() => Math.random() - 0.5).map(s => ({...s}));
|
S.queue = [...songs].sort(() => Math.random() - 0.5).map(s => ({...s}));
|
||||||
S.qIdx = 0;
|
S.qIdx = 0;
|
||||||
|
|||||||
+1
-1
@@ -346,7 +346,7 @@ function _makeTopsongRow(s, num, subtitle, list, idx) {
|
|||||||
<button class="icon-btn${s._starred ? ' starred' : ''}" title="Favorit"><svg width="12" height="12" viewBox="0 0 24 24" fill="${s._starred ? 'currentColor' : 'none'}" stroke="currentColor" stroke-width="2"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg></button>
|
<button class="icon-btn${s._starred ? ' starred' : ''}" title="Favorit"><svg width="12" height="12" viewBox="0 0 24 24" fill="${s._starred ? 'currentColor' : 'none'}" stroke="currentColor" stroke-width="2"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg></button>
|
||||||
<button class="icon-btn song-menu-btn" title="Mehr"><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="5" r="1.5"/><circle cx="12" cy="12" r="1.5"/><circle cx="12" cy="19" r="1.5"/></svg></button>
|
<button class="icon-btn song-menu-btn" title="Mehr"><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="5" r="1.5"/><circle cx="12" cy="12" r="1.5"/><circle cx="12" cy="19" r="1.5"/></svg></button>
|
||||||
</div>`;
|
</div>`;
|
||||||
row.onclick = () => playQueue(list, idx);
|
row.onclick = () => playQueue(list, idx, { noShuffle: true });
|
||||||
row.addEventListener('contextmenu', e => { e.preventDefault(); showCtxMenu(e, s, list, idx); });
|
row.addEventListener('contextmenu', e => { e.preventDefault(); showCtxMenu(e, s, list, idx); });
|
||||||
const btns = row.querySelectorAll('.icon-btn');
|
const btns = row.querySelectorAll('.icon-btn');
|
||||||
btns[0].onclick = e => { e.stopPropagation(); toggleStar(s, btns[0]); };
|
btns[0].onclick = e => { e.stopPropagation(); toggleStar(s, btns[0]); };
|
||||||
|
|||||||
Reference in new issue
Block a user