mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
a little attention to the games page
This commit is contained in:
parent
5783b78b08
commit
866c468d7e
4 changed files with 94 additions and 40 deletions
|
@ -21,10 +21,17 @@
|
||||||
<div id="recentlyAddedItems">
|
<div id="recentlyAddedItems">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="resumableSection" style="display: none;">
|
<div id="recentlyPlayedSection" style="display: none;">
|
||||||
<h1 class="listHeader">Latest Played Games</h1>
|
<h1 class="listHeader">Recently Played Games</h1>
|
||||||
|
|
||||||
<div id="resumableItems">
|
<div id="recentlyPlayedItems">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="frequentlyPlayedSection" style="display: none;">
|
||||||
|
<h1 class="listHeader">Frequently Played Games</h1>
|
||||||
|
|
||||||
|
<div id="frequentlyPlayedItems">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
SortOrder: "Ascending",
|
SortOrder: "Ascending",
|
||||||
MediaTypes: "Game",
|
MediaTypes: "Game",
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
Fields: "UserData,DisplayMediaType,Genres,Studios",
|
Fields: "UserData,DisplayMediaType,Genres,Studios,PrimaryImageAspectRatio",
|
||||||
StartIndex: 0
|
StartIndex: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,9 @@
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
useAverageAspectRatio: true,
|
useAverageAspectRatio: true,
|
||||||
showNewIndicator: false,
|
showNewIndicator: false,
|
||||||
transparent: true
|
transparent: true,
|
||||||
|
borderless: true,
|
||||||
|
imagePosition: 'center center'
|
||||||
}));
|
}));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -39,10 +41,47 @@
|
||||||
|
|
||||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||||
|
|
||||||
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
|
if (result.Items.length) {
|
||||||
|
$('#recentlyPlayedSection', page).show();
|
||||||
|
} else {
|
||||||
|
$('#recentlyPlayedSection', page).hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#recentlyPlayedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
useAverageAspectRatio: true,
|
useAverageAspectRatio: true,
|
||||||
transparent: true
|
transparent: true,
|
||||||
|
borderless: true,
|
||||||
|
imagePosition: 'center center'
|
||||||
|
}));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
SortBy: "PlayCount",
|
||||||
|
SortOrder: "Descending",
|
||||||
|
MediaTypes: "Game",
|
||||||
|
Limit: 5,
|
||||||
|
Recursive: true,
|
||||||
|
Fields: "PrimaryImageAspectRatio",
|
||||||
|
Filters: "IsPlayed"
|
||||||
|
};
|
||||||
|
|
||||||
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||||
|
|
||||||
|
if (result.Items.length) {
|
||||||
|
$('#frequentlyPlayedSection', page).show();
|
||||||
|
} else {
|
||||||
|
$('#frequentlyPlayedSection', page).hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#frequentlyPlayedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||||
|
items: result.Items,
|
||||||
|
useAverageAspectRatio: true,
|
||||||
|
transparent: true,
|
||||||
|
borderless: true,
|
||||||
|
imagePosition: 'center center'
|
||||||
}));
|
}));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -640,6 +640,10 @@
|
||||||
cssClass += " transparentPosterItem";
|
cssClass += " transparentPosterItem";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.borderless) {
|
||||||
|
cssClass += " borderlessPosterItem";
|
||||||
|
}
|
||||||
|
|
||||||
cssClass += ' ' + options.shape + 'PosterItem';
|
cssClass += ' ' + options.shape + 'PosterItem';
|
||||||
|
|
||||||
html += '<a class="' + cssClass + '" href="' + LibraryBrowser.getHref(item, options.context) + '">';
|
html += '<a class="' + cssClass + '" href="' + LibraryBrowser.getHref(item, options.context) + '">';
|
||||||
|
@ -654,6 +658,10 @@
|
||||||
style += "background-color:" + background + ";";
|
style += "background-color:" + background + ";";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.imagePosition) {
|
||||||
|
style += "background-position:" + options.imagePosition + ";";
|
||||||
|
}
|
||||||
|
|
||||||
html += '<div class="posterItemImage" style="' + style + '"></div>';
|
html += '<div class="posterItemImage" style="' + style + '"></div>';
|
||||||
|
|
||||||
var name = LibraryBrowser.getPosterViewDisplayName(item);
|
var name = LibraryBrowser.getPosterViewDisplayName(item);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue