mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixed userdata calls
This commit is contained in:
parent
3d31aa2470
commit
dbbca7ef4d
6 changed files with 19 additions and 12 deletions
16
ApiClient.js
16
ApiClient.js
|
@ -213,7 +213,17 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
|
|||
*/
|
||||
self.getRootFolder = function (userId) {
|
||||
|
||||
return self.getItem(userId);
|
||||
if (!userId) {
|
||||
throw new Error("null userId");
|
||||
}
|
||||
|
||||
var url = self.getUrl("Users/" + userId + "/Items/Root");
|
||||
|
||||
return self.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
dataType: "json"
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1577,7 +1587,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
|
|||
throw new Error("null itemId");
|
||||
}
|
||||
|
||||
var url = "Users/" + userId + "/PlayedItems/" + itemId;
|
||||
var url = self.getUrl("Users/" + userId + "/PlayedItems/" + itemId);
|
||||
|
||||
var method = wasPlayed ? "POST" : "DELETE";
|
||||
|
||||
|
@ -1604,7 +1614,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
|
|||
throw new Error("null itemId");
|
||||
}
|
||||
|
||||
var url = "Users/" + userId + "/FavoriteItems/" + itemId;
|
||||
var url = self.getUrl("Users/" + userId + "/FavoriteItems/" + itemId);
|
||||
|
||||
var method = isFavorite ? "POST" : "DELETE";
|
||||
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
<span id="itemName"></span>
|
||||
|
||||
<div style="display: inline-block; margin-left: 50px;">
|
||||
<button id="btnSort" type="button" data-icon="sort" data-mini="true" data-inline="true" onclick="$('#sortPanel', $.mobile.activePage).panel( 'toggle' );">Sort</button>
|
||||
<button id="btnOptions" type="button" data-icon="table" data-mini="true" data-inline="true" onclick="$('#optionsPanel', $.mobile.activePage).panel( 'toggle' );">Change View</button>
|
||||
</div>
|
||||
</h1>
|
||||
|
||||
<div id="listItems"></div>
|
||||
|
||||
<div data-role="panel" id="sortPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true">
|
||||
<div data-role="panel" id="optionsPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true">
|
||||
|
||||
<form>
|
||||
<fieldset data-role="controlgroup">
|
||||
|
|
|
@ -731,9 +731,9 @@
|
|||
}
|
||||
|
||||
if (userData.IsFavorite) {
|
||||
html += '<img class="imgUserItemRating" src="css/images/userdata/heart_on.png" alt="Remove favorite" title="Remove favorite" onclick="ItemDetailPage.setFavorite();" />';
|
||||
html += '<img class="imgUserItemRating" src="css/images/userdata/heart_on.png" alt="Favorite" title="Remove favorite" onclick="ItemDetailPage.setFavorite();" />';
|
||||
} else {
|
||||
html += '<img class="imgUserItemRating" src="css/images/userdata/heart_off.png" alt="Mark favorite" title="Mark favorite" onclick="ItemDetailPage.setFavorite();" />';
|
||||
html += '<img class="imgUserItemRating" src="css/images/userdata/heart_off.png" alt="Favorite" title="Mark favorite" onclick="ItemDetailPage.setFavorite();" />';
|
||||
}
|
||||
|
||||
$('#itemRatings', page).html(html);
|
||||
|
|
|
@ -27,13 +27,10 @@
|
|||
|
||||
refreshItems: function (query) {
|
||||
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
|
||||
page.itemQuery = query;
|
||||
|
||||
$('#btnSort', page).html(query.SortBy).button("refresh");
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(ItemListPage.renderItems);
|
||||
},
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<div class="wizardNavigation">
|
||||
<button type="button" data-iconpos="left" data-icon="arrow-left" data-inline="true" onclick="history.back();">Previous</button>
|
||||
<button type="button" data-iconpos="right" data-icon="wrench" data-inline="true" onclick="WizardFinishPage.onFinish();" data-theme="b">Go to the Dashboard</button>
|
||||
<button type="button" data-iconpos="right" data-icon="dashboard" data-inline="true" onclick="WizardFinishPage.onFinish();" data-theme="b">Go to the Dashboard</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.68" targetFramework="net45" />
|
||||
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.70" targetFramework="net45" />
|
||||
<package id="ServiceStack.Common" version="3.9.42" targetFramework="net45" />
|
||||
<package id="ServiceStack.Text" version="3.9.42" targetFramework="net45" />
|
||||
</packages>
|
Loading…
Add table
Add a link
Reference in a new issue