From 04cc4eaf6899f02fc657f2e20a73317f24afe840 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 14 Oct 2015 22:55:19 -0400 Subject: [PATCH] add multiselect help text --- MediaBrowser.Dlna/Didl/DidlBuilder.cs | 14 +++++------ .../Connect/ConnectManager.cs | 2 +- .../Sync/MediaSync.cs | 7 +----- .../Sync/SyncManager.cs | 24 +++++++++---------- 4 files changed, 21 insertions(+), 26 deletions(-) diff --git a/MediaBrowser.Dlna/Didl/DidlBuilder.cs b/MediaBrowser.Dlna/Didl/DidlBuilder.cs index 390f44267..8bea14f14 100644 --- a/MediaBrowser.Dlna/Didl/DidlBuilder.cs +++ b/MediaBrowser.Dlna/Didl/DidlBuilder.cs @@ -996,6 +996,10 @@ namespace MediaBrowser.Dlna.Didl //} + var inputFormat = (Path.GetExtension(imageInfo.Path) ?? string.Empty) + .TrimStart('.') + .Replace("jpeg", "jpg", StringComparison.OrdinalIgnoreCase); + return new ImageDownloadInfo { ItemId = item.Id.ToString("N"), @@ -1003,7 +1007,7 @@ namespace MediaBrowser.Dlna.Didl ImageTag = tag, Width = width, Height = height, - File = imageInfo.Path, + Format = inputFormat, ItemImageInfo = imageInfo }; } @@ -1019,7 +1023,7 @@ namespace MediaBrowser.Dlna.Didl internal bool IsDirectStream; - internal string File; + internal string Format; internal ItemImageInfo ItemImageInfo; } @@ -1082,14 +1086,10 @@ namespace MediaBrowser.Dlna.Didl width = Convert.ToInt32(newSize.Width); height = Convert.ToInt32(newSize.Height); - var inputFormat = (Path.GetExtension(info.File) ?? string.Empty) - .TrimStart('.') - .Replace("jpeg", "jpg", StringComparison.OrdinalIgnoreCase); - var normalizedFormat = format .Replace("jpeg", "jpg", StringComparison.OrdinalIgnoreCase); - if (string.Equals(inputFormat, normalizedFormat, StringComparison.OrdinalIgnoreCase)) + if (string.Equals(info.Format, normalizedFormat, StringComparison.OrdinalIgnoreCase)) { info.IsDirectStream = maxWidth >= width.Value && maxHeight >= height.Value; } diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index 486446291..f1de09d56 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs @@ -936,7 +936,7 @@ namespace MediaBrowser.Server.Implementations.Connect { var length = response.ContentLength; - if (length != new FileInfo(user.GetImageInfo(ImageType.Primary, 0).Path).Length) + if (length != _fileSystem.GetFileInfo(user.GetImageInfo(ImageType.Primary, 0).Path).Length) { changed = true; } diff --git a/MediaBrowser.Server.Implementations/Sync/MediaSync.cs b/MediaBrowser.Server.Implementations/Sync/MediaSync.cs index d4cb70141..0642c00de 100644 --- a/MediaBrowser.Server.Implementations/Sync/MediaSync.cs +++ b/MediaBrowser.Server.Implementations/Sync/MediaSync.cs @@ -84,12 +84,7 @@ namespace MediaBrowser.Server.Implementations.Sync foreach (var localItem in localItems) { - // TODO: Remove this after a while - if (string.IsNullOrWhiteSpace(localItem.FileId)) - { - jobItemIds.Add(localItem.SyncJobItemId); - } - else if (remoteIds.Contains(localItem.FileId, StringComparer.OrdinalIgnoreCase)) + if (remoteIds.Contains(localItem.FileId, StringComparer.OrdinalIgnoreCase)) { jobItemIds.Add(localItem.SyncJobItemId); } diff --git a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs index fb843b5f7..7d6993d5f 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs +++ b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs @@ -750,27 +750,27 @@ namespace MediaBrowser.Server.Implementations.Sync if (jobItem.IsMarkedForRemoval) { // Tell the device to remove it since it has been marked for removal - _logger.Debug("Adding ItemIdsToRemove {0} because IsMarkedForRemoval is set.", jobItem.ItemId); + _logger.Info("Adding ItemIdsToRemove {0} because IsMarkedForRemoval is set.", jobItem.ItemId); removeFromDevice = true; } else if (user == null) { // Tell the device to remove it since the user is gone now - _logger.Debug("Adding ItemIdsToRemove {0} because the user is no longer valid.", jobItem.ItemId); + _logger.Info("Adding ItemIdsToRemove {0} because the user is no longer valid.", jobItem.ItemId); removeFromDevice = true; } else if (!IsLibraryItemAvailable(libraryItem)) { // Tell the device to remove it since it's no longer available - _logger.Debug("Adding ItemIdsToRemove {0} because it is no longer available.", jobItem.ItemId); + _logger.Info("Adding ItemIdsToRemove {0} because it is no longer available.", jobItem.ItemId); removeFromDevice = true; } else if (job.UnwatchedOnly) { - if (libraryItem.IsPlayed(user) && libraryItem is Video) + if (libraryItem is Video && libraryItem.IsPlayed(user)) { // Tell the device to remove it since it has been played - _logger.Debug("Adding ItemIdsToRemove {0} because it has been marked played.", jobItem.ItemId); + _logger.Info("Adding ItemIdsToRemove {0} because it has been marked played.", jobItem.ItemId); removeFromDevice = true; } } @@ -784,7 +784,7 @@ namespace MediaBrowser.Server.Implementations.Sync } else { - _logger.Debug("Setting status to Queued for {0} because it is no longer on the device.", jobItem.ItemId); + _logger.Info("Setting status to Queued for {0} because it is no longer on the device.", jobItem.ItemId); jobItem.Status = SyncJobItemStatus.Queued; } requiresSaving = true; @@ -855,27 +855,27 @@ namespace MediaBrowser.Server.Implementations.Sync if (jobItem.IsMarkedForRemoval) { // Tell the device to remove it since it has been marked for removal - _logger.Debug("Adding ItemIdsToRemove {0} because IsMarkedForRemoval is set.", jobItem.Id); + _logger.Info("Adding ItemIdsToRemove {0} because IsMarkedForRemoval is set.", jobItem.Id); removeFromDevice = true; } else if (user == null) { // Tell the device to remove it since the user is gone now - _logger.Debug("Adding ItemIdsToRemove {0} because the user is no longer valid.", jobItem.Id); + _logger.Info("Adding ItemIdsToRemove {0} because the user is no longer valid.", jobItem.Id); removeFromDevice = true; } else if (!IsLibraryItemAvailable(libraryItem)) { // Tell the device to remove it since it's no longer available - _logger.Debug("Adding ItemIdsToRemove {0} because it is no longer available.", jobItem.Id); + _logger.Info("Adding ItemIdsToRemove {0} because it is no longer available.", jobItem.Id); removeFromDevice = true; } else if (job.UnwatchedOnly) { - if (libraryItem.IsPlayed(user) && libraryItem is Video) + if (libraryItem is Video && libraryItem.IsPlayed(user)) { // Tell the device to remove it since it has been played - _logger.Debug("Adding ItemIdsToRemove {0} because it has been marked played.", jobItem.Id); + _logger.Info("Adding ItemIdsToRemove {0} because it has been marked played.", jobItem.Id); removeFromDevice = true; } } @@ -889,7 +889,7 @@ namespace MediaBrowser.Server.Implementations.Sync } else { - _logger.Debug("Setting status to Queued for {0} because it is no longer on the device.", jobItem.Id); + _logger.Info("Setting status to Queued for {0} because it is no longer on the device.", jobItem.Id); jobItem.Status = SyncJobItemStatus.Queued; } requiresSaving = true;