Skip to content

Commit

Permalink
refresh playlist preview functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
hinanaya committed May 16, 2024
1 parent e817377 commit 3950ed7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ui/elements/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class OBElementPreview extends OBElement {
` : html``}
</div>
<div id="queue" class="hidden">
<button onclick=${() => this.playlistRefresh()}>Refresh</button>
${this.#queue && this.#queue.map((queueItem, index) => html`
<span onclick=${() => this.queuePlay([index])} data-id=${index} class="${index == this.#itemId && html`current`}">${queueItem.artist} - ${queueItem.title}</span>
`)}
Expand Down Expand Up @@ -362,7 +363,14 @@ class OBElementPreview extends OBElement {
return;
}

this.#resolvePlaylist(this.#currentPlaylist);
let playlistId = this.#currentPlaylist;

this.#queue = [];
this.#itemId = null;
this.#itemType = null;
this.#currentPlaylist = null;

this.#resolvePlaylist(playlistId);
}

#resolvePlaylist(id) {
Expand Down

0 comments on commit 3950ed7

Please sign in to comment.