diff options
Diffstat (limited to 'MediaBrowser.Api')
| -rw-r--r-- | MediaBrowser.Api/GamesService.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.Api/MediaBrowser.Api.csproj | 10 | ||||
| -rw-r--r-- | MediaBrowser.Api/PackageService.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Api/SimilarItemsHelper.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Api/TvShowsService.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/ItemsService.cs | 41 | ||||
| -rw-r--r-- | MediaBrowser.Api/packages.config | 4 |
8 files changed, 38 insertions, 34 deletions
diff --git a/MediaBrowser.Api/GamesService.cs b/MediaBrowser.Api/GamesService.cs index 7f0521b535..14f5ba3da9 100644 --- a/MediaBrowser.Api/GamesService.cs +++ b/MediaBrowser.Api/GamesService.cs @@ -110,16 +110,19 @@ namespace MediaBrowser.Api { var summary = new GameSystemSummary { - Name = system.Name + Name = system.GameSystemName, + DisplayName = system.Name }; var items = user == null ? system.RecursiveChildren : system.GetRecursiveChildren(user); var games = items.OfType<Game>().ToList(); + summary.ClientInstalledGameCount = games.Count(i => !i.IsInstalledOnClient); + summary.GameCount = games.Count; - summary.GameFileExtensions = games.Select(i => Path.GetExtension(i.Path)) + summary.GameFileExtensions = games.Where(i => !i.IsInstalledOnClient).Select(i => Path.GetExtension(i.Path)) .Distinct(StringComparer.OrdinalIgnoreCase) .ToList(); diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj index 70e4e8a9a7..c7cca812fa 100644 --- a/MediaBrowser.Api/MediaBrowser.Api.csproj +++ b/MediaBrowser.Api/MediaBrowser.Api.csproj @@ -40,17 +40,17 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\morelinq.1.0.16006\lib\net35\MoreLinq.dll</HintPath> </Reference> - <Reference Include="ServiceStack.Common, Version=3.9.59.0, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="ServiceStack.Common, Version=3.9.60.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\ServiceStack.Common.3.9.59\lib\net35\ServiceStack.Common.dll</HintPath> + <HintPath>..\packages\ServiceStack.Common.3.9.62\lib\net35\ServiceStack.Common.dll</HintPath> </Reference> - <Reference Include="ServiceStack.Interfaces, Version=3.9.59.0, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="ServiceStack.Interfaces, Version=3.9.60.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\ServiceStack.Common.3.9.59\lib\net35\ServiceStack.Interfaces.dll</HintPath> + <HintPath>..\packages\ServiceStack.Common.3.9.62\lib\net35\ServiceStack.Interfaces.dll</HintPath> </Reference> <Reference Include="ServiceStack.Text, Version=3.9.59.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\ServiceStack.Text.3.9.59\lib\net35\ServiceStack.Text.dll</HintPath> + <HintPath>..\packages\ServiceStack.Text.3.9.62\lib\net35\ServiceStack.Text.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> diff --git a/MediaBrowser.Api/PackageService.cs b/MediaBrowser.Api/PackageService.cs index 563625a544..0c6ee20f79 100644 --- a/MediaBrowser.Api/PackageService.cs +++ b/MediaBrowser.Api/PackageService.cs @@ -132,7 +132,7 @@ namespace MediaBrowser.Api if (request.PackageType == PackageType.UserInstalled || request.PackageType == PackageType.All) { - result.AddRange(_installationManager.GetAvailablePluginUpdates(false, CancellationToken.None).Result.ToList()); + result.AddRange(_installationManager.GetAvailablePluginUpdates(_appHost.ApplicationVersion, false, CancellationToken.None).Result.ToList()); } else if (request.PackageType == PackageType.System || request.PackageType == PackageType.All) @@ -194,7 +194,7 @@ namespace MediaBrowser.Api public void Post(InstallPackage request) { var package = string.IsNullOrEmpty(request.Version) ? - _installationManager.GetLatestCompatibleVersion(request.Name, request.UpdateClass).Result : + _installationManager.GetLatestCompatibleVersion(request.Name, _appHost.ApplicationVersion, request.UpdateClass).Result : _installationManager.GetPackage(request.Name, request.UpdateClass, Version.Parse(request.Version)).Result; if (package == null) diff --git a/MediaBrowser.Api/SimilarItemsHelper.cs b/MediaBrowser.Api/SimilarItemsHelper.cs index 4103eff35d..9fc52caae7 100644 --- a/MediaBrowser.Api/SimilarItemsHelper.cs +++ b/MediaBrowser.Api/SimilarItemsHelper.cs @@ -45,7 +45,7 @@ namespace MediaBrowser.Api /// Fields to return within the items, in addition to basic information /// </summary> /// <value>The fields.</value> - [ApiMember(Name = "Fields", Description = "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimeted. Options: Budget, Chapters, CriticRatingSummary, DateCreated, Genres, HomePageUrl, ItemCounts, IndexOptions, MediaStreams, Overview, OverviewHtml, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] + [ApiMember(Name = "Fields", Description = "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimeted. Options: Budget, Chapters, CriticRatingSummary, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, OverviewHtml, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] public string Fields { get; set; } /// <summary> diff --git a/MediaBrowser.Api/TvShowsService.cs b/MediaBrowser.Api/TvShowsService.cs index e62959bee3..fcddd2ca65 100644 --- a/MediaBrowser.Api/TvShowsService.cs +++ b/MediaBrowser.Api/TvShowsService.cs @@ -43,7 +43,7 @@ namespace MediaBrowser.Api /// Fields to return within the items, in addition to basic information /// </summary> /// <value>The fields.</value> - [ApiMember(Name = "Fields", Description = "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimeted. Options: Budget, Chapters, CriticRatingSummary, DateCreated, Genres, HomePageUrl, ItemCounts, IndexOptions, MediaStreams, Overview, OverviewHtml, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] + [ApiMember(Name = "Fields", Description = "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimeted. Options: Budget, Chapters, CriticRatingSummary, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, OverviewHtml, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] public string Fields { get; set; } /// <summary> diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs index f92b7da450..eba36d8568 100644 --- a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs +++ b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs @@ -48,7 +48,7 @@ namespace MediaBrowser.Api.UserLibrary /// Fields to return within the items, in addition to basic information /// </summary> /// <value>The fields.</value> - [ApiMember(Name = "Fields", Description = "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimeted. Options: Budget, Chapters, CriticRatingSummary, DateCreated, Genres, HomePageUrl, ItemCounts, IndexOptions, MediaStreams, Overview, OverviewHtml, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] + [ApiMember(Name = "Fields", Description = "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimeted. Options: Budget, Chapters, CriticRatingSummary, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, OverviewHtml, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] public string Fields { get; set; } /// <summary> diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 65ece13acb..3437cdd5ab 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -12,7 +12,6 @@ using ServiceStack.ServiceHost; using System; using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; namespace MediaBrowser.Api.UserLibrary { @@ -64,6 +63,9 @@ namespace MediaBrowser.Api.UserLibrary [ApiMember(Name = "Genres", Description = "Optional. If specified, results will be filtered based on genre. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] public string Genres { get; set; } + [ApiMember(Name = "AllGenres", Description = "Optional. If specified, results will be filtered based on genre. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] + public string AllGenres { get; set; } + /// <summary> /// Limit results to items containing specific studios /// </summary> @@ -609,43 +611,42 @@ namespace MediaBrowser.Api.UserLibrary items = items.Where(item => imageTypes.Any(imageType => HasImage(item, imageType))); } - var genres = request.Genres; - // Apply genre filter - if (!string.IsNullOrEmpty(genres)) + if (!string.IsNullOrEmpty(request.Genres)) { - var vals = genres.Split(','); - items = items.Where(f => f.Genres != null && vals.Any(v => f.Genres.Contains(v, StringComparer.OrdinalIgnoreCase))); + var vals = request.Genres.Split(','); + items = items.Where(f => vals.Any(v => f.Genres.Contains(v, StringComparer.OrdinalIgnoreCase))); } - var studios = request.Studios; - + // Apply genre filter + if (!string.IsNullOrEmpty(request.AllGenres)) + { + var vals = request.AllGenres.Split(','); + items = items.Where(f => vals.All(v => f.Genres.Contains(v, StringComparer.OrdinalIgnoreCase))); + } + // Apply studio filter - if (!string.IsNullOrEmpty(studios)) + if (!string.IsNullOrEmpty(request.Studios)) { - var vals = studios.Split(','); - items = items.Where(f => f.Studios != null && vals.Any(v => f.Studios.Contains(v, StringComparer.OrdinalIgnoreCase))); + var vals = request.Studios.Split(','); + items = items.Where(f => vals.Any(v => f.Studios.Contains(v, StringComparer.OrdinalIgnoreCase))); } - var years = request.Years; - // Apply year filter - if (!string.IsNullOrEmpty(years)) + if (!string.IsNullOrEmpty(request.Years)) { - var vals = years.Split(',').Select(int.Parse); + var vals = request.Years.Split(',').Select(int.Parse).ToList(); items = items.Where(f => f.ProductionYear.HasValue && vals.Contains(f.ProductionYear.Value)); } - var personName = request.Person; - // Apply person filter - if (!string.IsNullOrEmpty(personName)) + if (!string.IsNullOrEmpty(request.Person)) { var personTypes = request.PersonTypes; if (string.IsNullOrEmpty(personTypes)) { - items = items.Where(item => item.People != null && item.People.Any(p => string.Equals(p.Name, personName, StringComparison.OrdinalIgnoreCase))); + items = items.Where(item => item.People != null && item.People.Any(p => string.Equals(p.Name, request.Person, StringComparison.OrdinalIgnoreCase))); } else { @@ -654,7 +655,7 @@ namespace MediaBrowser.Api.UserLibrary items = items.Where(item => item.People != null && item.People.Any(p => - p.Name.Equals(personName, StringComparison.OrdinalIgnoreCase) && (types.Contains(p.Type, StringComparer.OrdinalIgnoreCase) || types.Contains(p.Role, StringComparer.OrdinalIgnoreCase)))); + p.Name.Equals(request.Person, StringComparison.OrdinalIgnoreCase) && (types.Contains(p.Type, StringComparer.OrdinalIgnoreCase) || types.Contains(p.Role, StringComparer.OrdinalIgnoreCase)))); } } diff --git a/MediaBrowser.Api/packages.config b/MediaBrowser.Api/packages.config index 49090efc62..c9fec81005 100644 --- a/MediaBrowser.Api/packages.config +++ b/MediaBrowser.Api/packages.config @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="morelinq" version="1.0.16006" targetFramework="net45" /> - <package id="ServiceStack.Common" version="3.9.59" targetFramework="net45" /> - <package id="ServiceStack.Text" version="3.9.59" targetFramework="net45" /> + <package id="ServiceStack.Common" version="3.9.62" targetFramework="net45" /> + <package id="ServiceStack.Text" version="3.9.62" targetFramework="net45" /> </packages>
\ No newline at end of file |
