1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

add last/next to playlist

This commit is contained in:
Techywarrior 2013-05-02 20:48:19 -07:00
parent a7c270d755
commit 6dfc031b41
3 changed files with 15 additions and 8 deletions

View file

@ -10,12 +10,12 @@
<div data-role="content">
<table id="playlistTable">
<table id="playlistTable" style="margin:auto;width:90%;">
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Series/Album/Year</th>
<th>Album</th>
<th>Time</th>
<th>Rating</th>
<th></th>

View file

@ -395,11 +395,15 @@
};
self.playLast = function (itemId) {
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).done(function (item) {
Playlist.add(item);
});
};
self.playNext = function (itemId) {
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).done(function (item) {
Playlist.playNext(item);
});
};
self.stop = function () {

View file

@ -29,10 +29,13 @@
self.queue.splice(index, 1);
};
self.playNext = function () {
self.playNext = function (item) {
if (typeof self.queue[0] != "undefined") {
MediaPlayer.play(new Array(self.queue[0]));
self.queue.shift();
//MediaPlayer.play(new Array(self.queue[0]));
//self.queue.shift();
self.queue.unshift(item);
}else {
self.add(item);
}
};
@ -85,7 +88,7 @@
html += '<td>' + name + '</td>';
html += '<td>' + seriesName + '</td>';
html += '<td>' + ticks_to_human(item.RunTimeTicks) + '</td>';
html += '<td></td>';
html += '<td>' + LibraryBrowser.getUserDataIconsHtml(item) + '</td>';
html += '<td><a href="" data-queue-index="'+i+'" onclick="Playlist.remove(this)">remove</a></td>';
html += '</tr>';