From fb98b0c8e0e1b22f006493bd4311c2407cc438db Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 4 Oct 2013 11:22:03 -0400 Subject: [PATCH] updated nuget --- MediaBrowser.Api/ApiEntryPoint.cs | 2 +- .../Playback/Hls/VideoHlsService.cs | 5 ----- .../UserLibrary/BaseItemsByNameService.cs | 10 ++++++++- MediaBrowser.Controller/Entities/Folder.cs | 7 ++++--- .../Library/IIntroProvider.cs | 6 ++++++ .../Querying/ItemsByNameQuery.cs | 18 +++++++++++++++- MediaBrowser.Model/Querying/PersonsQuery.cs | 3 +-- .../Movies/FanArtMovieProvider.cs | 2 ++ .../Movies/MovieDbProvider.cs | 2 +- .../Movies/OpenMovieDatabaseProvider.cs | 18 ++++++++++++---- .../Music/FanArtArtistProvider.cs | 2 ++ MediaBrowser.Providers/TV/FanArtTVProvider.cs | 2 ++ .../TV/RemoteSeriesProvider.cs | 6 +++++- .../TV/TvdbSeriesImageProvider.cs | 6 +++++- .../WebSocket/AlchemyServer.cs | 21 ++++++++++++------- .../FFMpeg/FFMpegDownloader.cs | 4 ++-- .../MediaBrowser.ServerApplication.csproj | 6 +++--- .../packages.config | 2 +- Nuget/MediaBrowser.Common.Internal.nuspec | 4 ++-- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 ++-- 21 files changed, 94 insertions(+), 38 deletions(-) diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs index 343672877a..07b24c2592 100644 --- a/MediaBrowser.Api/ApiEntryPoint.cs +++ b/MediaBrowser.Api/ApiEntryPoint.cs @@ -182,7 +182,7 @@ namespace MediaBrowser.Api if (job.ActiveRequestCount == 0) { - var timerDuration = type == TranscodingJobType.Progressive ? 1000 : 120000; + var timerDuration = type == TranscodingJobType.Progressive ? 1000 : 180000; if (job.KillTimer == null) { diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index 8b01e27021..9701853948 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -23,11 +23,6 @@ namespace MediaBrowser.Api.Playback.Hls [ApiMember(Name = "TimeStampOffsetMs", Description = "Optional. Alter the timestamps in the playlist by a given amount, in ms. Default is 1000.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] public int TimeStampOffsetMs { get; set; } - - public GetHlsVideoStream() - { - TimeStampOffsetMs = 1000; - } } /// diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs index 0cb6148ccd..2bac30fe25 100644 --- a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs +++ b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs @@ -138,7 +138,12 @@ namespace MediaBrowser.Api.UserLibrary { if (!string.IsNullOrEmpty(request.NameStartsWithOrGreater)) { - items = items.Where(i => string.Compare(request.NameStartsWithOrGreater, i.Name, StringComparison.CurrentCultureIgnoreCase) < 1); + items = items.Where(i => string.Compare(request.NameStartsWithOrGreater, i.SortName, StringComparison.CurrentCultureIgnoreCase) < 1); + } + + if (!string.IsNullOrEmpty(request.NameLessThan)) + { + items = items.Where(i => string.Compare(request.NameLessThan, i.SortName, StringComparison.CurrentCultureIgnoreCase) == 1); } var imageTypes = request.GetImageTypes().ToList(); @@ -274,6 +279,9 @@ namespace MediaBrowser.Api.UserLibrary [ApiMember(Name = "NameStartsWithOrGreater", Description = "Optional filter by items whose name is sorted equally or greater than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public string NameStartsWithOrGreater { get; set; } + [ApiMember(Name = "NameLessThan", Description = "Optional filter by items whose name is sorted less than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public string NameLessThan { get; set; } + public GetItemsByName() { Recursive = true; diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 95a68c009b..bcf62115ce 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -6,6 +6,7 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Localization; using MediaBrowser.Controller.Resolvers; using MediaBrowser.Model.Entities; +using MoreLinq; using System; using System.Collections; using System.Collections.Concurrent; @@ -1009,10 +1010,10 @@ namespace MediaBrowser.Controller.Entities continue; } - hasLinkedChildren = true; - if (child.IsVisible(user)) { + hasLinkedChildren = true; + list.Add(child); } } @@ -1058,7 +1059,7 @@ namespace MediaBrowser.Controller.Entities if (includeLinkedChildren && hasLinkedChildren) { - list = list.Distinct().ToList(); + list = list.DistinctBy(i => i.Id).ToList(); } return list; diff --git a/MediaBrowser.Controller/Library/IIntroProvider.cs b/MediaBrowser.Controller/Library/IIntroProvider.cs index f54c3a3299..990fa933c8 100644 --- a/MediaBrowser.Controller/Library/IIntroProvider.cs +++ b/MediaBrowser.Controller/Library/IIntroProvider.cs @@ -15,5 +15,11 @@ namespace MediaBrowser.Controller.Library /// The user. /// IEnumerable{System.String}. IEnumerable GetIntros(BaseItem item, User user); + + /// + /// Gets all intros. + /// + /// IEnumerable{System.String}. + IEnumerable GetAllIntros(); } } diff --git a/MediaBrowser.Model/Querying/ItemsByNameQuery.cs b/MediaBrowser.Model/Querying/ItemsByNameQuery.cs index 1d88496480..22ed79108e 100644 --- a/MediaBrowser.Model/Querying/ItemsByNameQuery.cs +++ b/MediaBrowser.Model/Querying/ItemsByNameQuery.cs @@ -67,10 +67,26 @@ namespace MediaBrowser.Model.Querying /// The sort by. public string[] SortBy { get; set; } + /// + /// Gets or sets the image types. + /// + /// The image types. public ImageType[] ImageTypes { get; set; } /// - /// Initializes a new instance of the class. + /// Gets or sets the name starts with or greater. + /// + /// The name starts with or greater. + public string NameStartsWithOrGreater { get; set; } + + /// + /// Gets or sets the name less than. + /// + /// The name less than. + public string NameLessThan { get; set; } + + /// + /// Initializes a new instance of the class. /// public ItemsByNameQuery() { diff --git a/MediaBrowser.Model/Querying/PersonsQuery.cs b/MediaBrowser.Model/Querying/PersonsQuery.cs index a859ece1f1..a4b7eab712 100644 --- a/MediaBrowser.Model/Querying/PersonsQuery.cs +++ b/MediaBrowser.Model/Querying/PersonsQuery.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Model.Entities; - + namespace MediaBrowser.Model.Querying { /// diff --git a/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs b/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs index 7538122936..ddc15a6127 100644 --- a/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs +++ b/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs @@ -263,6 +263,8 @@ namespace MediaBrowser.Providers.Movies var xmlPath = Path.Combine(movieDataPath, "fanart.xml"); + Directory.CreateDirectory(movieDataPath); + using (var response = await HttpClient.Get(new HttpRequestOptions { Url = url, diff --git a/MediaBrowser.Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Providers/Movies/MovieDbProvider.cs index 1b25dc58f3..424070f704 100644 --- a/MediaBrowser.Providers/Movies/MovieDbProvider.cs +++ b/MediaBrowser.Providers/Movies/MovieDbProvider.cs @@ -6,6 +6,7 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Serialization; +using MediaBrowser.Providers.Savers; using System; using System.Collections.Generic; using System.Globalization; @@ -15,7 +16,6 @@ using System.Net; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Providers.Savers; namespace MediaBrowser.Providers.Movies { diff --git a/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs b/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs index f6c0c9208c..35daaf2d25 100644 --- a/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs +++ b/MediaBrowser.Providers/Movies/OpenMovieDatabaseProvider.cs @@ -46,7 +46,7 @@ namespace MediaBrowser.Providers.Movies { get { - return "9"; + return "11"; } } @@ -189,10 +189,9 @@ namespace MediaBrowser.Providers.Movies // Grab series genres because imdb data is better than tvdb. Leave movies alone // But only do it if english is the preferred language because this data will not be localized if (!item.LockedFields.Contains(MetadataFields.Genres) && - item is Series && + ShouldFetchGenres(item) && !string.IsNullOrWhiteSpace(result.Genre) && - !string.Equals(result.Genre, "n/a", StringComparison.OrdinalIgnoreCase) - && string.Equals(ConfigurationManager.Configuration.PreferredMetadataLanguage, "en")) + !string.Equals(result.Genre, "n/a", StringComparison.OrdinalIgnoreCase)) { item.Genres.Clear(); @@ -206,6 +205,17 @@ namespace MediaBrowser.Providers.Movies } } + private bool ShouldFetchGenres(BaseItem item) + { + // Only fetch if other providers didn't get anything + if (item is Trailer) + { + return item.Genres.Count == 0; + } + + return item is Series; + } + protected class RootObject { public string Title { get; set; } diff --git a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs index 131c73f384..8013ddd3c7 100644 --- a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs +++ b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs @@ -274,6 +274,8 @@ namespace MediaBrowser.Providers.Music var xmlPath = Path.Combine(artistPath, "fanart.xml"); + Directory.CreateDirectory(artistPath); + using (var response = await HttpClient.Get(new HttpRequestOptions { Url = url, diff --git a/MediaBrowser.Providers/TV/FanArtTVProvider.cs b/MediaBrowser.Providers/TV/FanArtTVProvider.cs index 972665af7b..bf06514324 100644 --- a/MediaBrowser.Providers/TV/FanArtTVProvider.cs +++ b/MediaBrowser.Providers/TV/FanArtTVProvider.cs @@ -317,6 +317,8 @@ namespace MediaBrowser.Providers.TV var xmlPath = Path.Combine(seriesDataPath, "fanart.xml"); + Directory.CreateDirectory(seriesDataPath); + using (var response = await HttpClient.Get(new HttpRequestOptions { Url = url, diff --git a/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs b/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs index ef315f5cb2..0d2360d5bf 100644 --- a/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs @@ -238,7 +238,11 @@ namespace MediaBrowser.Providers.TV /// Task{System.Boolean}. private async Task FetchSeriesData(Series series, string seriesId, string seriesDataPath, bool isForcedRefresh, CancellationToken cancellationToken) { - var files = Directory.EnumerateFiles(seriesDataPath, "*.xml", SearchOption.TopDirectoryOnly).Select(Path.GetFileName).ToList(); + Directory.CreateDirectory(seriesDataPath); + + var files = Directory.EnumerateFiles(seriesDataPath, "*.xml", SearchOption.TopDirectoryOnly) + .Select(Path.GetFileName) + .ToList(); var seriesXmlFilename = ConfigurationManager.Configuration.PreferredMetadataLanguage.ToLower() + ".xml"; diff --git a/MediaBrowser.Providers/TV/TvdbSeriesImageProvider.cs b/MediaBrowser.Providers/TV/TvdbSeriesImageProvider.cs index 9e3799ab83..be97285c6c 100644 --- a/MediaBrowser.Providers/TV/TvdbSeriesImageProvider.cs +++ b/MediaBrowser.Providers/TV/TvdbSeriesImageProvider.cs @@ -150,12 +150,16 @@ namespace MediaBrowser.Providers.TV if (!string.IsNullOrEmpty(seriesId)) { // Process images - var imagesXmlPath = Path.Combine(RemoteSeriesProvider.GetSeriesDataPath(ConfigurationManager.ApplicationPaths, seriesId), "banners.xml"); + var seriesDataPath = RemoteSeriesProvider.GetSeriesDataPath(ConfigurationManager.ApplicationPaths, seriesId); + + var imagesXmlPath = Path.Combine(seriesDataPath, "banners.xml"); if (!series.HasImage(ImageType.Primary) || !series.HasImage(ImageType.Banner) || series.BackdropImagePaths.Count == 0) { var backdropLimit = ConfigurationManager.Configuration.MaxBackdrops; + Directory.CreateDirectory(seriesDataPath); + try { var fanartData = FetchFanartXmlData(imagesXmlPath, backdropLimit, cancellationToken); diff --git a/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs b/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs index 56296ba849..14d468a8e3 100644 --- a/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs +++ b/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs @@ -69,7 +69,7 @@ namespace MediaBrowser.Server.Implementations.WebSocket _hasStarted = true; } - catch (SocketException ex) + catch (Exception ex) { _logger.ErrorException("The web socket server is unable to start on port {0} due to a Socket error. This can occasionally happen when the operating system takes longer than usual to release the IP bindings from the previous session. This can take up to five minutes. Please try waiting or rebooting the system.", ex, portNumber); @@ -119,21 +119,28 @@ namespace MediaBrowser.Server.Implementations.WebSocket GC.SuppressFinalize(this); } + private readonly object _syncLock = new object(); + /// /// Releases unmanaged and - optionally - managed resources. /// /// true to release both managed and unmanaged resources; false to release only unmanaged resources. protected virtual void Dispose(bool dispose) { - if (WebSocketServer != null) + lock (_syncLock) { - if (_hasStarted) + if (WebSocketServer != null) { - WebSocketServer.Stop(); + if (_hasStarted) + { + _logger.Debug("Stopping alchemy server"); + WebSocketServer.Stop(); + } + + _logger.Debug("Disposing alchemy server"); + WebSocketServer.Dispose(); + WebSocketServer = null; } - - WebSocketServer.Dispose(); - WebSocketServer = null; } } } diff --git a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs index 88def28db3..fba3dd42c2 100644 --- a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs +++ b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs @@ -119,9 +119,9 @@ namespace MediaBrowser.ServerApplication.FFMpeg var files = Directory.EnumerateFiles(tempFolder, "*.exe", SearchOption.AllDirectories).ToList(); - foreach (var file in files) + foreach (var file in files.Where(i => i.IndexOf("ffprobe.exe", StringComparison.OrdinalIgnoreCase) != -1 || i.IndexOf("ffmpeg.exe", StringComparison.OrdinalIgnoreCase) != -1)) { - File.Copy(file, Path.Combine(targetFolder, Path.GetFileName(file))); + File.Copy(file, Path.Combine(targetFolder, Path.GetFileName(file)), true); } } finally diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index efc3adf568..ecd4891a9b 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -119,9 +119,9 @@ ..\packages\Hardcodet.Wpf.TaskbarNotification.1.0.4.0\lib\net40\Hardcodet.Wpf.TaskbarNotification.dll - + False - ..\packages\MediaBrowser.IsoMounting.3.0.60\lib\net45\MediaBrowser.IsoMounter.dll + ..\packages\MediaBrowser.IsoMounting.3.0.61\lib\net45\MediaBrowser.IsoMounter.dll False @@ -129,7 +129,7 @@ False - ..\packages\MediaBrowser.IsoMounting.3.0.60\lib\net45\pfmclrapi.dll + ..\packages\MediaBrowser.IsoMounting.3.0.61\lib\net45\pfmclrapi.dll False diff --git a/MediaBrowser.ServerApplication/packages.config b/MediaBrowser.ServerApplication/packages.config index f0601d4013..29b2cce5f4 100644 --- a/MediaBrowser.ServerApplication/packages.config +++ b/MediaBrowser.ServerApplication/packages.config @@ -1,7 +1,7 @@  - + diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 6714bb59e1..e9af79efb9 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.217 + 3.0.218 MediaBrowser.Common.Internal Luke ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption. Copyright © Media Browser 2013 - + diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 814a4cd7ee..10caee5744 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.217 + 3.0.218 MediaBrowser.Common Media Browser Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 8949054475..80e62afb2f 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.217 + 3.0.218 Media Browser.Server.Core Media Browser Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Media Browser Server. Copyright © Media Browser 2013 - +