diff --git a/ApiClient.js b/ApiClient.js index 49ce5fd95..7a90b12c9 100644 --- a/ApiClient.js +++ b/ApiClient.js @@ -687,6 +687,16 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi }); }; + self.clearOrganizationLog = function () { + + var url = self.getUrl("Library/FileOrganizations"); + + return self.ajax({ + type: "DELETE", + url: url + }); + }; + self.performOrganization = function (id) { var url = self.getUrl("Library/FileOrganizations/" + id + "/Organize"); @@ -697,6 +707,16 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi }); }; + self.performEpisodeOrganization = function (id, options) { + + var url = self.getUrl("Library/FileOrganizations/" + id + "/Episode/Organize", options || {}); + + return self.ajax({ + type: "POST", + url: url + }); + }; + self.getLiveTvSeriesTimer = function (id) { if (!id) { @@ -2984,7 +3004,14 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi throw new Error("null userId"); } - var url = self.getUrl("Users/" + userId + "/Items", options); + var url; + + if ((typeof userId).toString().toLowerCase() == 'string') { + url = self.getUrl("Users/" + userId + "/Items", options); + } else { + options = userId; + url = self.getUrl("Items", options || {}); + } return self.ajax({ type: "GET", diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index 4c04b9609..666dc49d9 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -828,7 +828,7 @@ progress { } .latestNewsItems { - max-width: 300px; + max-width: 280px; } .dashboardHomeRightColumn { @@ -836,6 +836,13 @@ progress { } } +@media all and (min-width: 1500px) { + + .latestNewsItems { + max-width: 300px; + } +} + @media all and (min-width: 1600px) { .latestNewsItems { @@ -854,4 +861,13 @@ progress { .organizerButton { margin-top: 0; margin-bottom: 0; -} \ No newline at end of file +} + +.btnShowStatusMessage { + font-weight: normal!important; + text-decoration: none; +} + + .btnShowStatusMessage:hover { + text-decoration: underline; + } diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index aff0927cf..c8433ab48 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -157,10 +157,6 @@
-
-
-
-
Details @@ -179,6 +175,10 @@

+
+
+
+
Trailers diff --git a/dashboard-ui/libraryfileorganizerlog.html b/dashboard-ui/libraryfileorganizerlog.html index c10a3fadf..76233fd41 100644 --- a/dashboard-ui/libraryfileorganizerlog.html +++ b/dashboard-ui/libraryfileorganizerlog.html @@ -14,28 +14,89 @@ TV Settings
-
-
+
+
+ + +
- +
+ - -
Date Source DestinationResult

+
+
+ Completed +
+ Failed +
+ Skipped +
+ + + +
diff --git a/dashboard-ui/scripts/libraryfileorganizerlog.js b/dashboard-ui/scripts/libraryfileorganizerlog.js index c0abea0c9..a6153c4d4 100644 --- a/dashboard-ui/scripts/libraryfileorganizerlog.js +++ b/dashboard-ui/scripts/libraryfileorganizerlog.js @@ -30,14 +30,14 @@ })[0]; - var message = 'The following file will be deleted:

' + item.OriginalPath + '

Are you sure you wish to proceed?

'; + var message = 'The following file will be deleted:

' + item.OriginalPath + '

Are you sure you wish to proceed?

'; Dashboard.confirm(message, "Delete File", function (confirmResult) { if (confirmResult) { Dashboard.showLoadingMsg(); - + ApiClient.deleteOriginalFileFromOrganizationResult(id).done(function () { Dashboard.hideLoadingMsg(); @@ -50,6 +50,55 @@ }); } + function organizeEpsiodeWithCorrections(page, item) { + + Dashboard.showLoadingMsg(); + + ApiClient.getItems({ + recursive: true, + includeItemTypes: 'Series', + sortBy: 'SortName' + + }).done(function (result) { + + Dashboard.hideLoadingMsg(); + + showEpisodeCorrectionPopup(page, item, result.Items); + }); + + } + + function showEpisodeCorrectionPopup(page, item, allSeries) { + + var popup = $('.episodeCorrectionPopup', page).popup("open"); + + $('.inputFile', popup).html(item.OriginalFileName); + + $('#txtSeason', popup).val(item.ExtractedSeasonNumber); + $('#txtEpisode', popup).val(item.ExtractedEpisodeNumber); + $('#txtEndingEpisode', popup).val(item.ExtractedEndingEpisodeNumber); + + $('#hfResultId', popup).val(item.Id); + + if (item.ExtractedName) { + $('#fldRememberCorrection', popup).hide(); + } else { + $('#fldRememberCorrection', popup).hide(); + } + + $('#chkRememberEpisodeCorrection', popup).checked(false).checkboxradio('refresh'); + + var seriesHtml = allSeries.map(function (s) { + + return ''; + + }).join(''); + + seriesHtml = '' + seriesHtml; + + $('#selectSeries', popup).html(seriesHtml).selectmenu('refresh'); + } + function organizeFile(page, id) { var item = currentResult.Items.filter(function (i) { @@ -57,7 +106,16 @@ })[0]; - var message = 'The following file will be moved from:

' + item.OriginalPath + '

to:

' + item.TargetPath + '

Are you sure you wish to proceed?

'; + if (!item.TargetPath) { + + if (item.Type == "Episode") { + organizeEpsiodeWithCorrections(page, item); + } + + return; + } + + var message = 'The following file will be moved from:

' + item.OriginalPath + '

to:

' + item.TargetPath + '

Are you sure you wish to proceed?

'; Dashboard.confirm(message, "Organize File", function (confirmResult) { @@ -76,7 +134,34 @@ } }); + } + function submitEpisodeForm(form) { + + Dashboard.showLoadingMsg(); + + var page = $(form).parents('.page'); + + var resultId = $('#hfResultId', form).val(); + + var options = { + + SeriesId: $('#selectSeries', form).val(), + SeasonNumber: $('#txtSeason', form).val(), + EpisodeNumber: $('#txtEpisode', form).val(), + EndingEpisodeNumber: $('#txtEndingEpisode', form).val(), + RememberCorrection: $('#chkRememberEpisodeCorrection', form).checked() + }; + + ApiClient.performEpisodeOrganization(resultId, options).done(function () { + + Dashboard.hideLoadingMsg(); + + $('.episodeCorrectionPopup', page).popup("close"); + + reloadItems(page); + + }); } function reloadItems(page) { @@ -133,6 +218,16 @@ html += ''; + html += ''; + + + if (item.Status != 'Success') { + html += ''; + html += ''; + } + + html += ''; + html += ''; var date = parseISO8601Date(item.Date, { toLocal: true }); @@ -141,32 +236,28 @@ html += ''; html += ''; - html += item.OriginalFileName || ''; + var status = item.Status; + + if (status == 'SkippedExisting') { + html += '
'; + html += item.OriginalFileName; + html += '
'; + } + else if (status == 'Failure') { + html += ''; + html += item.OriginalFileName; + html += ''; + } else { + html += '
'; + html += item.OriginalFileName; + html += '
'; + } html += ''; html += ''; html += item.TargetPath || ''; html += ''; - html += ''; - html += getStatusText(item, true); - html += ''; - - html += ''; - - - if (item.Status == 'SkippedExisting') { - html += ''; - } else { - html += ''; - } - - if (item.Status != 'Success') { - html += ''; - } - - html += ''; - html += ''; return html; @@ -218,9 +309,29 @@ query.StartIndex -= query.Limit; reloadItems(page); }); + + if (result.TotalRecordCount) { + $('.btnClearLog', page).show(); + $('.legend', page).show(); + } else { + $('.btnClearLog', page).hide(); + $('.legend', page).hide(); + } } - $(document).on('pageshow', "#libraryFileOrganizerLogPage", function () { + $(document).on('pageinit', "#libraryFileOrganizerLogPage", function () { + + var page = this; + + $('.btnClearLog', page).on('click', function () { + + ApiClient.clearOrganizationLog().done(function () { + reloadItems(page); + }); + + }); + + }).on('pageshow', "#libraryFileOrganizerLogPage", function () { var page = this; @@ -231,4 +342,13 @@ currentResult = null; }); + window.OrganizerLogPage = { + + onEpisodeCorrectionFormSubmit: function () { + + submitEpisodeForm(this); + return false; + } + }; + })(jQuery, document, window); diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index c8464a957..f9619353f 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -21,6 +21,8 @@ var timeout; var idleState = true; + var msieWebmMessage = "For more reliable video playback with Internet Explorer desktop edition, please install google's webm plugin for IE.

https://tools.google.com/dlpage/webmmf"; + self.playlist = []; var currentPlaylistIndex = 0; @@ -180,6 +182,11 @@ currentProgressInterval = null; } } + + function canPlayWebm() { + + return testableVideoElement.canPlayType('video/webm').replace(/no/, ''); + } function getTranscodingExtension() { @@ -192,7 +199,7 @@ } // Chrome or IE with plugin installed - if (media.canPlayType('video/webm').replace(/no/, '') && !$.browser.mozilla) { + if (canPlayWebm() && !$.browser.mozilla) { return '.webm'; } @@ -896,6 +903,10 @@ if (item.Type == "Channel") { errorMsg += " Please ensure there is an open tuner availalble."; } + + if ($.browser.msie && !canPlayWebm()) { + errorMsg += " " + msieWebmMessage; + } Dashboard.alert({ title: 'Video Error', @@ -1079,9 +1090,9 @@ return; } } - else if ($.browser.msie && videoType) { + else if ($.browser.msie && videoType && !canPlayWebm()) { - self.playWithWarning(items, startPosition, user, "iewebmplugin", "Internet Explorer Playback", "For optimal video playback of Internet Explorer desktop edition, please install google's webm plugin for IE.

https://tools.google.com/dlpage/webmmf"); + self.playWithWarning(items, startPosition, user, "iewebmplugin", "Internet Explorer Playback", msieWebmMessage); return; } @@ -1093,7 +1104,9 @@ self.playWithWarning = function (items, startPosition, user, localStorageKeyName, header, text) { - localStorageKeyName += new Date().getMonth(); + // Increment this version when changes are made and we want users to see the prompts again + var warningVersion = "2"; + localStorageKeyName += new Date().getMonth() + warningVersion; if (localStorage.getItem(localStorageKeyName) == "1") { diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 049bbb345..38e26a83a 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -393,9 +393,9 @@ var Dashboard = { confirmInternal: function (message, title, showCancel, callback) { - $('#confirmFlyout').popup("close").remove(); + $('.confirmFlyout').popup("close").remove(); - var html = '
'; + var html = '
'; html += '
'; html += '

' + title + '

'; @@ -407,10 +407,10 @@ var Dashboard = { html += message; html += '
'; - html += '

'; + html += '

'; if (showCancel) { - html += '

'; + html += '

'; } html += '
'; @@ -419,7 +419,7 @@ var Dashboard = { $(document.body).append(html); - $('#confirmFlyout').popup({ history: false }).trigger('create').popup("open").on("popupafterclose", function () { + $('.confirmFlyout').popup({ history: false }).trigger('create').popup("open").on("popupafterclose", function () { if (callback) { callback(this.confirm == true); diff --git a/packages.config b/packages.config index 3f77d9541..d1427603d 100644 --- a/packages.config +++ b/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file