mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-27 08:10:34 +00:00
Use async/await when getting playlist
This commit is contained in:
parent
a2e0f52297
commit
865046e668
@ -886,18 +886,21 @@ export default function (view) {
|
||||
}
|
||||
}
|
||||
|
||||
function updatePlaylist() {
|
||||
playbackManager.getPlaylist()
|
||||
.then(playlist => {
|
||||
if (playlist && playlist.length > 1) {
|
||||
const btnPreviousTrack = view.querySelector('.btnPreviousTrack');
|
||||
const btnNextTrack = view.querySelector('.btnNextTrack');
|
||||
btnPreviousTrack.classList.remove('hide');
|
||||
btnNextTrack.classList.remove('hide');
|
||||
btnPreviousTrack.disabled = false;
|
||||
btnNextTrack.disabled = false;
|
||||
}
|
||||
});
|
||||
async function updatePlaylist() {
|
||||
try {
|
||||
const playlist = await playbackManager.getPlaylist();
|
||||
|
||||
if (playlist && playlist.length > 1) {
|
||||
const btnPreviousTrack = view.querySelector('.btnPreviousTrack');
|
||||
const btnNextTrack = view.querySelector('.btnNextTrack');
|
||||
btnPreviousTrack.classList.remove('hide');
|
||||
btnNextTrack.classList.remove('hide');
|
||||
btnPreviousTrack.disabled = false;
|
||||
btnNextTrack.disabled = false;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[VideoPlayer] failed to get playlist', err);
|
||||
}
|
||||
}
|
||||
|
||||
function updateTimeText(elem, ticks, divider) {
|
||||
|
Loading…
Reference in New Issue
Block a user