diff --git a/dashboard-ui/dashboardsync.html b/dashboard-ui/dashboardsync.html deleted file mode 100644 index d04e60b95c..0000000000 --- a/dashboard-ui/dashboardsync.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - ${TitleServer} - - -
- -
- -
-
- - diff --git a/dashboard-ui/devices.html b/dashboard-ui/devices.html index 72c3ebbab5..78312d4bad 100644 --- a/dashboard-ui/devices.html +++ b/dashboard-ui/devices.html @@ -12,7 +12,6 @@
${TabDevices} ${TabCameraUpload} - ${TabSync}
diff --git a/dashboard-ui/scripts/devices.js b/dashboard-ui/scripts/devices.js index b28ec6b402..3f844b2379 100644 --- a/dashboard-ui/scripts/devices.js +++ b/dashboard-ui/scripts/devices.js @@ -79,11 +79,11 @@ ApiClient.getJSON(ApiClient.getUrl('Devices', { - SupportsDeviceId: true + SupportsUniqueIdentifier: true - })).done(function (devices) { + })).done(function (result) { - load(page, devices); + load(page, result.Items); Dashboard.hideLoadingMsg(); }); diff --git a/dashboard-ui/scripts/devicesupload.js b/dashboard-ui/scripts/devicesupload.js index bf53f660e2..f79f0d97d5 100644 --- a/dashboard-ui/scripts/devicesupload.js +++ b/dashboard-ui/scripts/devicesupload.js @@ -77,7 +77,7 @@ $.when(promise1, promise2).done(function (response1, response2) { - load(page, response2[0], response1[0]); + load(page, response2[0].Items, response1[0]); Dashboard.hideLoadingMsg(); }); diff --git a/dashboard-ui/scripts/episodes.js b/dashboard-ui/scripts/episodes.js index b8b904aca6..eeddd4163d 100644 --- a/dashboard-ui/scripts/episodes.js +++ b/dashboard-ui/scripts/episodes.js @@ -1,6 +1,6 @@ (function ($, document) { - var view = LibraryBrowser.getDefaultItemsView('Poster', 'List'); + var view = LibraryBrowser.getDefaultItemsView('Poster', 'Poster'); // The base query options var query = { diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index e8063e37ae..9134e30b5e 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -1543,7 +1543,9 @@ $('.btnSync', page).on('click', function () { - SyncManager.showMenu([currentItem]); + SyncManager.showMenu({ + items: [currentItem] + }); }); $('.btnMoreCommands', page).on('click', function () { diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index 2e7e54c703..8e3e85fed3 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -251,9 +251,8 @@ closeContextMenu(); - ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) { - - SyncManager.showMenu([item]); + SyncManager.showMenu({ + items: [id] }); return false; @@ -743,21 +742,13 @@ return; } - ApiClient.getItems({ + SyncManager.showMenu({ + items: selection + }); - ids: selection.join(','), - fields: 'SyncInfo', - userId: Dashboard.getCurrentUserId() - - }).done(function (result) { - - SyncManager.showMenu(result.Items); - - $(SyncManager).off('jobsubmit.librarylist').on('jobsubmit.librarylist', function () { - - hideSelections(page); - }); + $(SyncManager).off('jobsubmit.librarylist').on('jobsubmit.librarylist', function () { + hideSelections(page); }); } diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 7cb61c796f..8e42eae1d7 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -925,6 +925,15 @@ Limit: itemLimit }); + } + else if (item.Type == "Playlist") { + + promise = ApiClient.getInstantMixFromPlaylist(id, { + UserId: Dashboard.getCurrentUserId(), + Fields: getItemFields, + Limit: itemLimit + }); + } else if (item.Type == "Audio") { diff --git a/dashboard-ui/scripts/moviecollections.js b/dashboard-ui/scripts/moviecollections.js index d36bec0fa2..5d50ef303f 100644 --- a/dashboard-ui/scripts/moviecollections.js +++ b/dashboard-ui/scripts/moviecollections.js @@ -1,6 +1,6 @@ (function ($, document) { - var view = LibraryBrowser.getDefaultItemsView('Poster', 'List'); + var view = LibraryBrowser.getDefaultItemsView('Poster', 'Poster'); // The base query options var query = { diff --git a/dashboard-ui/scripts/movies.js b/dashboard-ui/scripts/movies.js index 900ff54f3f..11621dafca 100644 --- a/dashboard-ui/scripts/movies.js +++ b/dashboard-ui/scripts/movies.js @@ -1,6 +1,6 @@ (function ($, document) { - var view = LibraryBrowser.getDefaultItemsView('Poster', 'List'); + var view = LibraryBrowser.getDefaultItemsView('Poster', 'Poster'); // The base query options var query = { diff --git a/dashboard-ui/scripts/moviesrecommended.js b/dashboard-ui/scripts/moviesrecommended.js index b3ab5fa267..cf9b7feb5b 100644 --- a/dashboard-ui/scripts/moviesrecommended.js +++ b/dashboard-ui/scripts/moviesrecommended.js @@ -52,7 +52,7 @@ SortOrder: "Descending", IncludeItemTypes: "Movie", Filters: "IsResumable", - Limit: screenWidth >= 1920 ? 12 : (screenWidth >= 1600 ? 8 : (screenWidth >= 1200 ? 6 : 3)), + Limit: screenWidth >= 1920 ? 12 : (screenWidth >= 1600 ? 8 : 6), Recursive: true, Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo", CollapseBoxSetItems: false, @@ -85,7 +85,7 @@ userId: Dashboard.getCurrentUserId(), categoryLimit: screenWidth >= 1200 ? 4 : 3, - ItemLimit: screenWidth >= 1920 ? 10 : (screenWidth >= 1600 ? 7 : (screenWidth >= 1200 ? 7 : 7)), + ItemLimit: screenWidth >= 1920 ? 10 : (screenWidth >= 1600 ? 8 : (screenWidth >= 1200 ? 7 : 6)), Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo", ImageTypeLimit: 1, EnableImageTypes: "Primary,Backdrop,Banner,Thumb" diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index fa56e5b7e8..2a71aa32b5 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -760,6 +760,10 @@ var Dashboard = { name: Globalize.translate('TabPlayback'), href: "playbackconfiguration.html", selected: page.hasClass('playbackConfigurationPage') + }, { + name: Globalize.translate('TabSync'), + href: "syncactivity.html", + selected: page.hasClass('syncConfigurationPage') }, { divider: true, name: Globalize.translate('TabAutoOrganize'), @@ -1258,7 +1262,7 @@ var Dashboard = { PlayableMediaTypes: "Audio,Video", SupportedCommands: Dashboard.getSupportedRemoteCommands().join(','), - SupportsDeviceId: false + SupportsUniqueIdentifier: false }; window.ConnectionManager = new MediaBrowser.ConnectionManager(credentialProvider, appName, appVersion, deviceName, deviceId, capabilities); diff --git a/dashboard-ui/scripts/sync.js b/dashboard-ui/scripts/sync.js index b75e0fc69b..64ec43291d 100644 --- a/dashboard-ui/scripts/sync.js +++ b/dashboard-ui/scripts/sync.js @@ -1,6 +1,18 @@ (function (window, $) { - function submitJob(userId, items, form) { + function submitJob(userId, syncOptions, form) { + + if (!userId) { + throw new Error('userId cannot be null'); + } + + if (!syncOptions) { + throw new Error('syncOptions cannot be null'); + } + + if (!form) { + throw new Error('form cannot be null'); + } var target = $('.radioSync:checked', form).get().map(function (c) { @@ -10,7 +22,7 @@ if (!target) { - Dashboard.alert('Please select a device to sync to.'); + Dashboard.alert(Globalize.translate('MessagePleaseSelectDeviceToSyncTo')); return; } @@ -19,8 +31,8 @@ userId: userId, TargetId: target, - ItemIds: items.map(function (i) { - return i.Id; + ItemIds: syncOptions.items.map(function (i) { + return i.Id || i; }).join(','), Quality: $('.radioSyncQuality', form)[0].getAttribute('data-value'), @@ -39,10 +51,11 @@ $('.syncPanel').panel('close'); $(window.SyncManager).trigger('jobsubmit'); + Dashboard.alert(Globalize.translate('MessageSyncJobCreated')); }); } - function showSyncMenu(items) { + function showSyncMenu(options) { var userId = Dashboard.getCurrentUserId(); @@ -59,17 +72,17 @@ html += '
'; - if (items.length > 1) { + if (options.items.length > 1) { html += '

'; - html += ''; + html += ''; html += ''; html += '

'; } html += '
'; html += '
'; - html += 'Sync to:'; + html += '' + Globalize.translate('LabelSyncTo') + ''; var index = 0; @@ -92,19 +105,19 @@ html += '
'; html += '
'; - html += 'Quality:'; - html += ''; + html += '' + Globalize.translate('LabelQuality') + ''; + html += ''; html += ''; - html += ''; + html += ''; html += ''; - html += ''; + html += ''; html += ''; html += '
'; html += '
'; html += '
'; html += '

'; - html += ''; + html += ''; html += '

'; html += ''; @@ -119,7 +132,7 @@ $('form', elem).on('submit', function () { - submitJob(userId, items, this); + submitJob(userId, options, this); return false; }); }); diff --git a/dashboard-ui/scripts/dashboardsync.js b/dashboard-ui/scripts/syncactivity.js similarity index 89% rename from dashboard-ui/scripts/dashboardsync.js rename to dashboard-ui/scripts/syncactivity.js index a0ec06d512..7485f35cd6 100644 --- a/dashboard-ui/scripts/dashboardsync.js +++ b/dashboard-ui/scripts/syncactivity.js @@ -60,6 +60,7 @@ width: 400, tag: job.PrimaryImageTag }); + style = "background-position:center center;"; } else { style = "background-color:#38c;background-position:center center;"; imgUrl = "css/images/items/detail/video.png"; @@ -80,16 +81,8 @@ if (job.Status == 'Completed') { html += '
'; } - else if (job.Status == 'Queued') { - } - else if (job.Status == 'Transcoding' || job.Status == 'Transferring') { - html += '
'; - } - else if (job.Status == 'Cancelled') { - html += '
'; - } - else if (job.Status == 'TranscodingFailed') { - html += '
'; + else if (job.Status == 'CompletedWithError') { + html += '
'; } // cardContent @@ -215,13 +208,13 @@ }); } - $(document).on('pageshow', "#dashboardSyncPage", function () { + $(document).on('pageshow', "#syncActivityPage", function () { var page = this; reloadData(page); - }).on('pageinit', "#dashboardSyncPage", function () { + }).on('pageinit', "#syncActivityPage", function () { var page = this; diff --git a/dashboard-ui/scripts/syncsettings.js b/dashboard-ui/scripts/syncsettings.js new file mode 100644 index 0000000000..5f282702bb --- /dev/null +++ b/dashboard-ui/scripts/syncsettings.js @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dashboard-ui/scripts/tvlatest.js b/dashboard-ui/scripts/tvlatest.js index fbc0ca1a87..40d420c388 100644 --- a/dashboard-ui/scripts/tvlatest.js +++ b/dashboard-ui/scripts/tvlatest.js @@ -2,7 +2,6 @@ $(document).on('pagebeforeshow', "#tvNextUpPage", function () { - var screenWidth = $(window).width(); var userId = Dashboard.getCurrentUserId(); var parentId = LibraryMenu.getTopParentId(); @@ -30,7 +29,7 @@ showParentTitle: false, showUnplayedIndicator: false, showChildCountIndicator: true, - overlayText: screenWidth >= 600, + overlayText: true, lazy: true })).trigger('create').createCardMenus(); diff --git a/dashboard-ui/scripts/tvrecommended.js b/dashboard-ui/scripts/tvrecommended.js index 32584d5b2d..68615dbf35 100644 --- a/dashboard-ui/scripts/tvrecommended.js +++ b/dashboard-ui/scripts/tvrecommended.js @@ -89,8 +89,6 @@ function loadResume(page) { - var screenWidth = $(window).width(); - var parentId = LibraryMenu.getTopParentId(); var options = { @@ -99,7 +97,7 @@ SortOrder: "Descending", IncludeItemTypes: "Episode", Filters: "IsResumable", - Limit: screenWidth >= 1920 ? 6 : (screenWidth >= 1200 ? 6 : 4), + Limit: 6, Recursive: true, Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData,SyncInfo", ExcludeLocationTypes: "Virtual", diff --git a/dashboard-ui/scripts/tvshows.js b/dashboard-ui/scripts/tvshows.js index 8774f35b3c..f6a81363f0 100644 --- a/dashboard-ui/scripts/tvshows.js +++ b/dashboard-ui/scripts/tvshows.js @@ -1,6 +1,6 @@ (function ($, document) { - var view = LibraryBrowser.getDefaultItemsView('Thumb', 'List'); + var view = LibraryBrowser.getDefaultItemsView('Thumb', 'Thumb'); // The base query options var query = { diff --git a/dashboard-ui/syncactivity.html b/dashboard-ui/syncactivity.html new file mode 100644 index 0000000000..c66ab920ad --- /dev/null +++ b/dashboard-ui/syncactivity.html @@ -0,0 +1,24 @@ + + + + ${TitleSync} + + +
+ +
+
+ + + +
+ +
+
+
+
+ + diff --git a/dashboard-ui/syncsettings.html b/dashboard-ui/syncsettings.html new file mode 100644 index 0000000000..d9b6dfcfcf --- /dev/null +++ b/dashboard-ui/syncsettings.html @@ -0,0 +1,24 @@ + + + + ${TitleSync} + + +
+ +
+
+ + + +
+ +
+
+
+
+ + diff --git a/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js b/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js index 304c721f89..e7fb0107be 100644 --- a/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js +++ b/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js @@ -1104,6 +1104,17 @@ }); }; + self.getInstantMixFromPlaylist = function (itemId, options) { + + var url = self.getUrl("Playlists/" + itemId + "/InstantMix", options); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + self.getEpisodes = function (itemId, options) { var url = self.getUrl("Shows/" + itemId + "/Episodes", options);