Update Suggested change

This commit is contained in:
grafixeyehero 2019-10-08 19:54:02 +03:00
parent 307e664286
commit e7570d856f
6 changed files with 106 additions and 84 deletions

View File

@ -312,27 +312,21 @@ define(["connectionManager", "listView", "cardBuilder", "imageLoader", "libraryB
}
function addCurrentItemToQuery(query, item) {
if ("Person" == item.Type) {
if (item.Type == "Person") {
query.PersonIds = item.Id;
} else {
if ("Genre" == item.Type) {
query.GenreIds = item.Id;
} else if (item.Type == "Genre") {
query.Genres = item.Name;
} else if (item.Type == "MusicGenre") {
query.Genres = item.Name;
} else if (item.Type == "GameGenre") {
query.Genres = item.Name;
} else if (item.Type == "Studio") {
query.StudioIds = item.Id;
} else if (item.Type == "MusicArtist") {
if (connectionManager.getApiClient(item.ServerId).isMinServerVersion("3.4.1.18")) {
query.AlbumArtistIds = item.Id;
} else {
if ("MusicGenre" == item.Type) {
query.GenreIds = item.Id;
} else {
if ("Studio" == item.Type) {
query.StudioIds = item.Id;
} else {
if ("MusicArtist" == item.Type) {
if (connectionManager.getApiClient(item.ServerId).isMinServerVersion("3.4.1.18")) {
query.AlbumArtistIds = item.Id;
} else {
query.ArtistIds = item.Id;
}
}
}
}
query.ArtistIds = item.Id;
}
}
}

View File

@ -156,11 +156,10 @@ define(["userSettings"], function (userSettings) {
html += '<h2 style="margin:0 0 .5em;">';
html += Globalize.translate("HeaderSortBy");
html += "</h2>";
var i;
var length;
var i, length;
var isChecked;
for (html += "<div>", i = 0, length = options.items.length; i < length; i++) {
html += '<div>';
for (i = 0, length = options.items.length; i < length; i++) {
var option = options.items[i];
var radioValue = option.id.replace(",", "_");
isChecked = (options.query.SortBy || "").replace(",", "_") == radioValue ? " checked" : "";

View File

@ -206,8 +206,9 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder btnLogout" data-itemid="logout" href="#"><i class="md-icon navMenuOptionIcon">exit_to_app</i><span class="navMenuOptionText">' + globalize.translate("ButtonSignOut") + "</span></a>";
html += "</div>";
} // add buttons to navigation drawer
}
// add buttons to navigation drawer
navDrawerScrollContainer.innerHTML = html; // bind logout button click to method
@ -501,8 +502,9 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
showBySelector(".libraryMenuDownloads", false);
showBySelector(".lnkSyncToOtherDevices", false);
return void showBySelector(".userMenuOptions", false);
} // FIXME: Potentially the same as above
}
// FIXME: Potentially the same as above
if (user.Policy.EnableContentDownloading) {
showBySelector(".lnkSyncToOtherDevices", true);

View File

@ -6,11 +6,7 @@ define(["layoutManager", "datetime", "cardBuilder", "apphost"], function (layout
}
function getBackdropShape() {
if (enableScrollX()) {
return "overflowBackdrop";
}
return "backdrop";
return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
}
function getTimersHtml(timers, options) {
@ -29,7 +25,7 @@ define(["layoutManager", "datetime", "cardBuilder", "apphost"], function (layout
var item = items[i];
var dateText = "";
if (false !== options.indexByDate && item.StartDate) {
if (options.indexByDate !== false && item.StartDate) {
try {
var premiereDate = datetime.parseISO8601Date(item.StartDate, true);
dateText = datetime.toLocaleDateString(premiereDate, {
@ -69,7 +65,12 @@ define(["layoutManager", "datetime", "cardBuilder", "apphost"], function (layout
var supportsImageAnalysis = appHost.supports("imageanalysis");
var cardLayout = appHost.preferVisualCards || supportsImageAnalysis;
if (cardLayout = true, group.name && (html += '<div class="verticalSection">', html += '<h2 class="sectionTitle sectionTitle-cards padded-left">' + group.name + "</h2>"), enableScrollX()) {
cardLayout = true;
if (group.name) {
html += '<div class="verticalSection">';
html += '<h2 class="sectionTitle sectionTitle-cards padded-left">' + group.name + "</h2>";
}
if (enableScrollX()) {
var scrollXClass = "scrollX hiddenScrollX";
if (layoutManager.tv) {

View File

@ -85,36 +85,46 @@ define(["loading", "listView", "cardBuilder", "libraryMenu", "libraryBrowser", "
});
if (result.TotalRecordCount) {
html = "List" == viewStyle ? listView.getListViewHtml({
items: result.Items,
sortBy: query.SortBy
}) : "PosterCard" == viewStyle ? cardBuilder.getCardsHtml({
items: result.Items,
shape: "square",
coverImage: true,
showTitle: true,
cardLayout: true
}) : "Thumb" == viewStyle ? cardBuilder.getCardsHtml({
items: result.Items,
shape: "backdrop",
showTitle: true,
centerText: true,
preferThumb: true,
overlayPlayButton: true
}) : "ThumbCard" == viewStyle ? cardBuilder.getCardsHtml({
items: result.Items,
shape: "backdrop",
showTitle: true,
preferThumb: true,
cardLayout: true
}) : cardBuilder.getCardsHtml({
items: result.Items,
shape: "square",
showTitle: true,
coverImage: true,
centerText: true,
overlayPlayButton: true
});
if (viewStyle == "List") {
html = listView.getListViewHtml({
items: result.Items,
sortBy: query.SortBy
});
} else if (viewStyle == "PosterCard") {
html = cardBuilder.getCardsHtml({
items: result.Items,
shape: "square",
coverImage: true,
showTitle: true,
cardLayout: true
});
} else if (viewStyle == "Thumb") {
html = cardBuilder.getCardsHtml({
items: result.Items,
shape: "backdrop",
showTitle: true,
centerText: true,
preferThumb: true,
overlayPlayButton: true
});
} else if (viewStyle == "ThumbCard") {
html = cardBuilder.getCardsHtml({
items: result.Items,
shape: "backdrop",
showTitle: true,
preferThumb: true,
cardLayout: true
});
} else {
html = cardBuilder.getCardsHtml({
items: result.Items,
shape: "square",
showTitle: true,
coverImage: true,
centerText: true,
overlayPlayButton: true
});
}
view.querySelector(".noItemsMessage").classList.add("hide");
} else {
view.querySelector(".noItemsMessage").classList.remove("hide");

View File

@ -13,32 +13,48 @@ define(["events", "userSettings", "serverNotifications", "connectionManager", "e
return t.Key == options.taskKey;
})[0];
if (options.panel && (task ? options.panel.classList.remove("hide") : options.panel.classList.add("hide")), task) {
if ("Idle" == task.State) {
button.removeAttribute("disabled");
if (options.panel) {
if (task) {
options.panel.classList.remove('hide');
} else {
button.setAttribute("disabled", "disabled");
options.panel.classList.add('hide');
}
}
button.setAttribute("data-taskid", task.Id);
var progress = (task.CurrentProgressPercentage || 0).toFixed(1);
if (!task) {
return;
}
if (options.progressElem && (options.progressElem.value = progress, "Running" == task.State ? options.progressElem.classList.remove("hide") : options.progressElem.classList.add("hide")), options.lastResultElem) {
var lastResult = task.LastExecutionResult ? task.LastExecutionResult.Status : "";
if (task.State == 'Idle') {
button.removeAttribute("disabled");
} else {
button.setAttribute("disabled", "disabled");
}
if ("Failed" == lastResult) {
options.lastResultElem.html('<span style="color:#FF0000;">(' + Globalize.translate("LabelFailed") + ")</span>");
} else {
if ("Cancelled" == lastResult) {
options.lastResultElem.html('<span style="color:#0026FF;">(' + Globalize.translate("LabelCancelled") + ")</span>");
} else {
if ("Aborted" == lastResult) {
options.lastResultElem.html('<span style="color:#FF0000;">' + Globalize.translate("LabelAbortedByServerShutdown") + "</span>");
} else {
options.lastResultElem.html(lastResult);
}
}
}
button.setAttribute("data-taskid", task.Id);
var progress = (task.CurrentProgressPercentage || 0).toFixed(1);
if (options.progressElem) {
options.progressElem.value = progress;
if (task.State == 'Running') {
options.progressElem.classList.remove('hide');
} else {
options.progressElem.classList.add('hide');
}
}
if (options.lastResultElem) {
var lastResult = task.LastExecutionResult ? task.LastExecutionResult.Status : '';
if (lastResult == "Failed") {
options.lastResultElem.html('<span style="color:#FF0000;">(' + Globalize.translate('LabelFailed') + ')</span>');
} else if (lastResult == "Cancelled") {
options.lastResultElem.html('<span style="color:#0026FF;">(' + Globalize.translate('LabelCancelled') + ')</span>');
} else if (lastResult == "Aborted") {
options.lastResultElem.html('<span style="color:#FF0000;">' + Globalize.translate('LabelAbortedByServerShutdown') + '</span>');
} else {
options.lastResultElem.html(lastResult);
}
}
}
@ -71,7 +87,7 @@ define(["events", "userSettings", "serverNotifications", "connectionManager", "e
options.panel.classList.add("hide");
}
if ("off" == options.mode) {
if (options.mode == 'off') {
button.removeEventListener("click", onButtonClick);
events.off(serverNotifications, "ScheduledTasksInfo", onScheduledTasksUpdate);