mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
progress bars on resumable items
This commit is contained in:
parent
75ff5c8f43
commit
fd54e02387
6 changed files with 117 additions and 25 deletions
|
@ -534,6 +534,13 @@
|
|||
html += "</div>";
|
||||
}
|
||||
|
||||
if (options.showProgressBar) {
|
||||
|
||||
html += "<div class='posterItemText posterItemProgress'>";
|
||||
html += LibraryBrowser.getItemProgressBarHtml(item, true) || " ";
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
if (options.showNewIndicator !== false) {
|
||||
html += LibraryBrowser.getNewIndicatorHtml(item);
|
||||
}
|
||||
|
@ -785,7 +792,7 @@
|
|||
return html;
|
||||
},
|
||||
|
||||
getUserDataIconsHtml: function (item) {
|
||||
getItemProgressBarHtml: function (item, showProgressText) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
@ -795,7 +802,7 @@
|
|||
if (item.PlayedPercentage) {
|
||||
|
||||
tooltip = Math.round(item.PlayedPercentage) + '% played';
|
||||
|
||||
|
||||
pct = item.PlayedPercentage;
|
||||
}
|
||||
else if (item.UserData && item.UserData.PlaybackPositionTicks && item.RunTimeTicks) {
|
||||
|
@ -809,8 +816,21 @@
|
|||
|
||||
html += '<progress title="' + tooltip + '" class="itemProgressBar" min="0" max="100" value="' + pct + '">';
|
||||
html += '</progress>';
|
||||
|
||||
if (showProgressText) {
|
||||
html += '<span class="itemProgressText">' + tooltip + '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
getUserDataIconsHtml: function (item) {
|
||||
|
||||
var html = '';
|
||||
|
||||
html += LibraryBrowser.getItemProgressBarHtml(item);
|
||||
|
||||
var userData = item.UserData || {};
|
||||
|
||||
var itemId = item.Id;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
IncludeItemTypes: "Movie",
|
||||
Limit: 7,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio",
|
||||
Fields: "PrimaryImageAspectRatio,DateCreated,UserData",
|
||||
Filters: "IsUnplayed"
|
||||
};
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
|||
Filters: "IsResumable",
|
||||
Limit: 7,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio"
|
||||
Fields: "PrimaryImageAspectRatio,DateCreated,UserData"
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
@ -47,7 +47,8 @@
|
|||
|
||||
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
useAverageAspectRatio: true
|
||||
useAverageAspectRatio: true,
|
||||
showProgressBar: true
|
||||
}));
|
||||
|
||||
});
|
||||
|
@ -60,7 +61,7 @@
|
|||
IncludeItemTypes: "Trailer",
|
||||
Limit: 7,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,DateCreated",
|
||||
Fields: "PrimaryImageAspectRatio,DateCreated,UserData",
|
||||
Filters: "IsUnplayed"
|
||||
};
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
var html = '';
|
||||
var plugin = availablePlugins[i];
|
||||
|
||||
html += "<a class='posterItem smallBackdropPosterItem transparentPosterItem' href='addPlugin.html?name=" + encodeURIComponent(plugin.name) + "'>";
|
||||
html += "<a class='posterItem backdropPosterItem transparentPosterItem' href='addPlugin.html?name=" + encodeURIComponent(plugin.name) + "'>";
|
||||
|
||||
if (plugin.thumbImage) {
|
||||
html += '<div class="posterItemImage" style="background-image:url(\'' + plugin.thumbImage + '\');"></div>';
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
SortBy: "DateCreated",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Episode",
|
||||
Limit: 6,
|
||||
Limit: 8,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo",
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData",
|
||||
Filters: "IsUnplayed"
|
||||
};
|
||||
|
||||
|
@ -34,9 +34,9 @@
|
|||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Episode",
|
||||
Filters: "IsResumable",
|
||||
Limit: 6,
|
||||
Limit: 8,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated"
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData",
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
@ -52,7 +52,8 @@
|
|||
useAverageAspectRatio: true,
|
||||
shape: "backdrop",
|
||||
showTitle: true,
|
||||
showParentTitle: true
|
||||
showParentTitle: true,
|
||||
showProgressBar: true
|
||||
}));
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue