diff --git a/src/addplugin.html b/src/addplugin.html index 5d5d5799d..adbf9aa0b 100644 --- a/src/addplugin.html +++ b/src/addplugin.html @@ -8,7 +8,7 @@

- ${Help} + ${Help}

diff --git a/src/components/directorybrowser/directorybrowser.js b/src/components/directorybrowser/directorybrowser.js index e4ceecc0c..aac45f86d 100644 --- a/src/components/directorybrowser/directorybrowser.js +++ b/src/components/directorybrowser/directorybrowser.js @@ -90,20 +90,11 @@ define(['loading', 'dialogHelper', 'dom', 'listViewStyle', 'emby-input', 'paper- html += '
'; html += instruction; html += Globalize.translate("MessageDirectoryPickerInstruction").replace("{0}", "\\\\server").replace("{1}", "\\\\192.168.1.101"); - if ("synology" === (systemInfo.PackageName || "").toLowerCase()) { - html += "
"; - html += "
"; - html += ''; - html += Globalize.translate("LearnHowToCreateSynologyShares"); - html += ""; - } else if ("bsd" === systemInfo.OperatingSystem.toLowerCase()) { + if ("bsd" === systemInfo.OperatingSystem.toLowerCase()) { html += "
"; html += "
"; html += Globalize.translate("MessageDirectoryPickerBSDInstruction"); html += "
"; - html += ''; - html += Globalize.translate("ButtonMoreInformation"); - html += ""; } else if ("linux" === systemInfo.OperatingSystem.toLowerCase()) { html += "
"; html += "
"; diff --git a/src/components/subtitleeditor/subtitleeditor.template.html b/src/components/subtitleeditor/subtitleeditor.template.html index 1b7027dbd..84ae6da0e 100644 --- a/src/components/subtitleeditor/subtitleeditor.template.html +++ b/src/components/subtitleeditor/subtitleeditor.template.html @@ -2,7 +2,7 @@

${Subtitles}

- ${Help} + ${Help}
diff --git a/src/components/tvproviders/schedulesdirect.template.html b/src/components/tvproviders/schedulesdirect.template.html index db215328e..49d8c37f8 100644 --- a/src/components/tvproviders/schedulesdirect.template.html +++ b/src/components/tvproviders/schedulesdirect.template.html @@ -1,7 +1,7 @@

Schedules Direct

- ${Help} + ${Help}

diff --git a/src/components/tvproviders/xmltv.template.html b/src/components/tvproviders/xmltv.template.html index 89ca753a7..45172019c 100644 --- a/src/components/tvproviders/xmltv.template.html +++ b/src/components/tvproviders/xmltv.template.html @@ -1,7 +1,7 @@

Xml TV

- ${Help} + ${Help}
diff --git a/src/controllers/notificationsettings.js b/src/controllers/notificationsettings.js index 092d92e24..ebb878841 100644 --- a/src/controllers/notificationsettings.js +++ b/src/controllers/notificationsettings.js @@ -22,7 +22,7 @@ define(["loading", "libraryMenu", "globalize", "listViewStyle", "emby-button"], itemHtml += ""; if (showHelp) { showHelp = false; - itemHtml += ''; + itemHtml += ''; itemHtml += globalize.translate("Help"); itemHtml += ""; } diff --git a/src/controllers/scheduledtaskspage.js b/src/controllers/scheduledtaskspage.js index 1580f1a4c..0f0fc715f 100644 --- a/src/controllers/scheduledtaskspage.js +++ b/src/controllers/scheduledtaskspage.js @@ -3,21 +3,63 @@ define(["jQuery", "loading", "events", "globalize", "serverNotifications", "huma function reloadList(page) { ApiClient.getScheduledTasks({ - isHidden: !1 + isHidden: false }).then(function(tasks) { - populateList(page, tasks), loading.hide() + populateList(page, tasks); + loading.hide(); }) } function populateList(page, tasks) { tasks = tasks.sort(function(a, b) { - return a = a.Category + " " + a.Name, b = b.Category + " " + b.Name, a == b ? 0 : a < b ? -1 : 1 + a = a.Category + " " + a.Name; + b = b.Category + " " + b.Name; + return a == b ? 0 : a < b ? -1 : 1; }); - for (var currentCategory, html = "", i = 0, length = tasks.length; i < length; i++) { + + var currentCategory; + var html = ""; + for (var i = 0; i < tasks.length; i++) { var task = tasks[i]; - task.Category != currentCategory && (currentCategory = task.Category, currentCategory && (html += "
", html += "
"), html += '
', html += '
', html += '

', html += currentCategory, html += "

", 0 === i && (html += '' + globalize.translate("Help") + ""), html += "
", html += '
'), html += '
', html += "", html += 'schedule', html += "", html += '", "Idle" == task.State ? html += '' : "Running" == task.State ? html += '' : html += '', html += "
" + if (task.Category != currentCategory) { + currentCategory = task.Category; + if (currentCategory) { + html += "
"; + html += "
"; + } + html += '
'; + html += '
'; + html += '

'; + html += currentCategory; + html += "

"; + if (i === 0) { + html += '' + globalize.translate("Help") + ""; + } + html += "
"; + html += '
'; + } + html += '
'; + html += ""; + html += 'schedule'; + html += ""; + html += '"; + if (task.State === "Running") { + html += ''; + } else { + html += ''; + } + html += "
"; } - tasks.length && (html += "
", html += "
"), page.querySelector(".divScheduledTasks").innerHTML = html + if (tasks.length) { + html += ""; + html += ""; + } + page.querySelector(".divScheduledTasks").innerHTML = html; } function humane_elapsed(firstDateStr, secondDateStr) { @@ -34,8 +76,18 @@ define(["jQuery", "loading", "events", "globalize", "serverNotifications", "huma function getTaskProgressHtml(task) { var html = ""; - if ("Idle" == task.State) task.LastExecutionResult && (html += globalize.translate("LabelScheduledTaskLastRan").replace("{0}", humane_date(task.LastExecutionResult.EndTimeUtc)).replace("{1}", humane_elapsed(task.LastExecutionResult.StartTimeUtc, task.LastExecutionResult.EndTimeUtc)), "Failed" == task.LastExecutionResult.Status ? html += " (" + globalize.translate("LabelFailed") + ")" : "Cancelled" == task.LastExecutionResult.Status ? html += " (" + globalize.translate("LabelCancelled") + ")" : "Aborted" == task.LastExecutionResult.Status && (html += " " + globalize.translate("LabelAbortedByServerShutdown") + "")); - else if ("Running" == task.State) { + if (task.State === "Idle") { + if (task.LastExecutionResult) { + html += globalize.translate("LabelScheduledTaskLastRan").replace("{0}", humane_date(task.LastExecutionResult.EndTimeUtc)).replace("{1}", humane_elapsed(task.LastExecutionResult.StartTimeUtc, task.LastExecutionResult.EndTimeUtc)); + if (task.LastExecutionResult.Status === "Failed") { + html += " (" + globalize.translate("LabelFailed") + ")"; + } else if (task.LastExecutionResult.Status === "Cancelled") { + html += " (" + globalize.translate("LabelCancelled") + ")"; + } else if (task.LastExecutionResult.Status === "Aborted") { + html += " " + globalize.translate("LabelAbortedByServerShutdown") + ""; + } + } + } else if (task.State === "Running") { var progress = (task.CurrentProgressPercentage || 0).toFixed(1); html += '
'; html += '
'; @@ -47,53 +99,88 @@ define(["jQuery", "loading", "events", "globalize", "serverNotifications", "huma } else { html += "" + globalize.translate("LabelStopping") + ""; } - return html + return html; } function updateTaskButton(elem, state) { - "Idle" == state ? (elem.classList.add("btnStartTask"), elem.classList.remove("btnStopTask"), elem.classList.remove("hide"), elem.querySelector("i").innerHTML = "play_arrow", elem.title = globalize.translate("ButtonStart")) : "Running" == state ? (elem.classList.remove("btnStartTask"), elem.classList.add("btnStopTask"), elem.classList.remove("hide"), elem.querySelector("i").innerHTML = "stop", elem.title = globalize.translate("ButtonStop")) : (elem.classList.add("btnStartTask"), elem.classList.remove("btnStopTask"), elem.classList.add("hide"), elem.querySelector("i").innerHTML = "play_arrow", elem.title = globalize.translate("ButtonStart")), $(elem).parents(".listItem")[0].setAttribute("data-status", state) + if (state === "Running") { + elem.classList.remove("btnStartTask"); + elem.classList.add("btnStopTask"); + elem.classList.remove("hide"); + elem.querySelector("i").innerHTML = "stop"; + elem.title = globalize.translate("ButtonStop"); + } else { + elem.classList.add("btnStartTask"); + elem.classList.remove("btnStopTask"); + elem.classList.add("hide"); + elem.querySelector("i").innerHTML = "play_arrow"; + elem.title = globalize.translate("ButtonStart"); + } + $(elem).parents(".listItem")[0].setAttribute("data-status", state); } + return function(view, params) { function updateTasks(tasks) { - for (var i = 0, length = tasks.length; i < length; i++) { + for (var i = 0; i < tasks.length; i++) { var task = tasks[i]; view.querySelector("#taskProgress" + task.Id).innerHTML = getTaskProgressHtml(task); - updateTaskButton(view.querySelector("#btnTask" + task.Id), task.State) + updateTaskButton(view.querySelector("#btnTask" + task.Id), task.State); } } function onPollIntervalFired() { - ApiClient.isMessageChannelOpen() || reloadList(view) + if (!ApiClient.isMessageChannelOpen()) { + reloadList(view); + } } function onScheduledTasksUpdate(e, apiClient, info) { - apiClient.serverId() === serverId && updateTasks(info) + if (apiClient.serverId() === serverId) { + updateTasks(info); + } } function startInterval() { - ApiClient.sendMessage("ScheduledTasksInfoStart", "1000,1000"), pollInterval && clearInterval(pollInterval), pollInterval = setInterval(onPollIntervalFired, 1e4) + ApiClient.sendMessage("ScheduledTasksInfoStart", "1000,1000"); + pollInterval && clearInterval(pollInterval); + pollInterval = setInterval(onPollIntervalFired, 1e4); } function stopInterval() { - ApiClient.sendMessage("ScheduledTasksInfoStop"), pollInterval && clearInterval(pollInterval) + ApiClient.sendMessage("ScheduledTasksInfoStop"); + pollInterval && clearInterval(pollInterval); } + var pollInterval, serverId = ApiClient.serverId(); + $(".divScheduledTasks", view).on("click", ".btnStartTask", function() { - var button = this, - id = button.getAttribute("data-taskid"); + var button = this; + var id = button.getAttribute("data-taskid"); ApiClient.startScheduledTask(id).then(function() { - updateTaskButton(button, "Running"), reloadList(view) + updateTaskButton(button, "Running"); + reloadList(view); }) - }).on("click", ".btnStopTask", function() { - var button = this, - id = button.getAttribute("data-taskid"); + }); + + $(".divScheduledTasks", view).on("click", ".btnStopTask", function() { + var button = this; + var id = button.getAttribute("data-taskid"); ApiClient.stopScheduledTask(id).then(function() { - updateTaskButton(button, ""), reloadList(view) + updateTaskButton(button, ""); + reloadList(view); }) - }), view.addEventListener("viewbeforehide", function() { - events.off(serverNotifications, "ScheduledTasksInfo", onScheduledTasksUpdate), stopInterval() - }), view.addEventListener("viewshow", function() { - loading.show(), startInterval(), reloadList(view), events.on(serverNotifications, "ScheduledTasksInfo", onScheduledTasksUpdate) - }) + }); + + view.addEventListener("viewbeforehide", function() { + events.off(serverNotifications, "ScheduledTasksInfo", onScheduledTasksUpdate); + stopInterval(); + }); + + view.addEventListener("viewshow", function() { + loading.show(); + startInterval(); + reloadList(view); + events.on(serverNotifications, "ScheduledTasksInfo", onScheduledTasksUpdate); + }); } }); diff --git a/src/dashboardgeneral.html b/src/dashboardgeneral.html index f41fc80d4..a285b0e55 100644 --- a/src/dashboardgeneral.html +++ b/src/dashboardgeneral.html @@ -8,7 +8,7 @@

${TabSettings}

- ${Help} + ${Help}
diff --git a/src/device.html b/src/device.html index da9610979..b7a696fd7 100644 --- a/src/device.html +++ b/src/device.html @@ -9,7 +9,7 @@
diff --git a/src/devices.html b/src/devices.html index 6997f42ed..3d8f4008d 100644 --- a/src/devices.html +++ b/src/devices.html @@ -4,7 +4,7 @@

${TabDevices}

- ${Help} + ${Help}
diff --git a/src/encodingsettings.html b/src/encodingsettings.html index 625088f56..6afde425a 100644 --- a/src/encodingsettings.html +++ b/src/encodingsettings.html @@ -8,7 +8,7 @@

${TabTranscoding}

- ${Help} + ${Help}
diff --git a/src/library.html b/src/library.html index 0182fe5f1..23d83044d 100644 --- a/src/library.html +++ b/src/library.html @@ -9,7 +9,7 @@ - ${Help} + ${Help}
diff --git a/src/livetvsettings.html b/src/livetvsettings.html index ff8db2dd3..6e91d1ce5 100644 --- a/src/livetvsettings.html +++ b/src/livetvsettings.html @@ -4,7 +4,7 @@

DVR

- ${Help} + ${Help}
diff --git a/src/livetvstatus.html b/src/livetvstatus.html index f6a0c8aeb..f2e2b4c4b 100644 --- a/src/livetvstatus.html +++ b/src/livetvstatus.html @@ -10,7 +10,7 @@ - ${Help} + ${Help}
diff --git a/src/livetvtuner.html b/src/livetvtuner.html index 71ddde77d..8528bfd55 100644 --- a/src/livetvtuner.html +++ b/src/livetvtuner.html @@ -5,7 +5,7 @@

${HeaderLiveTvTunerSetup}

- ${Help} + ${Help}
diff --git a/src/notificationsetting.html b/src/notificationsetting.html index 74fc3b19f..ffce9edbe 100644 --- a/src/notificationsetting.html +++ b/src/notificationsetting.html @@ -8,7 +8,7 @@

- ${Help} + ${Help}
diff --git a/src/scheduledtask.html b/src/scheduledtask.html index 75a70e779..ad47d8eb4 100644 --- a/src/scheduledtask.html +++ b/src/scheduledtask.html @@ -5,7 +5,7 @@

- ${Help} + ${Help}

diff --git a/src/scripts/medialibrarypage.js b/src/scripts/medialibrarypage.js index 91123ec1e..0240d565b 100644 --- a/src/scripts/medialibrarypage.js +++ b/src/scripts/medialibrarypage.js @@ -190,14 +190,15 @@ define(["jQuery", "apphost", "scripts/taskbutton", "loading", "libraryMenu", "gl }, { name: globalize.translate("FolderTypeMovies"), value: "movies", - message: getLink("MovieLibraryHelp", "https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Movie-naming") + message: getLink("MovieLibraryHelp", "https://jellyfin.readthedocs.io/en/latest/media/movies/") }, { name: globalize.translate("FolderTypeMusic"), - value: "music" + value: "music", + message: getLink("MovieLibraryHelp", "https://jellyfin.readthedocs.io/en/latest/media/music/") }, { name: globalize.translate("FolderTypeTvShows"), value: "tvshows", - message: getLink("TvLibraryHelp", "https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/TV-naming") + message: getLink("TvLibraryHelp", "https://jellyfin.readthedocs.io/en/latest/media/shows/") }, { name: globalize.translate("FolderTypeBooks"), value: "books", diff --git a/src/useredit.html b/src/useredit.html index 764c4adb1..1efaff555 100644 --- a/src/useredit.html +++ b/src/useredit.html @@ -6,7 +6,7 @@

- ${Help} + ${Help}
diff --git a/src/userlibraryaccess.html b/src/userlibraryaccess.html index bcf729acf..2a21c2f41 100644 --- a/src/userlibraryaccess.html +++ b/src/userlibraryaccess.html @@ -6,7 +6,7 @@

- ${Help} + ${Help}
diff --git a/src/usernew.html b/src/usernew.html index 2e90df813..55eda8ea7 100644 --- a/src/usernew.html +++ b/src/usernew.html @@ -7,7 +7,7 @@

${HeaderAddUser}

- ${Help} + ${Help}
diff --git a/src/userparentalcontrol.html b/src/userparentalcontrol.html index 83cfa176f..d1c9c3350 100644 --- a/src/userparentalcontrol.html +++ b/src/userparentalcontrol.html @@ -5,7 +5,7 @@ diff --git a/src/userpassword.html b/src/userpassword.html index b301c412b..29b78acc4 100644 --- a/src/userpassword.html +++ b/src/userpassword.html @@ -5,7 +5,7 @@ diff --git a/src/userprofiles.html b/src/userprofiles.html index c23be1317..aee6e9f2c 100644 --- a/src/userprofiles.html +++ b/src/userprofiles.html @@ -10,7 +10,7 @@ - ${Help} + ${Help}
diff --git a/src/wizardlibrary.html b/src/wizardlibrary.html index cb7420c63..16dd9488a 100644 --- a/src/wizardlibrary.html +++ b/src/wizardlibrary.html @@ -8,7 +8,7 @@

${HeaderSetupLibrary}

- +