diff --git a/dashboard-ui/autoorganizelog.html b/dashboard-ui/autoorganizelog.html index 419774564e..3639141499 100644 --- a/dashboard-ui/autoorganizelog.html +++ b/dashboard-ui/autoorganizelog.html @@ -1,11 +1,11 @@  + ${TitleAutoOrganize} -
- +
@@ -52,48 +52,6 @@
- -
diff --git a/dashboard-ui/autoorganizesmart.html b/dashboard-ui/autoorganizesmart.html index ea55d38de2..31d524feac 100644 --- a/dashboard-ui/autoorganizesmart.html +++ b/dashboard-ui/autoorganizesmart.html @@ -4,7 +4,7 @@ ${TitleAutoOrganize} -
+
diff --git a/dashboard-ui/bower_components/emby-apiclient/.bower.json b/dashboard-ui/bower_components/emby-apiclient/.bower.json index f3acb5d871..f80b550020 100644 --- a/dashboard-ui/bower_components/emby-apiclient/.bower.json +++ b/dashboard-ui/bower_components/emby-apiclient/.bower.json @@ -16,12 +16,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.0.35", - "_release": "1.0.35", + "version": "1.0.37", + "_release": "1.0.37", "_resolution": { "type": "version", - "tag": "1.0.35", - "commit": "d84b62c2a98faed179e07ef805e54cd7e6d2e036" + "tag": "1.0.37", + "commit": "b383fff379b92417525a3295ebbe3b7db9e0b1a4" }, "_source": "git://github.com/MediaBrowser/Emby.ApiClient.Javascript.git", "_target": "~1.0.3", diff --git a/dashboard-ui/bower_components/emby-apiclient/apiclient.js b/dashboard-ui/bower_components/emby-apiclient/apiclient.js index 4b112ab836..75d4fc5a25 100644 --- a/dashboard-ui/bower_components/emby-apiclient/apiclient.js +++ b/dashboard-ui/bower_components/emby-apiclient/apiclient.js @@ -3428,12 +3428,12 @@ }); }; - self.deleteSmartMatchEntry = function (name, options) { + self.deleteSmartMatchEntries = function (entries) { - var url = self.getUrl("Library/FileOrganizations/SmartMatches", options || {}); + var url = self.getUrl("Library/FileOrganizations/SmartMatches/Delete"); var postData = { - Name: name + Entries: entries }; return self.ajax({ diff --git a/dashboard-ui/components/collectioneditor/collectioneditor.js b/dashboard-ui/components/collectioneditor/collectioneditor.js index bba463a18e..834d822600 100644 --- a/dashboard-ui/components/collectioneditor/collectioneditor.js +++ b/dashboard-ui/components/collectioneditor/collectioneditor.js @@ -200,7 +200,7 @@ var title = items.length ? Globalize.translate('HeaderAddToCollection') : Globalize.translate('HeaderNewCollection'); html += '
'; - html += ''; + html += ''; html += '
'; html += title; html += '
'; diff --git a/dashboard-ui/components/fileorganizer/fileorganizer.js b/dashboard-ui/components/fileorganizer/fileorganizer.js new file mode 100644 index 0000000000..d51e75082b --- /dev/null +++ b/dashboard-ui/components/fileorganizer/fileorganizer.js @@ -0,0 +1,130 @@ +define(['paperdialoghelper', 'paper-checkbox', 'paper-input', 'paper-button'], function (paperDialogHelper) { + + function onApiFailure(e) { + + Dashboard.hideLoadingMsg(); + + Dashboard.alert({ + title: Globalize.translate('AutoOrganizeError'), + message: Globalize.translate('ErrorOrganizingFileWithErrorCode', e.getResponseHeader("X-Application-Error-Code")) + }); + } + + function initEpisodeForm(context, item) { + + $('.inputFile', context).html(item.OriginalFileName); + + $('#txtSeason', context).val(item.ExtractedSeasonNumber); + $('#txtEpisode', context).val(item.ExtractedEpisodeNumber); + $('#txtEndingEpisode', context).val(item.ExtractedEndingEpisodeNumber); + + $('#chkRememberCorrection', context).val(false); + + $('#hfResultId', context).val(item.Id); + + ApiClient.getItems(null, { + recursive: true, + includeItemTypes: 'Series', + sortBy: 'SortName' + + }).then(function (result) { + + var seriesHtml = result.Items.map(function (s) { + + return ''; + + }).join(''); + + seriesHtml = '' + seriesHtml; + + $('#selectSeries', context).html(seriesHtml); + + }, onApiFailure); + } + + function submitEpisodeForm(dlg) { + + Dashboard.showLoadingMsg(); + + var resultId = $('#hfResultId', dlg).val(); + + var options = { + + SeriesId: $('#selectSeries', dlg).val(), + SeasonNumber: $('#txtSeason', dlg).val(), + EpisodeNumber: $('#txtEpisode', dlg).val(), + EndingEpisodeNumber: $('#txtEndingEpisode', dlg).val(), + RememberCorrection: $('#chkRememberCorrection', dlg).checked() + }; + + ApiClient.performEpisodeOrganization(resultId, options).then(function () { + + Dashboard.hideLoadingMsg(); + + dlg.submitted = true; + paperDialogHelper.close(dlg); + + }, onApiFailure); + } + + return { + show: function (item) { + return new Promise(function (resolve, reject) { + + var xhr = new XMLHttpRequest(); + xhr.open('GET', 'components/fileorganizer/fileorganizer.template.html', true); + + xhr.onload = function (e) { + + var template = this.response; + var dlg = paperDialogHelper.createDialog({ + removeOnClose: true, + size: 'small' + }); + + dlg.classList.add('ui-body-a'); + dlg.classList.add('background-theme-a'); + + dlg.classList.add('formDialog'); + + var html = ''; + + html += Globalize.translateDocument(template); + + dlg.innerHTML = html; + document.body.appendChild(dlg); + + dlg.querySelector('.dialogHeaderTitle').innerHTML = Globalize.translate('FileOrganizeManually'); + + paperDialogHelper.open(dlg); + + dlg.addEventListener('iron-overlay-closed', function () { + + if (dlg.submitted) { + resolve(); + } else { + reject(); + } + }); + + dlg.querySelector('.btnCancel').addEventListener('click', function (e) { + + paperDialogHelper.close(dlg); + }); + + dlg.querySelector('form').addEventListener('submit', function (e) { + + submitEpisodeForm(dlg); + + e.preventDefault(); + return false; + }); + + initEpisodeForm(dlg, item); + } + + xhr.send(); + }); + } + }; +}); \ No newline at end of file diff --git a/dashboard-ui/components/fileorganizer/fileorganizer.template.html b/dashboard-ui/components/fileorganizer/fileorganizer.template.html new file mode 100644 index 0000000000..5001448491 --- /dev/null +++ b/dashboard-ui/components/fileorganizer/fileorganizer.template.html @@ -0,0 +1,34 @@ +
+ +
+
+
+ +
+ +

+ +
+ + +
+
+ +
+
+ +
+
+ +
${LabelEndingEpisodeNumberHelp}
+
+
+
+ ${OptionRememberOrganizeCorrection} +
+
+ + +
\ No newline at end of file diff --git a/dashboard-ui/components/guestinviter/guestinviter.js b/dashboard-ui/components/guestinviter/guestinviter.js index 83e2c229c3..568b5b742e 100644 --- a/dashboard-ui/components/guestinviter/guestinviter.js +++ b/dashboard-ui/components/guestinviter/guestinviter.js @@ -109,8 +109,8 @@ html += Globalize.translateDocument(template); dlg.innerHTML = html; - // needed for the collapsible document.body.appendChild(dlg); + // needed for the collapsible $(dlg.querySelector('form')).trigger('create'); paperDialogHelper.open(dlg); diff --git a/dashboard-ui/components/guestinviter/guestinviter.template.html b/dashboard-ui/components/guestinviter/guestinviter.template.html index 9fa4c0200f..020a1bd408 100644 --- a/dashboard-ui/components/guestinviter/guestinviter.template.html +++ b/dashboard-ui/components/guestinviter/guestinviter.template.html @@ -1,5 +1,5 @@ 
- +
${HeaderInviteUser}
diff --git a/dashboard-ui/components/itemidentifier/itemidentifier.js b/dashboard-ui/components/itemidentifier/itemidentifier.js index a0ff561c88..cc5c00cf1f 100644 --- a/dashboard-ui/components/itemidentifier/itemidentifier.js +++ b/dashboard-ui/components/itemidentifier/itemidentifier.js @@ -333,7 +333,7 @@ currentDeferred.resolveWith(null, [hasChanges]); } - window.ItemIdentifier = { + return { show: function (itemId) { var deferred = DeferredBuilder.Deferred(); diff --git a/dashboard-ui/components/itemidentifier/itemidentifier.template.html b/dashboard-ui/components/itemidentifier/itemidentifier.template.html index ed7cfa0fce..a7248734d9 100644 --- a/dashboard-ui/components/itemidentifier/itemidentifier.template.html +++ b/dashboard-ui/components/itemidentifier/itemidentifier.template.html @@ -1,5 +1,5 @@ 
- +
diff --git a/dashboard-ui/components/metadataeditor/metadataeditor.template.html b/dashboard-ui/components/metadataeditor/metadataeditor.template.html index 44863a431a..b505070181 100644 --- a/dashboard-ui/components/metadataeditor/metadataeditor.template.html +++ b/dashboard-ui/components/metadataeditor/metadataeditor.template.html @@ -1,5 +1,5 @@ 
- +
${ButtonEdit}
diff --git a/dashboard-ui/components/metadataeditor/personeditor.template.html b/dashboard-ui/components/metadataeditor/personeditor.template.html index cf8fb5d601..fa4be5936b 100644 --- a/dashboard-ui/components/metadataeditor/personeditor.template.html +++ b/dashboard-ui/components/metadataeditor/personeditor.template.html @@ -1,5 +1,5 @@ 
- +
${ButtonEdit}
diff --git a/dashboard-ui/components/playlisteditor/playlisteditor.js b/dashboard-ui/components/playlisteditor/playlisteditor.js index 5eccec04e2..bdbbb95277 100644 --- a/dashboard-ui/components/playlisteditor/playlisteditor.js +++ b/dashboard-ui/components/playlisteditor/playlisteditor.js @@ -206,7 +206,7 @@ var title = Globalize.translate('HeaderAddToPlaylist'); html += '
'; - html += ''; + html += ''; html += '
'; html += title; html += '
'; diff --git a/dashboard-ui/components/recordingcreator/recordingcreator.js b/dashboard-ui/components/recordingcreator/recordingcreator.js index 72729b4e44..29fa705372 100644 --- a/dashboard-ui/components/recordingcreator/recordingcreator.js +++ b/dashboard-ui/components/recordingcreator/recordingcreator.js @@ -227,6 +227,12 @@ } } + if (AppInfo.enableSupporterMembership) { + context.querySelector('.btnSupporterForConverting a').href = 'https://emby.media/premiere'; + } else { + context.querySelector('.btnSupporterForConverting a').href = '#'; + } + ApiClient.getNamedConfiguration("livetv").then(function (config) { $('#chkConvertRecordings', context).checked(config.EnableRecordingEncoding); diff --git a/dashboard-ui/components/recordingcreator/recordingcreator.template.html b/dashboard-ui/components/recordingcreator/recordingcreator.template.html index 3cfe45f654..b88f0e5b67 100644 --- a/dashboard-ui/components/recordingcreator/recordingcreator.template.html +++ b/dashboard-ui/components/recordingcreator/recordingcreator.template.html @@ -1,5 +1,5 @@ 
- +
${HeaderNewRecording}
@@ -49,7 +49,7 @@
${OptionConvertRecordingsToStreamingFormat}
${OptionConvertRecordingsToStreamingFormatHelp}
- +

@@ -69,7 +69,10 @@ ${HeaderBecomeProjectSupporter}
+
+
+
\ No newline at end of file diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index 5032f61296..c85107cf00 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -641,6 +641,10 @@ h1 a:hover { text-decoration: underline; } +.ui-body-b a.accent { + color: #52B54B !important; +} + .ui-listview li h3 { font-weight: 400; } diff --git a/dashboard-ui/livetvsettings.html b/dashboard-ui/livetvsettings.html index dc13545385..93094a3dc2 100644 --- a/dashboard-ui/livetvsettings.html +++ b/dashboard-ui/livetvsettings.html @@ -55,7 +55,7 @@
${OptionConvertRecordingsToStreamingFormat}
${OptionConvertRecordingsToStreamingFormatHelp}
- +


diff --git a/dashboard-ui/scripts/autoorganizelog.js b/dashboard-ui/scripts/autoorganizelog.js index bbc243b0c0..fefd84fb13 100644 --- a/dashboard-ui/scripts/autoorganizelog.js +++ b/dashboard-ui/scripts/autoorganizelog.js @@ -52,43 +52,17 @@ function organizeEpsiodeWithCorrections(page, item) { - Dashboard.showLoadingMsg(); - - ApiClient.getItems(null, { - recursive: true, - includeItemTypes: 'Series', - sortBy: 'SortName' - - }).then(function (result) { - Dashboard.hideLoadingMsg(); - showEpisodeCorrectionPopup(page, item, result.Items); - }, onApiFailure); - + showEpisodeCorrectionPopup(page, item); } - function showEpisodeCorrectionPopup(page, item, allSeries) { + function showEpisodeCorrectionPopup(page, item) { - var popup = $('.episodeCorrectionPopup', page).popup("open"); + require(['components/fileorganizer/fileorganizer'], function (fileorganizer) { - $('.inputFile', popup).html(item.OriginalFileName); - - $('#txtSeason', popup).val(item.ExtractedSeasonNumber); - $('#txtEpisode', popup).val(item.ExtractedEpisodeNumber); - $('#txtEndingEpisode', popup).val(item.ExtractedEndingEpisodeNumber); - - $('#chkRememberCorrection', popup).val(false); - - $('#hfResultId', popup).val(item.Id); - - var seriesHtml = allSeries.map(function (s) { - - return ''; - - }).join(''); - - seriesHtml = '' + seriesHtml; - - $('#selectSeries', popup).html(seriesHtml); + fileorganizer.show(item).then(function () { + reloadItems(page); + }); + }); } function organizeFile(page, id) { @@ -131,38 +105,9 @@ }, onApiFailure); } - }); } - 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: $('#chkRememberCorrection', form).checked() - }; - - ApiClient.performEpisodeOrganization(resultId, options).then(function () { - - Dashboard.hideLoadingMsg(); - - $('.episodeCorrectionPopup', page).popup("close"); - - reloadItems(page); - - }, onApiFailure); - } - function reloadItems(page) { Dashboard.showLoadingMsg(); @@ -173,7 +118,6 @@ renderResults(page, result); Dashboard.hideLoadingMsg(); - }, onApiFailure); } @@ -229,9 +173,9 @@ var status = item.Status; if (status == 'SkippedExisting') { - html += ''; + html += ''; } else if (status == 'Failure') { html += ''; @@ -323,14 +267,9 @@ var page = $.mobile.activePage; - if (msg.MessageType == "ScheduledTaskEnded") { + if ((msg.MessageType == 'ScheduledTaskEnded' && msg.Data.Key == 'AutoOrganize') || msg.MessageType == 'AutoOrganizeUpdate') { - var result = msg.Data; - - if (result.Key == 'AutoOrganize') { - - reloadItems(page); - } + reloadItems(page); } } @@ -338,15 +277,21 @@ Dashboard.hideLoadingMsg(); - Dashboard.alert({ - title: Globalize.translate('AutoOrganizeError'), - message: Globalize.translate('ErrorOrganizingFileWithErrorCode', e.getResponseHeader("X-Application-Error-Code")) - }); - } + var page = $.mobile.activePage; + $('.episodeCorrectionPopup', page).popup("close"); - function onEpisodeCorrectionFormSubmit() { - submitEpisodeForm(this); - return false; + if (e.status == 0) { + Dashboard.alert({ + title: 'Auto-Organize', + message: 'The operation is going to take a little longer. The view will be updated on completion.' + }); + } + else { + Dashboard.alert({ + title: Globalize.translate('AutoOrganizeError'), + message: Globalize.translate('ErrorOrganizingFileWithErrorCode', e.getResponseHeader("X-Application-Error-Code")) + }); + } } $(document).on('pageinit', "#libraryFileOrganizerLogPage", function () { @@ -361,8 +306,6 @@ }); - $('.episodeCorrectionForm').off('submit', onEpisodeCorrectionFormSubmit).on('submit', onEpisodeCorrectionFormSubmit); - }).on('pageshow', "#libraryFileOrganizerLogPage", function () { var page = this; @@ -377,7 +320,7 @@ taskKey: 'AutoOrganize' }); - $(ApiClient).on("websocketmessage.autoorganizelog", onWebSocketMessage); + Events.on(ApiClient, "websocketmessage", onWebSocketMessage); }).on('pagebeforehide', "#libraryFileOrganizerLogPage", function () { @@ -390,7 +333,7 @@ mode: 'off' }); - $(ApiClient).off("websocketmessage.autoorganizelog", onWebSocketMessage); + Events.off(ApiClient, "websocketmessage", onWebSocketMessage); }); })(jQuery, document, window); diff --git a/dashboard-ui/scripts/autoorganizesmart.js b/dashboard-ui/scripts/autoorganizesmart.js index 7a922e83d2..6f9a823de9 100644 --- a/dashboard-ui/scripts/autoorganizesmart.js +++ b/dashboard-ui/scripts/autoorganizesmart.js @@ -49,42 +49,37 @@ } var html = ""; - var currentType; + + if (infos.length) { + html += '"; + } $('.divMatchInfos', page).html(html).trigger('create'); } @@ -105,14 +100,17 @@ $('.divMatchInfos', page).on('click', '.btnDeleteMatchEntry', function () { var button = this; - var id = button.getAttribute('data-id'); + var index = parseInt(button.getAttribute('data-index')); - var options = { + var info = currentResult.Items[index]; + var entries = info.MatchStrings.map(function (m) { + return { + Name: info.ItemName, + Value: m + }; + }); - MatchString: button.getAttribute('data-matchstring') - }; - - ApiClient.deleteSmartMatchEntry(id, options).then(function () { + ApiClient.deleteSmartMatchEntries(entries).then(function () { reloadList(page); diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 309b64e500..f0483065e2 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -408,7 +408,10 @@ function renderDetails(page, item, context, isStatic) { renderSimilarItems(page, item, context); - renderSiblingLinks(page, item, context); + + if (!isStatic) { + renderSiblingLinks(page, item, context); + } if (item.Taglines && item.Taglines.length) { $('.tagline', page).html(item.Taglines[0]).show(); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 4ccaa91a25..0bad35c621 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -1061,9 +1061,9 @@ identifyItem: function (itemId) { - require(['components/itemidentifier/itemidentifier'], function () { + require(['components/itemidentifier/itemidentifier'], function (itemidentifier) { - ItemIdentifier.show(itemId); + itemidentifier.show(itemId); }); }, diff --git a/dashboard-ui/scripts/livetvsettings.js b/dashboard-ui/scripts/livetvsettings.js index 54c5721735..aab6ce4349 100644 --- a/dashboard-ui/scripts/livetvsettings.js +++ b/dashboard-ui/scripts/livetvsettings.js @@ -81,9 +81,9 @@ }); if (AppInfo.enableSupporterMembership) { - $('.lnkSupporterLearnMore', page).show(); + page.querySelector('.btnSupporterForConverting a').href = 'https://emby.media/premiere'; } else { - $('.lnkSupporterLearnMore', page).hide(); + page.querySelector('.btnSupporterForConverting a').href = '#'; } }); diff --git a/dashboard-ui/scripts/sync.js b/dashboard-ui/scripts/sync.js index a5fcb95ad4..7f085a5a3b 100644 --- a/dashboard-ui/scripts/sync.js +++ b/dashboard-ui/scripts/sync.js @@ -246,7 +246,7 @@ var html = ''; html += '
'; - html += ''; + html += ''; html += '
'; html += Globalize.translate('SyncMedia'); html += '
'; diff --git a/dashboard-ui/shared.html b/dashboard-ui/shared.html index 47a5519482..87d4ca0a8d 100644 --- a/dashboard-ui/shared.html +++ b/dashboard-ui/shared.html @@ -70,7 +70,7 @@

-

+