mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
support play all from here for episodes
This commit is contained in:
parent
afc6bfb5a4
commit
973da05e0a
4 changed files with 61 additions and 23 deletions
|
@ -1006,6 +1006,10 @@ progress {
|
|||
font-weight: normal !important;
|
||||
text-decoration: none;
|
||||
vertical-align: middle;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
cursor: pointer;
|
||||
cursor: hand;
|
||||
}
|
||||
|
||||
.accentButton-g {
|
||||
|
|
|
@ -137,8 +137,8 @@
|
|||
<button class="btnPlayTrailer hide" type="button" data-icon="video" data-inline="true" data-mini="true">${ButtonPlayTrailer}</button>
|
||||
<a class="btnPlayExternalTrailer hide" data-role="button" data-icon="video" data-inline="true" data-mini="true" href="#" target="_blank">${ButtonPlayTrailer}</a>
|
||||
<a class="btnPlayExternal hide" data-role="button" data-icon="play" data-inline="true" data-mini="true" href="#" target="_blank">${ButtonPlay}</a>
|
||||
<button class="btnMoreCommands hide" type="button" data-icon="ellipsis-v" data-inline="true" data-mini="true">${ButtonOptions}</button>
|
||||
<a class="btnSync hide" data-role="button" data-icon="cloud" data-inline="true" data-mini="true" href="#">${ButtonSync}</a>
|
||||
<button class="btnMoreCommands hide" type="button" data-icon="ellipsis-v" data-inline="true" data-mini="true">${ButtonOptions}</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -154,8 +154,8 @@
|
|||
<button class="btnPlayTrailer hide" type="button" data-icon="video" data-inline="true" data-mini="true">${ButtonPlayTrailer}</button>
|
||||
<a class="btnPlayExternalTrailer hide" data-role="button" data-icon="video" data-inline="true" data-mini="true" href="#" target="_blank">${ButtonPlayTrailer}</a>
|
||||
<a class="btnPlayExternal hide" data-role="button" data-icon="play" data-inline="true" data-mini="true" href="#" target="_blank">${ButtonPlay}</a>
|
||||
<button class="btnMoreCommands hide" type="button" data-icon="ellipsis-v" data-inline="true" data-mini="true">${ButtonOptions}</button>
|
||||
<a class="btnSync hide" data-role="button" data-icon="cloud" data-inline="true" data-mini="true" href="#">${ButtonSync}</a>
|
||||
<button class="btnMoreCommands hide" type="button" data-icon="ellipsis-v" data-inline="true" data-mini="true">${ButtonOptions}</button>
|
||||
</div>
|
||||
<p class="itemGenres mobileGenres"></p>
|
||||
<p class="itemOverview mobileOverview"></p>
|
||||
|
|
|
@ -717,10 +717,42 @@
|
|||
}
|
||||
}
|
||||
|
||||
var _childrenItemsQuery = null;
|
||||
function getEpisodesFunction(seriesId, query) {
|
||||
|
||||
query = $.extend({}, query);
|
||||
|
||||
return function (index, limit, fields) {
|
||||
|
||||
query.StartIndex = index;
|
||||
query.Limit = limit;
|
||||
query.Fields = fields;
|
||||
|
||||
return ApiClient.getEpisodes(seriesId, query);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
function getAlbumSongsFunction(query) {
|
||||
|
||||
query = $.extend({}, query);
|
||||
|
||||
return function (index, limit, fields) {
|
||||
|
||||
query.StartIndex = index;
|
||||
query.Limit = limit;
|
||||
query.Fields = fields;
|
||||
|
||||
return ApiClient.getItems(Dashboard.getCurrentUserId(), query);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
var _childrenItemsFunction = null;
|
||||
function renderChildren(page, item, user, context) {
|
||||
|
||||
_childrenItemsQuery = null;
|
||||
_childrenItemsFunction = null;
|
||||
|
||||
var fields = "ItemCounts,AudioInfo,PrimaryImageAspectRatio,SyncInfo";
|
||||
|
||||
|
@ -753,9 +785,18 @@
|
|||
userId: user.Id,
|
||||
Fields: fields
|
||||
});
|
||||
|
||||
_childrenItemsFunction = getEpisodesFunction(item.SeriesId, {
|
||||
|
||||
seasonId: item.Id,
|
||||
userId: user.Id
|
||||
});
|
||||
}
|
||||
else if (item.Type == "MusicAlbum") {
|
||||
|
||||
_childrenItemsFunction = getAlbumSongsFunction(query);
|
||||
}
|
||||
|
||||
_childrenItemsQuery = query;
|
||||
promise = promise || ApiClient.getItems(Dashboard.getCurrentUserId(), query);
|
||||
|
||||
promise.done(function (result) {
|
||||
|
@ -794,6 +835,7 @@
|
|||
showTitle: true,
|
||||
displayAsSpecial: item.Type == "Season" && item.IndexNumber,
|
||||
context: context,
|
||||
playFromHere: true,
|
||||
overlayText: true
|
||||
});
|
||||
}
|
||||
|
@ -1566,11 +1608,11 @@
|
|||
|
||||
$('.childrenItemsContainer', page).on('playallfromhere', function (e, index) {
|
||||
|
||||
LibraryBrowser.playAllFromHere(_childrenItemsQuery, index);
|
||||
LibraryBrowser.playAllFromHere(_childrenItemsFunction, index);
|
||||
|
||||
}).on('queueallfromhere', function (e, index) {
|
||||
|
||||
LibraryBrowser.queueAllFromHere(_childrenItemsQuery, index);
|
||||
LibraryBrowser.queueAllFromHere(_childrenItemsFunction, index);
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -90,14 +90,9 @@
|
|||
return "" + d.getFullYear() + formatDigit(d.getMonth() + 1) + formatDigit(d.getDate()) + formatDigit(d.getHours()) + formatDigit(d.getMinutes()) + formatDigit(d.getSeconds());
|
||||
},
|
||||
|
||||
playAllFromHere: function (query, index) {
|
||||
playAllFromHere: function (fn, index) {
|
||||
|
||||
query = $.extend({}, query);
|
||||
query.StartIndex = index;
|
||||
query.Limit = 100;
|
||||
query.Fields = "MediaSources,Chapters";
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
fn(index, 100, "MediaSources,Chapters").done(function (result) {
|
||||
|
||||
MediaController.play({
|
||||
items: result.Items
|
||||
|
@ -106,12 +101,8 @@
|
|||
},
|
||||
|
||||
queueAllFromHere: function (query, index) {
|
||||
query = $.extend({}, query);
|
||||
query.StartIndex = index;
|
||||
query.Limit = 100;
|
||||
query.Fields = "MediaSources,Chapters";
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
fn(index, 100, "MediaSources,Chapters").done(function (result) {
|
||||
|
||||
MediaController.queue({
|
||||
items: result.Items
|
||||
|
@ -695,7 +686,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
var dataAttributes = LibraryBrowser.getItemDataAttributes(item, options);
|
||||
var dataAttributes = LibraryBrowser.getItemDataAttributes(item, options, index);
|
||||
|
||||
var cssClass = options.smallIcon ? 'ui-li-has-icon listItem' : 'ui-li-has-thumb listItem';
|
||||
|
||||
|
@ -705,7 +696,7 @@
|
|||
|
||||
|
||||
var href = LibraryBrowser.getHref(item, options.context);
|
||||
html += '<li class="' + cssClass + '"' + dataAttributes + ' data-index="' + index + '" data-itemid="' + item.Id + '" data-playlistitemid="' + (item.PlaylistItemId || '') + '" data-href="' + href + '">';
|
||||
html += '<li class="' + cssClass + '"' + dataAttributes + ' data-itemid="' + item.Id + '" data-playlistitemid="' + (item.PlaylistItemId || '') + '" data-href="' + href + '">';
|
||||
|
||||
var defaultActionAttribute = options.defaultAction ? (' data-action="' + options.defaultAction + '" class="itemWithAction"') : '';
|
||||
html += '<a' + defaultActionAttribute + ' href="' + href + '">';
|
||||
|
@ -846,7 +837,7 @@
|
|||
return outerHtml;
|
||||
},
|
||||
|
||||
getItemDataAttributes: function (item, options) {
|
||||
getItemDataAttributes: function (item, options, index) {
|
||||
|
||||
var atts = [];
|
||||
|
||||
|
@ -861,6 +852,7 @@
|
|||
|
||||
atts.push('data-playaccess="' + (item.PlayAccess || '') + '"');
|
||||
atts.push('data-locationtype="' + (item.LocationType || '') + '"');
|
||||
atts.push('data-index="' + index + '"');
|
||||
|
||||
if (item.IsPlaceHolder) {
|
||||
atts.push('data-placeholder="true"');
|
||||
|
@ -1214,7 +1206,7 @@
|
|||
cssClass += ' bottomPaddedCard';
|
||||
}
|
||||
|
||||
var dataAttributes = LibraryBrowser.getItemDataAttributes(item, options);
|
||||
var dataAttributes = LibraryBrowser.getItemDataAttributes(item, options, i);
|
||||
|
||||
var defaultActionAttribute = options.defaultAction ? (' data-action="' + options.defaultAction + '"') : '';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue