diff --git a/dashboard-ui/apiclient/sync/contentuploader.js b/dashboard-ui/apiclient/sync/contentuploader.js index 75e5e45f71..c07aff9f4f 100644 --- a/dashboard-ui/apiclient/sync/contentuploader.js +++ b/dashboard-ui/apiclient/sync/contentuploader.js @@ -8,24 +8,16 @@ var deferred = DeferredBuilder.Deferred(); - var apiClient = connectionManager.getApiClient(server.Id); + LocalAssetManager.getCameraPhotos().done(function (photos) { - apiClient.getContentUploadHistory().done(function (result) { + if (!photos.length) { + deferred.resolve(); + return; + } - uploadImagesWithHistory(server, result, apiClient, deferred); + var apiClient = connectionManager.getApiClient(server.Id); - }).fail(function () { - deferred.reject(); - }); - - return deferred.promise(); - }; - - function uploadImagesWithHistory(server, uploadHistory, apiClient, deferred) { - - require(['localassetmanager', "cryptojs-sha1"], function () { - - LocalAssetManager.getCameraPhotos().done(function (photos) { + apiClient.getContentUploadHistory().done(function (uploadHistory) { photos = getFilesToUpload(photos, uploadHistory); @@ -36,8 +28,13 @@ }).fail(function () { deferred.reject(); }); + + }).fail(function () { + deferred.reject(); }); - } + + return deferred.promise(); + }; function getFilesToUpload(files, uploadHistory) { diff --git a/dashboard-ui/apiclient/sync/mediasync.js b/dashboard-ui/apiclient/sync/mediasync.js index 2ceda20660..c5eec700c1 100644 --- a/dashboard-ui/apiclient/sync/mediasync.js +++ b/dashboard-ui/apiclient/sync/mediasync.js @@ -254,7 +254,7 @@ options = options || {}; - LocalAssetManager.downloadFile(url, localPath, options.enableBackgroundTransfer).done(function (path, isQueued) { + LocalAssetManager.downloadFile(url, localPath, options.enableBackgroundTransfer, options.enableNewDownloads).done(function (path, isQueued) { if (isQueued) { deferred.resolveWith(null, [true]); diff --git a/dashboard-ui/components/subtitleeditor/subtitleeditor.js b/dashboard-ui/components/subtitleeditor/subtitleeditor.js index 7975505cb8..edec2c1e50 100644 --- a/dashboard-ui/components/subtitleeditor/subtitleeditor.js +++ b/dashboard-ui/components/subtitleeditor/subtitleeditor.js @@ -26,7 +26,7 @@ Dashboard.showLoadingMsg(); var popup = $('.popupSubtitleViewer', page).popup('open'); - $('.subtitleContent', page).html('\nLoading...\n\n\n'); + $('.subtitleContent', page).html(''); var url = 'Providers/Subtitles/Subtitles/' + id; diff --git a/dashboard-ui/cordova/ios/backgroundfetch.js b/dashboard-ui/cordova/ios/backgroundfetch.js index 9f171343ff..c27e0ffee5 100644 --- a/dashboard-ui/cordova/ios/backgroundfetch.js +++ b/dashboard-ui/cordova/ios/backgroundfetch.js @@ -27,7 +27,7 @@ fetcher.finish(); // <-- N.B. You MUST called #finish so that native-side can signal completion of the background-thread to the os. } - function startSync(reportToFetcher) { + function startSync(reportToFetcher, syncOptions) { lastStart = new Date().getTime(); require(['localsync'], function () { @@ -37,7 +37,7 @@ return; } - var promise = LocalSync.sync(); + var promise = LocalSync.sync(syncOptions); if (reportToFetcher) { promise.done(onSyncFinish).fail(onSyncFail); @@ -48,7 +48,12 @@ function onBackgroundFetch() { Logger.log('BackgroundFetch initiated'); - startSync(true); + + startSync(true, { + uploadPhotos: false, + enableBackgroundTransfer: true, + enableNewDownloads: true + }); } function onBackgroundFetchFailed() { @@ -61,20 +66,46 @@ setInterval(function () { - //startSync(); + startIntervalSync(); }, syncInterval); if (lastStart > 0 && (new Date().getTime() - lastStart) >= syncInterval) { setTimeout(function () { - //startSync(); + startIntervalSync(); }, 5000); } } - Dashboard.ready(restartInterval); + function startIntervalSync() { + + startSync(false, { + uploadPhotos: true, + enableNewDownloads: false, + enableBackgroundTransfer: true + }); + } + + function normalizeSyncOptions(options) { + + options.enableBackgroundTransfer = true; + + if (options.enableNewDownloads == null) { + options.enableNewDownloads = false; + } + } + + Dashboard.ready(function () { + + require(['localsync'], function () { + + LocalSync.normalizeSyncOptions = normalizeSyncOptions; + }); + + restartInterval(); + }); document.addEventListener("resume", restartInterval, false); onDeviceReady(); diff --git a/dashboard-ui/cordova/localassetmanager.js b/dashboard-ui/cordova/localassetmanager.js index d8bfff88b2..c845901307 100644 --- a/dashboard-ui/cordova/localassetmanager.js +++ b/dashboard-ui/cordova/localassetmanager.js @@ -472,7 +472,7 @@ return filename; } - function downloadFile(url, localPath, enableBackground) { + function downloadFile(url, localPath, enableBackground, enableNewDownloads) { if (!enableBackground) { return downloadWithFileTransfer(url, localPath); @@ -482,7 +482,12 @@ if (localStorage.getItem('sync-' + url) == '1') { Logger.log('file was downloaded previously'); - deferred.resolveWith(null, [localPath]); + deferred.resolveWith(null, [localPath, false]); + return deferred.promise(); + } + + if (enableNewDownloads === false) { + deferred.resolveWith(null, [localPath, true]); return deferred.promise(); } @@ -504,7 +509,7 @@ isResolved = true; // true indicates that it's queued deferred.resolveWith(null, [localPath, true]); - }, 1000); + }, 700); // Start the download and persist the promise to be able to cancel the download. download.startAsync().then(function () { @@ -512,10 +517,11 @@ clearTimeout(timeoutHandle); // on success Logger.log('Downloaded local url: ' + localPath); - if (isResolved) { - // If we've already moved on, set this property so that we'll see it later - localStorage.setItem('sync-' + url, '1'); - } else { + + // If we've already moved on, set this property so that we'll see it later + localStorage.setItem('sync-' + url, '1'); + + if (!isResolved) { // true indicates that it's queued deferred.resolveWith(null, [localPath, false]); } diff --git a/dashboard-ui/cordova/registrationservices.js b/dashboard-ui/cordova/registrationservices.js index 60512ded87..ba3e970533 100644 --- a/dashboard-ui/cordova/registrationservices.js +++ b/dashboard-ui/cordova/registrationservices.js @@ -168,12 +168,6 @@ } } - if (showSupporterInfo) { - html += '

'; - html += '' + Globalize.translate('ButtonUnlockWithSupporter') + ''; - html += '

'; - } - html += '

'; html += '' + Globalize.translate('ButtonCancel') + ''; html += '

'; diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 024115d16b..9639e04773 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -18,6 +18,7 @@ .background-theme-b { background-color: #242424; + background: -webkit-radial-gradient(circle, #282828, #202020); } .ui-body-b { @@ -1190,7 +1191,7 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { .selectedCharacter { - color: #4d90fe !important; + color: #52B54B !important; } .itemOverlayHtml { diff --git a/dashboard-ui/css/librarymenu.css b/dashboard-ui/css/librarymenu.css index 733d073934..402acfe09b 100644 --- a/dashboard-ui/css/librarymenu.css +++ b/dashboard-ui/css/librarymenu.css @@ -268,7 +268,7 @@ } .libraryViewNav .ui-btn-active { - border-bottom-color: #38c; + border-bottom-color: #52B54B; color: #fff !important; } diff --git a/dashboard-ui/css/livetv.css b/dashboard-ui/css/livetv.css index 61450fd0a0..273b0f206b 100644 --- a/dashboard-ui/css/livetv.css +++ b/dashboard-ui/css/livetv.css @@ -217,11 +217,11 @@ } .channelTimeslotHeader { - border-right: 1px solid #38c; + border-right-color: #52B54B; } .channelTimeslotHeader, .timeslotHeader { - background: #38c; + background: #52B54B; } .timeslotHeader, .channelTimeslotHeader { diff --git a/dashboard-ui/movies.html b/dashboard-ui/movies.html index 581e0e960b..559a032efb 100644 --- a/dashboard-ui/movies.html +++ b/dashboard-ui/movies.html @@ -37,7 +37,7 @@ ${ButtonSync} -
+
@@ -47,7 +47,7 @@ ${ButtonSync} -
+
diff --git a/dashboard-ui/music.html b/dashboard-ui/music.html index 6479ba5cea..fdf9dbc681 100644 --- a/dashboard-ui/music.html +++ b/dashboard-ui/music.html @@ -32,28 +32,28 @@

${HeaderLatestMusic}

-
+