From b4777dce8672dcc588294c565c23d38f8385b9ff Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 25 Feb 2014 10:40:16 -0500 Subject: [PATCH] fix directory not found error in episode organization --- .../HttpClientManager/HttpClientManager.cs | 65 ++++++++++--------- MediaBrowser.Common/Net/HttpResponseInfo.cs | 6 ++ MediaBrowser.Controller/Entities/Folder.cs | 6 +- MediaBrowser.Controller/Entities/TV/Season.cs | 11 +++- .../Providers/BaseItemXmlParser.cs | 16 +++++ .../Providers/ItemLookupInfo.cs | 7 +- .../All/LocalImageProvider.cs | 2 +- .../Manager/ItemImageProvider.cs | 22 ++++++- .../MediaBrowser.Providers.csproj | 3 + .../Movies/FanartMovieImageProvider.cs | 4 +- .../Music/FanArtAlbumProvider.cs | 2 +- .../Music/FanArtArtistProvider.cs | 2 +- .../Music/FanArtUpdatesPostScanTask.cs | 2 +- .../Music/MusicExternalIds.cs | 2 +- MediaBrowser.Providers/Omdb/OmdbProvider.cs | 2 +- .../Properties/AssemblyInfo.cs | 7 +- .../Savers/XmlSaverHelpers.cs | 4 ++ .../TV/FanArtSeasonProvider.cs | 2 +- .../TV/FanArtTvUpdatesPostScanTask.cs | 2 +- .../TV/FanartSeriesProvider.cs | 4 +- .../TV/TvdbSeriesProvider.cs | 8 ++- .../FileOrganization/EpisodeFileOrganizer.cs | 13 +++- MediaBrowser.ServerApplication/MainStartup.cs | 24 +++---- .../dashboard-ui/edititemimages.html | 4 +- .../dashboard-ui/scripts/edititemimages.js | 9 +-- 25 files changed, 150 insertions(+), 79 deletions(-) diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs index c29924c35c..2e0035f5d5 100644 --- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs +++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs @@ -285,17 +285,8 @@ private async Task SendAsync(HttpRequestOptions options, strin EnsureSuccessStatusCode(httpResponse); options.CancellationToken.ThrowIfCancellationRequested(); - - return new HttpResponseInfo - { - Content = httpResponse.GetResponseStream(), - - StatusCode = httpResponse.StatusCode, - ContentType = httpResponse.ContentType, - - Headers = httpResponse.Headers - }; + return GetResponseInfo(httpResponse, httpResponse.GetResponseStream(), GetContentLength(httpResponse)); } using (var response = await httpWebRequest.GetResponseAsync().ConfigureAwait(false)) @@ -314,16 +305,7 @@ private async Task SendAsync(HttpRequestOptions options, strin memoryStream.Position = 0; - return new HttpResponseInfo - { - Content = memoryStream, - - StatusCode = httpResponse.StatusCode, - - ContentType = httpResponse.ContentType, - - Headers = httpResponse.Headers - }; + return GetResponseInfo(httpResponse, memoryStream, memoryStream.Length); } } } @@ -367,6 +349,38 @@ private async Task SendAsync(HttpRequestOptions options, strin } } + private HttpResponseInfo GetResponseInfo(HttpWebResponse httpResponse, Stream content, long? contentLength) + { + return new HttpResponseInfo + { + Content = content, + + StatusCode = httpResponse.StatusCode, + + ContentType = httpResponse.ContentType, + + Headers = httpResponse.Headers, + + ContentLength = contentLength + }; + } + + private HttpResponseInfo GetResponseInfo(HttpWebResponse httpResponse, string tempFile, long? contentLength) + { + return new HttpResponseInfo + { + TempFilePath = tempFile, + + StatusCode = httpResponse.StatusCode, + + ContentType = httpResponse.ContentType, + + Headers = httpResponse.Headers, + + ContentLength = contentLength + }; + } + public Task Post(HttpRequestOptions options) { return SendAsync(options, "POST"); @@ -493,16 +507,7 @@ public async Task GetTempFileResponse(HttpRequestOptions optio options.Progress.Report(100); - return new HttpResponseInfo - { - TempFilePath = tempFile, - - StatusCode = httpResponse.StatusCode, - - ContentType = httpResponse.ContentType, - - Headers = httpResponse.Headers - }; + return GetResponseInfo(httpResponse, tempFile, contentLength); } } catch (OperationCanceledException ex) diff --git a/MediaBrowser.Common/Net/HttpResponseInfo.cs b/MediaBrowser.Common/Net/HttpResponseInfo.cs index 83c98007d4..bc03192092 100644 --- a/MediaBrowser.Common/Net/HttpResponseInfo.cs +++ b/MediaBrowser.Common/Net/HttpResponseInfo.cs @@ -33,6 +33,12 @@ public class HttpResponseInfo /// The temp file path. public string TempFilePath { get; set; } + /// + /// Gets or sets the length of the content. + /// + /// The length of the content. + public long? ContentLength { get; set; } + /// /// Gets or sets the headers. /// diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index e682a0d2ff..954b36bf24 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -940,7 +940,7 @@ private BaseItem GetLinkedChild(LinkedChild info) // First get using the cached Id if (info.ItemId != Guid.Empty) { - item = LibraryManager.GetItemById(info.ItemId) as BaseItem; + item = LibraryManager.GetItemById(info.ItemId); } // If still null, search by path @@ -1098,7 +1098,9 @@ public BaseItem FindByPath(string path) return this; } - return RecursiveChildren.FirstOrDefault(i => string.Equals(i.Path, path, StringComparison.OrdinalIgnoreCase) || i.PhysicalLocations.Contains(path, StringComparer.OrdinalIgnoreCase)); + return RecursiveChildren.FirstOrDefault(i => string.Equals(i.Path, path, StringComparison.OrdinalIgnoreCase) || + (!i.IsFolder && !i.IsInMixedFolder && string.Equals(i.ContainingFolderPath, path, StringComparison.OrdinalIgnoreCase)) || + i.PhysicalLocations.Contains(path, StringComparer.OrdinalIgnoreCase)); } public override bool IsPlayed(User user) diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs index 2847c397e3..4fadd8f6e1 100644 --- a/MediaBrowser.Controller/Entities/TV/Season.cs +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -250,7 +250,16 @@ public string SeriesName /// SeasonInfo. public SeasonInfo GetLookupInfo() { - return GetItemLookupInfo(); + var id = GetItemLookupInfo(); + + var series = Series; + + if (series != null) + { + id.SeriesProviderIds = series.ProviderIds; + } + + return id; } /// diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index ada0aa6e29..0163dec206 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -683,6 +683,22 @@ protected virtual void FetchDataFromXmlNode(XmlReader reader, T item) } break; } + case "MusicbrainzId": + { + var mbz = reader.ReadElementContentAsString(); + if (!string.IsNullOrWhiteSpace(mbz)) + { + if (item is MusicAlbum) + { + item.SetProviderId(MetadataProviders.MusicBrainzAlbum, mbz); + } + else if (item is MusicArtist) + { + item.SetProviderId(MetadataProviders.MusicBrainzArtist, mbz); + } + } + break; + } case "MusicBrainzAlbumId": { var mbz = reader.ReadElementContentAsString(); diff --git a/MediaBrowser.Controller/Providers/ItemLookupInfo.cs b/MediaBrowser.Controller/Providers/ItemLookupInfo.cs index 665da28f48..c2409715ad 100644 --- a/MediaBrowser.Controller/Providers/ItemLookupInfo.cs +++ b/MediaBrowser.Controller/Providers/ItemLookupInfo.cs @@ -152,6 +152,11 @@ public class BookInfo : ItemLookupInfo public class SeasonInfo : ItemLookupInfo { - + public Dictionary SeriesProviderIds { get; set; } + + public SeasonInfo() + { + SeriesProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase); + } } } diff --git a/MediaBrowser.Providers/All/LocalImageProvider.cs b/MediaBrowser.Providers/All/LocalImageProvider.cs index 354b081cf5..dbdaa87a13 100644 --- a/MediaBrowser.Providers/All/LocalImageProvider.cs +++ b/MediaBrowser.Providers/All/LocalImageProvider.cs @@ -172,7 +172,7 @@ private void PopulatePrimaryImages(IHasImages item, List images, AddImage(files, images, imagePrefix + "movie", ImageType.Primary); } - if (string.IsNullOrEmpty(item.Path)) + if (!string.IsNullOrEmpty(item.Path)) { var name = Path.GetFileNameWithoutExtension(item.Path); diff --git a/MediaBrowser.Providers/Manager/ItemImageProvider.cs b/MediaBrowser.Providers/Manager/ItemImageProvider.cs index 7610f72490..a0ab069d3d 100644 --- a/MediaBrowser.Providers/Manager/ItemImageProvider.cs +++ b/MediaBrowser.Providers/Manager/ItemImageProvider.cs @@ -60,8 +60,8 @@ public async Task RefreshImages(IHasImages item, IEnumerable(); // In order to avoid duplicates, only download these if there are none already - var backdropLimit = item.HasImage(ImageType.Backdrop) ? 0 : savedOptions.GetLimit(ImageType.Backdrop); - var screenshotLimit = item.HasImage(ImageType.Screenshot) ? 0 : savedOptions.GetLimit(ImageType.Screenshot); + var backdropLimit = savedOptions.GetLimit(ImageType.Backdrop); + var screenshotLimit = savedOptions.GetLimit(ImageType.Screenshot); foreach (var provider in providers) { @@ -362,9 +362,25 @@ private async Task DownloadBackdrops(IHasImages item, ImageType imageType, int l { var response = await provider.GetImageResponse(url, cancellationToken).ConfigureAwait(false); + // If there's already an image of the same size, skip it + if (response.ContentLength.HasValue) + { + try + { + if (item.GetImages(imageType).Any(i => new FileInfo(i.Path).Length == response.ContentLength.Value)) + { + response.Content.Dispose(); + continue; + } + } + catch (IOException ex) + { + _logger.ErrorException("Error examining images", ex); + } + } + await _providerManager.SaveImage(item, response.Content, response.ContentType, imageType, null, cancellationToken).ConfigureAwait(false); result.UpdateType = result.UpdateType | ItemUpdateType.ImageUpdate; - break; } catch (HttpException ex) { diff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csproj index 393aae6fe2..a5ea1b64b2 100644 --- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj +++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj @@ -66,6 +66,9 @@ + + Properties\SharedVersion.cs + diff --git a/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs b/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs index 730d66cc21..9182587b18 100644 --- a/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs +++ b/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs @@ -334,7 +334,7 @@ public Task GetImageResponse(string url, CancellationToken can { CancellationToken = cancellationToken, Url = url, - ResourcePool = FanartArtistProvider.FanArtResourcePool + ResourcePool = FanartArtistProvider.Current.FanArtResourcePool }); } @@ -410,7 +410,7 @@ internal async Task DownloadMovieXml(string tmdbId, CancellationToken cancellati using (var response = await _httpClient.Get(new HttpRequestOptions { Url = url, - ResourcePool = FanartArtistProvider.FanArtResourcePool, + ResourcePool = FanartArtistProvider.Current.FanArtResourcePool, CancellationToken = cancellationToken }).ConfigureAwait(false)) diff --git a/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs b/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs index 93db4f5b49..ccab30bc6c 100644 --- a/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs +++ b/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs @@ -346,7 +346,7 @@ public Task GetImageResponse(string url, CancellationToken can { CancellationToken = cancellationToken, Url = url, - ResourcePool = FanartArtistProvider.FanArtResourcePool + ResourcePool = FanartArtistProvider.Current.FanArtResourcePool }); } diff --git a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs index b5557d6f06..270219a2bc 100644 --- a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs +++ b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs @@ -22,7 +22,7 @@ namespace MediaBrowser.Providers.Music { public class FanartArtistProvider : IRemoteImageProvider, IHasChangeMonitor, IHasOrder { - internal static readonly SemaphoreSlim FanArtResourcePool = new SemaphoreSlim(3, 3); + internal readonly SemaphoreSlim FanArtResourcePool = new SemaphoreSlim(3, 3); internal const string ApiKey = "5c6b04c68e904cfed1e6cbc9a9e683d4"; private const string FanArtBaseUrl = "http://api.fanart.tv/webservice/artist/{0}/{1}/xml/all/1/1"; diff --git a/MediaBrowser.Providers/Music/FanArtUpdatesPostScanTask.cs b/MediaBrowser.Providers/Music/FanArtUpdatesPostScanTask.cs index 5258860553..4c6706287c 100644 --- a/MediaBrowser.Providers/Music/FanArtUpdatesPostScanTask.cs +++ b/MediaBrowser.Providers/Music/FanArtUpdatesPostScanTask.cs @@ -110,7 +110,7 @@ private async Task> GetArtistIdsToUpdate(IEnumerable Url = string.Format(UpdatesUrl, FanartArtistProvider.ApiKey, lastUpdateTime), CancellationToken = cancellationToken, EnableHttpCompression = true, - ResourcePool = FanartArtistProvider.FanArtResourcePool + ResourcePool = FanartArtistProvider.Current.FanArtResourcePool }).ConfigureAwait(false)) { diff --git a/MediaBrowser.Providers/Music/MusicExternalIds.cs b/MediaBrowser.Providers/Music/MusicExternalIds.cs index e7340d0183..a25ab9deb2 100644 --- a/MediaBrowser.Providers/Music/MusicExternalIds.cs +++ b/MediaBrowser.Providers/Music/MusicExternalIds.cs @@ -46,7 +46,7 @@ public string UrlFormatString public bool Supports(IHasProviderIds item) { - return item is Audio || item is MusicAlbum; + return item is Audio; } } diff --git a/MediaBrowser.Providers/Omdb/OmdbProvider.cs b/MediaBrowser.Providers/Omdb/OmdbProvider.cs index 07fee988c6..75f9cf06d2 100644 --- a/MediaBrowser.Providers/Omdb/OmdbProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbProvider.cs @@ -12,7 +12,7 @@ namespace MediaBrowser.Providers.Omdb { public class OmdbProvider { - internal readonly SemaphoreSlim ResourcePool = new SemaphoreSlim(1, 1); + private static readonly SemaphoreSlim ResourcePool = new SemaphoreSlim(1, 1); private readonly IJsonSerializer _jsonSerializer; private readonly IHttpClient _httpClient; private readonly CultureInfo _usCulture = new CultureInfo("en-US"); diff --git a/MediaBrowser.Providers/Properties/AssemblyInfo.cs b/MediaBrowser.Providers/Properties/AssemblyInfo.cs index d69df15810..a110115693 100644 --- a/MediaBrowser.Providers/Properties/AssemblyInfo.cs +++ b/MediaBrowser.Providers/Properties/AssemblyInfo.cs @@ -28,9 +28,4 @@ // Minor Version // Build Number // Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +// \ No newline at end of file diff --git a/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs b/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs index eed91dfaa1..b8ab55db08 100644 --- a/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs +++ b/MediaBrowser.Providers/Savers/XmlSaverHelpers.cs @@ -53,6 +53,10 @@ public static class XmlSaverHelpers "MusicBrainzAlbumArtistId", "MusicBrainzAlbumId", "MusicBrainzReleaseGroupId", + + // Old - not used anymore + "MusicbrainzId", + "Overview", "Persons", "PlotKeywords", diff --git a/MediaBrowser.Providers/TV/FanArtSeasonProvider.cs b/MediaBrowser.Providers/TV/FanArtSeasonProvider.cs index 908094bdd5..9c5d70e3d4 100644 --- a/MediaBrowser.Providers/TV/FanArtSeasonProvider.cs +++ b/MediaBrowser.Providers/TV/FanArtSeasonProvider.cs @@ -264,7 +264,7 @@ public Task GetImageResponse(string url, CancellationToken can { CancellationToken = cancellationToken, Url = url, - ResourcePool = FanartArtistProvider.FanArtResourcePool + ResourcePool = FanartArtistProvider.Current.FanArtResourcePool }); } diff --git a/MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs b/MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs index 1b2530dba2..33100db730 100644 --- a/MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs +++ b/MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs @@ -111,7 +111,7 @@ private async Task> GetSeriesIdsToUpdate(IEnumerable Url = string.Format(UpdatesUrl, FanartArtistProvider.ApiKey, lastUpdateTime), CancellationToken = cancellationToken, EnableHttpCompression = true, - ResourcePool = FanartArtistProvider.FanArtResourcePool + ResourcePool = FanartArtistProvider.Current.FanArtResourcePool }).ConfigureAwait(false)) { diff --git a/MediaBrowser.Providers/TV/FanartSeriesProvider.cs b/MediaBrowser.Providers/TV/FanartSeriesProvider.cs index b640e373bd..f8fee5e3d3 100644 --- a/MediaBrowser.Providers/TV/FanartSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/FanartSeriesProvider.cs @@ -332,7 +332,7 @@ public Task GetImageResponse(string url, CancellationToken can { CancellationToken = cancellationToken, Url = url, - ResourcePool = FanartArtistProvider.FanArtResourcePool + ResourcePool = FanartArtistProvider.Current.FanArtResourcePool }); } @@ -414,7 +414,7 @@ internal async Task DownloadSeriesXml(string tvdbId, CancellationToken cancellat using (var response = await _httpClient.Get(new HttpRequestOptions { Url = url, - ResourcePool = FanartArtistProvider.FanArtResourcePool, + ResourcePool = FanartArtistProvider.Current.FanArtResourcePool, CancellationToken = cancellationToken }).ConfigureAwait(false)) diff --git a/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs b/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs index 920da9b10f..51eec86682 100644 --- a/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs @@ -175,23 +175,25 @@ internal Task EnsureSeriesInfo(string seriesId, string preferredMetadataLanguage var download = false; var automaticUpdatesEnabled = _config.Configuration.EnableTvDbUpdates; + const int cacheDays = 3; + var seriesFile = files.FirstOrDefault(i => string.Equals(seriesXmlFilename, i.Name, StringComparison.OrdinalIgnoreCase)); // No need to check age if automatic updates are enabled - if (seriesFile == null || !seriesFile.Exists || (!automaticUpdatesEnabled && (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(seriesFile)).TotalDays > 7)) + if (seriesFile == null || !seriesFile.Exists || (!automaticUpdatesEnabled && (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(seriesFile)).TotalDays > cacheDays)) { download = true; } var actorsXml = files.FirstOrDefault(i => string.Equals("actors.xml", i.Name, StringComparison.OrdinalIgnoreCase)); // No need to check age if automatic updates are enabled - if (actorsXml == null || !actorsXml.Exists || (!automaticUpdatesEnabled && (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(actorsXml)).TotalDays > 7)) + if (actorsXml == null || !actorsXml.Exists || (!automaticUpdatesEnabled && (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(actorsXml)).TotalDays > cacheDays)) { download = true; } var bannersXml = files.FirstOrDefault(i => string.Equals("banners.xml", i.Name, StringComparison.OrdinalIgnoreCase)); // No need to check age if automatic updates are enabled - if (bannersXml == null || !bannersXml.Exists || (!automaticUpdatesEnabled && (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(bannersXml)).TotalDays > 7)) + if (bannersXml == null || !bannersXml.Exists || (!automaticUpdatesEnabled && (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(bannersXml)).TotalDays > cacheDays)) { download = true; } diff --git a/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs b/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs index 5bf6587a90..b91067dd76 100644 --- a/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs +++ b/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs @@ -239,10 +239,17 @@ private List GetOtherDuplicatePaths(string targetPath, Series series, in var folder = Path.GetDirectoryName(targetPath); var targetFileNameWithoutExtension = Path.GetFileNameWithoutExtension(targetPath); - var filesOfOtherExtensions = Directory.EnumerateFiles(folder, "*", SearchOption.TopDirectoryOnly) - .Where(i => EntityResolutionHelper.IsVideoFile(i) && string.Equals(Path.GetFileNameWithoutExtension(i), targetFileNameWithoutExtension, StringComparison.OrdinalIgnoreCase)); + try + { + var filesOfOtherExtensions = Directory.EnumerateFiles(folder, "*", SearchOption.TopDirectoryOnly) + .Where(i => EntityResolutionHelper.IsVideoFile(i) && string.Equals(Path.GetFileNameWithoutExtension(i), targetFileNameWithoutExtension, StringComparison.OrdinalIgnoreCase)); - episodePaths.AddRange(filesOfOtherExtensions); + episodePaths.AddRange(filesOfOtherExtensions); + } + catch (DirectoryNotFoundException) + { + // No big deal. Maybe the season folder doesn't already exist. + } return episodePaths.Where(i => !string.Equals(i, targetPath, StringComparison.OrdinalIgnoreCase)) .Distinct(StringComparer.OrdinalIgnoreCase) diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index 7621d8b4be..6afe9367e5 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -216,11 +216,7 @@ private static void RunApplication(ServerApplicationPaths appPaths, ILogManager var initProgress = new Progress(); - if (runService) - { - StartService(logManager); - } - else + if (!runService) { ShowSplashScreen(_appHost.ApplicationVersion, initProgress, logManager.GetLogger("Splash")); @@ -235,18 +231,22 @@ private static void RunApplication(ServerApplicationPaths appPaths, ILogManager task = _appHost.RunStartupTasks(); Task.WaitAll(task); - if (!runService) + SystemEvents.SessionEnding += SystemEvents_SessionEnding; + SystemEvents.SessionSwitch += SystemEvents_SessionSwitch; + + if (runService) + { + StartService(logManager); + } + else { HideSplashScreen(); ShowTrayIcon(); + + task = ApplicationTaskCompletionSource.Task; + Task.WaitAll(task); } - - SystemEvents.SessionEnding += SystemEvents_SessionEnding; - SystemEvents.SessionSwitch += SystemEvents_SessionSwitch; - - task = ApplicationTaskCompletionSource.Task; - Task.WaitAll(task); } private static ServerNotifyIcon _serverNotifyIcon; diff --git a/MediaBrowser.WebDashboard/dashboard-ui/edititemimages.html b/MediaBrowser.WebDashboard/dashboard-ui/edititemimages.html index 155716d949..815788cda1 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/edititemimages.html +++ b/MediaBrowser.WebDashboard/dashboard-ui/edititemimages.html @@ -25,7 +25,7 @@

 

Upload @@ -94,7 +94,7 @@

Drop Image Here

-