diff --git a/dashboard-ui/apiclient/sync/mediasync.js b/dashboard-ui/apiclient/sync/mediasync.js index 620d894d03..866e05822a 100644 --- a/dashboard-ui/apiclient/sync/mediasync.js +++ b/dashboard-ui/apiclient/sync/mediasync.js @@ -230,6 +230,7 @@ function downloadMedia(apiClient, jobItem, localItem) { + Logger.log('Begin downloadMedia'); var deferred = DeferredBuilder.Deferred(); require(['localassetmanager'], function () { @@ -259,6 +260,7 @@ function getImages(apiClient, jobItem, localItem) { + Logger.log('Begin getImages'); var deferred = DeferredBuilder.Deferred(); getNextImage(0, apiClient, localItem, deferred); @@ -268,13 +270,14 @@ function getNextImage(index, apiClient, localItem, deferred) { + Logger.log('Begin getNextImage'); if (index >= 4) { deferred.resolve(); return; } - var libraryItem = item.Item; + var libraryItem = localItem.Item; var serverId = libraryItem.ServerId; var itemId = null; @@ -307,12 +310,7 @@ break; } - if (!itemId) { - deferred.resolve(); - return; - } - - if (!imageTag) { + if (!itemId || !imageTag) { getNextImage(index + 1, apiClient, localItem, deferred); return; } @@ -339,8 +337,8 @@ } var imageUrl = apiClient.getImageUrl(itemId, { - Tag: imageTag, - ImageType: imageType, + tag: imageTag, + type: imageType, api_key: apiClient.accessToken() }); @@ -375,13 +373,13 @@ var mediaSource = jobItem.Item.MediaSources[0]; - getNextSubtitle(files, 0, apiClient, jobItem, localItem, mediaSource); + getNextSubtitle(files, 0, apiClient, jobItem, localItem, mediaSource, deferred); }); return deferred.promise(); } - function getNextSubtitle(files, index, apiClient, jobItem, localItem, mediaSource) { + function getNextSubtitle(files, index, apiClient, jobItem, localItem, mediaSource, deferred) { var length = files.length; @@ -393,10 +391,10 @@ getItemSubtitle(file, apiClient, jobItem, localItem, mediaSource).done(function () { - getNextSubtitle(files, index + 1, apiClient, jobItem, localItem, mediaSource); + getNextSubtitle(files, index + 1, apiClient, jobItem, localItem, mediaSource, deferred); }).fail(function () { - getNextSubtitle(files, index + 1, apiClient, jobItem, localItem, mediaSource); + getNextSubtitle(files, index + 1, apiClient, jobItem, localItem, mediaSource, deferred); }); } diff --git a/dashboard-ui/bower_components/iron-flex-layout/.bower.json b/dashboard-ui/bower_components/iron-flex-layout/.bower.json index 6533803466..90b7b9e929 100644 --- a/dashboard-ui/bower_components/iron-flex-layout/.bower.json +++ b/dashboard-ui/bower_components/iron-flex-layout/.bower.json @@ -23,14 +23,14 @@ "paper-styles": "polymerelements/paper-styles#^1.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "homepage": "https://github.com/PolymerElements/iron-flex-layout", + "homepage": "https://github.com/polymerelements/iron-flex-layout", "_release": "1.0.3", "_resolution": { "type": "version", "tag": "v1.0.3", "commit": "e6c2cfec18354973ac03e70dcd8afcc3c72d09b9" }, - "_source": "git://github.com/PolymerElements/iron-flex-layout.git", + "_source": "git://github.com/polymerelements/iron-flex-layout.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/iron-flex-layout" + "_originalSource": "polymerelements/iron-flex-layout" } \ No newline at end of file diff --git a/dashboard-ui/components/imageuploader/imageuploader.js b/dashboard-ui/components/imageuploader/imageuploader.js index 0b423c316d..e9118d8c23 100644 --- a/dashboard-ui/components/imageuploader/imageuploader.js +++ b/dashboard-ui/components/imageuploader/imageuploader.js @@ -88,7 +88,6 @@ ApiClient.uploadItemImage(currentItemId, imageType, file).done(function () { $('#uploadImage', page).val('').trigger('change'); - $('#popupUpload', page).popup("close"); Dashboard.hideLoadingMsg(); processImageChangeResult(page); }); diff --git a/dashboard-ui/components/paperdialoghelper.js b/dashboard-ui/components/paperdialoghelper.js index 3a48b48e29..df8a23a9c9 100644 --- a/dashboard-ui/components/paperdialoghelper.js +++ b/dashboard-ui/components/paperdialoghelper.js @@ -1,6 +1,6 @@ (function (globalScope) { - function paperDialogHashHandler(dlg, hash) { + function paperDialogHashHandler(dlg, hash, lockDocumentScroll) { var isActive = true; @@ -21,7 +21,9 @@ function onDialogClosed() { - Dashboard.onPopupClose(); + if (lockDocumentScroll !== false) { + Dashboard.onPopupClose(); + } dlg = null; $(window).off('navigate', onHashChange); @@ -35,16 +37,19 @@ $(dlg).on('iron-overlay-closed', onDialogClosed); dlg.open(); - Dashboard.onPopupOpen(); + + if (lockDocumentScroll !== false) { + Dashboard.onPopupOpen(); + } window.location.hash = hash; $(window).on('navigate', onHashChange); } - function openWithHash(dlg, hash) { + function openWithHash(dlg, hash, lockDocumentScroll) { - new paperDialogHashHandler(dlg, hash); + new paperDialogHashHandler(dlg, hash, lockDocumentScroll); } globalScope.PaperDialogHelper = { diff --git a/dashboard-ui/cordova/localassetmanager.js b/dashboard-ui/cordova/localassetmanager.js index 0454a58500..635d0d2aa8 100644 --- a/dashboard-ui/cordova/localassetmanager.js +++ b/dashboard-ui/cordova/localassetmanager.js @@ -277,14 +277,19 @@ function addOrUpdateLocalItem(item) { + Logger.log('addOrUpdateLocalItem'); + var deferred = DeferredBuilder.Deferred(); getOfflineItemsDb(function (db) { db.transaction(function (tx) { - var values = [item.Id, item.ItemId, item.Item.Type, item.Item.MediaType, item.ServerId, item.LocalPath, item.UserIdsWithAccess.join(','), item.Item.AlbumId, item.Item.AlbumName, item.Item.SeriesId, item.Item.SeriesName, JSON.stringify(item)]; + var libraryItem = item.Item || {}; + + var values = [item.Id, item.ItemId, libraryItem.Type, libraryItem.MediaType, item.ServerId, item.LocalPath, (item.UserIdsWithAccess || []).join(','), libraryItem.AlbumId, libraryItem.AlbumName, libraryItem.SeriesId, libraryItem.SeriesName, JSON.stringify(item)]; tx.executeSql("REPLACE INTO Items (Id, ItemId, ItemType, MediaType, ServerId, LocalPath, UserIdsWithAccess, AlbumId, AlbumName, SeriesId, SeriesName, Json) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", values); + deferred.resolve(); }); }); @@ -376,7 +381,7 @@ getFileSystem().done(function (fileSystem) { - var localPath = trimEnd(fileSystem.root.toURL()) + "/" + path.join('/'); + var localPath = fileSystem.root.toURL() + "/" + path.join('/'); item.LocalPath = localPath; @@ -397,18 +402,6 @@ return deferred.promise(); } - function trimEnd(str) { - - var charEnd = '/'; - - if (str.charAt(str.length - 1) == charEnd) { - - str = str.substring(0, str.length - 1); - } - - return str; - } - function getDirectoryPath(item, server) { var parts = []; @@ -470,32 +463,31 @@ getFileSystem().done(function (fileSystem) { - fileSystem.root.getFile(localPath.replace('file://', ''), {}, function (targetFile) { + var targetFile = localPath; - var downloader = new BackgroundTransfer.BackgroundDownloader(); - // Create a new download operation. - var download = downloader.createDownload(url, targetFile); - // Start the download and persist the promise to be able to cancel the download. - app.downloadPromise = download.startAsync().then(function () { + var downloader = new BackgroundTransfer.BackgroundDownloader(); + // Create a new download operation. + var download = downloader.createDownload(url, targetFile); + // Start the download and persist the promise to be able to cancel the download. + var downloadPromise = download.startAsync().then(function () { - // on success - var localUrl = normalizeReturnUrl(targetFile.toURL()); + // on success + var localUrl = localPath; - Logger.log('Downloaded local url: ' + localUrl); - deferred.resolveWith(null, [localUrl]); + Logger.log('Downloaded local url: ' + localUrl); + deferred.resolveWith(null, [localUrl]); - }, function () { + }, function () { - // on error - Logger.log('download failed: ' + url + ' to ' + localPath); - deferred.reject(); + // on error + Logger.log('download failed: ' + url + ' to ' + localPath); + deferred.reject(); - }, function (value) { + }, function (value) { - // on progress - Logger.log('download progress: ' + value); + // on progress + Logger.log('download progress: ' + value); - }); }); }); @@ -598,7 +590,7 @@ var deferred = DeferredBuilder.Deferred(); getFileSystem().done(function (fileSystem) { - var path = trimEnd(fileSystem.root.toURL()) + "/emby/images/" + serverId + "/" + itemId + "/" + imageTag; + var path = fileSystem.root.toURL() + "/emby/images/" + serverId + "/" + itemId + "/" + imageTag; deferred.resolveWith(null, [path]); }); diff --git a/dashboard-ui/css/metadataeditor.css b/dashboard-ui/css/metadataeditor.css index 432731494a..5a7a810e15 100644 --- a/dashboard-ui/css/metadataeditor.css +++ b/dashboard-ui/css/metadataeditor.css @@ -36,14 +36,15 @@ .remoteImageContainer { display: inline-block; - margin: 8px; + margin: 5px; vertical-align: top; } .remoteImageDetails { - text-align: center; + text-align: left; background: #282828; position: relative; + padding: 5px 5px 2px; } .remoteImageDetails paper-icon-button { @@ -71,8 +72,8 @@ } .remotePosterImage { - width: 150px; - height: 225px; + width: 140px; + height: 210px; } .remoteBackdropImage { @@ -90,6 +91,37 @@ height: 180px; } +@media all and (min-width: 600px) { + + .remotePosterImage { + width: 160px; + height: 240px; + } +} + +@media all and (min-width: 1200px) { + + .remotePosterImage { + width: 200px; + height: 300px; + } + + .remoteBackdropImage { + width: 320px; + height: 180px; + } + + .remoteDiscImage { + width: 240px; + height: 240px; + } + + .remoteBannerImage { + width: 544px; + height: 100px; + } +} + .editorfieldDescription { color: #ccc; } @@ -166,7 +198,6 @@ @media all and (min-width: 600px) { - .remoteBannerImage { width: 450px; height: 83px; diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 6ffe0723b7..1c6d1fb25c 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -2679,17 +2679,18 @@ dlg.setAttribute('with-backdrop', 'with-backdrop'); dlg.setAttribute('role', 'alertdialog'); - // without this safari will scroll the background instead of the dialog contents - dlg.entryAnimation = 'scale-up-animation'; + dlg.entryAnimation = 'fade-in-animation'; dlg.exitAnimation = 'fade-out-animation'; var html = ''; // There seems to be a bug with this in safari causing it to immediately roll up to 0 height - var isScrollable = !$.browser.safari; // Have to disable this right now because it's causing the radio buttons to not function properly in other browsers besides chrome - isScrollable = false; + var isScrollable = false; + if ($.browser.android) { + isScrollable = true; + } html += '

'; html += Globalize.translate('HeaderSortBy'); @@ -2733,26 +2734,27 @@ require(['components/paperdialoghelper'], function () { - PaperDialogHelper.openWithHash(dlg, 'sortmenu'); - }); + //PaperDialogHelper.openWithHash(dlg, 'sortmenu'); + dlg.open(); - $('.groupSortBy', dlg).on('iron-select', function () { - options.query.SortBy = this.selected.replace('_', ','); - options.query.StartIndex = 0; + $('.groupSortBy', dlg).on('iron-select', function () { + options.query.SortBy = this.selected.replace('_', ','); + options.query.StartIndex = 0; - if (options.callback) { - options.callback(); - } - }); + if (options.callback) { + options.callback(); + } + }); - $('.groupSortOrder', dlg).on('iron-select', function () { + $('.groupSortOrder', dlg).on('iron-select', function () { - options.query.SortOrder = this.selected; - options.query.StartIndex = 0; + options.query.SortOrder = this.selected; + options.query.StartIndex = 0; - if (options.callback) { - options.callback(); - } + if (options.callback) { + options.callback(); + } + }); }); }, diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 2a0841ca98..9130796f3e 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -419,7 +419,7 @@ var Dashboard = { var onclick = removeOnHide ? "$(\"#" + options.id + "\").trigger(\"notification.remove\").remove();" : "$(\"#" + options.id + "\").trigger(\"notification.hide\").hide();"; if (options.allowHide !== false) { - options.html += ""; + options.html += "" + Globalize.translate('ButtonHide') + ""; } if (options.forceShow) {