mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
mark games played when played through nesbox
This commit is contained in:
parent
ef106f264a
commit
30dd80deae
6 changed files with 53 additions and 58 deletions
|
@ -74,7 +74,7 @@
|
|||
$('#playButtonContainer', page).show();
|
||||
$('#playExternalButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
|
||||
$('#btnPlayExternal', page).attr('href', url || '#');
|
||||
|
||||
} else {
|
||||
|
@ -1045,6 +1045,11 @@
|
|||
LibraryBrowser.showPlayMenu(this, currentItem.Id, currentItem.Type, mediaType, userdata.PlaybackPositionTicks);
|
||||
});
|
||||
|
||||
$('#btnPlayExternal', page).on('click', function () {
|
||||
|
||||
ApiClient.markPlayed(Dashboard.getCurrentUserId(), currentItem.Id, new Date());
|
||||
});
|
||||
|
||||
$('#btnEdit', page).on('click', function () {
|
||||
|
||||
Dashboard.navigate("edititemmetadata.html?id=" + currentItem.Id);
|
||||
|
|
|
@ -10,16 +10,14 @@
|
|||
SortOrder: "Descending",
|
||||
MediaTypes: "Game",
|
||||
Limit: 5,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio",
|
||||
Filters: "IsUnplayed"
|
||||
Recursive: true
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
useAverageAspectRatio: true,
|
||||
useAverageAspectRatio: false,
|
||||
showNewIndicator: false,
|
||||
transparent: true,
|
||||
borderless: true
|
||||
|
@ -34,7 +32,6 @@
|
|||
MediaTypes: "Game",
|
||||
Limit: 5,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio",
|
||||
Filters: "IsPlayed"
|
||||
};
|
||||
|
||||
|
@ -48,35 +45,7 @@
|
|||
|
||||
$('#recentlyPlayedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
useAverageAspectRatio: true,
|
||||
transparent: true,
|
||||
borderless: true
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
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,
|
||||
useAverageAspectRatio: false,
|
||||
transparent: true,
|
||||
borderless: true
|
||||
}));
|
||||
|
|
|
@ -1519,7 +1519,11 @@
|
|||
|
||||
var markAsPlayed = $link.hasClass('imgPlayedOff');
|
||||
|
||||
ApiClient.updatePlayedStatus(Dashboard.getCurrentUserId(), id, markAsPlayed);
|
||||
if (markAsPlayed) {
|
||||
ApiClient.markPlayed(Dashboard.getCurrentUserId(), id);
|
||||
} else {
|
||||
ApiClient.markUnplayed(Dashboard.getCurrentUserId(), id);
|
||||
}
|
||||
|
||||
if (markAsPlayed) {
|
||||
link.src = "css/images/userdata/playedon.png";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue