diff options
16 files changed, 183 insertions, 33 deletions
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index 07bbaff74..1f69183cc 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -293,7 +293,7 @@ namespace MediaBrowser.Api.Images if (string.IsNullOrEmpty(imagePath)) { - throw new ResourceNotFoundException(); + throw new ResourceNotFoundException(string.Format("{0} does not have an image of type {1}", item.Name, request.Type)); } // See if we can avoid a file system lookup by looking for the file in ResolveArgs diff --git a/MediaBrowser.Controller/Dto/DtoBuilder.cs b/MediaBrowser.Controller/Dto/DtoBuilder.cs index 0c47013bf..84f9f8827 100644 --- a/MediaBrowser.Controller/Dto/DtoBuilder.cs +++ b/MediaBrowser.Controller/Dto/DtoBuilder.cs @@ -566,29 +566,33 @@ namespace MediaBrowser.Controller.Dto return; } - // Attach People by transforming them into BaseItemPerson (DTO) - dto.People = new BaseItemPerson[item.People.Count]; - // Ordering by person type to ensure actors and artists are at the front. // This is taking advantage of the fact that they both begin with A // This should be improved in the future - var entities = await Task.WhenAll(item.People.OrderBy(i => i.Type).Select(c => + var people = item.People.OrderBy(i => i.Type).ToList(); + + // Attach People by transforming them into BaseItemPerson (DTO) + dto.People = new BaseItemPerson[people.Count]; + + var entities = await Task.WhenAll(people.Select(p => p.Name).Distinct(StringComparer.OrdinalIgnoreCase).Select(c => Task.Run(async () => { try { - return await _libraryManager.GetPerson(c.Name).ConfigureAwait(false); + return await _libraryManager.GetPerson(c).ConfigureAwait(false); } catch (IOException ex) { - _logger.ErrorException("Error getting person {0}", ex, c.Name); + _logger.ErrorException("Error getting person {0}", ex, c); return null; } }) )).ConfigureAwait(false); + var dictionary = entities.ToDictionary(i => i.Name, StringComparer.OrdinalIgnoreCase); + for (var i = 0; i < item.People.Count; i++) { var person = item.People[i]; @@ -600,15 +604,15 @@ namespace MediaBrowser.Controller.Dto Type = person.Type }; - var ibnObject = entities[i]; + Person entity; - if (ibnObject != null) + if (dictionary.TryGetValue(person.Name, out entity)) { - var primaryImagePath = ibnObject.PrimaryImagePath; + var primaryImagePath = entity.PrimaryImagePath; if (!string.IsNullOrEmpty(primaryImagePath)) { - baseItemPerson.PrimaryImageTag = Kernel.Instance.ImageManager.GetImageCacheTag(ibnObject, ImageType.Primary, primaryImagePath); + baseItemPerson.PrimaryImageTag = Kernel.Instance.ImageManager.GetImageCacheTag(entity, ImageType.Primary, primaryImagePath); } } diff --git a/MediaBrowser.Controller/Entities/BaseGame.cs b/MediaBrowser.Controller/Entities/BaseGame.cs new file mode 100644 index 000000000..5df1bfaf4 --- /dev/null +++ b/MediaBrowser.Controller/Entities/BaseGame.cs @@ -0,0 +1,30 @@ + +namespace MediaBrowser.Controller.Entities +{ + /// <summary> + /// Class BaseGame + /// </summary> + public class BaseGame : BaseItem + { + /// <summary> + /// Gets the type of the media. + /// </summary> + /// <value>The type of the media.</value> + public override string MediaType + { + get { return Model.Entities.MediaType.Game; } + } + + /// <summary> + /// Gets or sets the players supported. + /// </summary> + /// <value>The players supported.</value> + public int? PlayersSupported { get; set; } + + /// <summary> + /// Gets or sets the game system. + /// </summary> + /// <value>The game system.</value> + public string GameSystem { get; set; } + } +} diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 71245a3bb..90d3810d0 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -77,6 +77,7 @@ <Compile Include="Entities\Audio\Audio.cs" /> <Compile Include="Entities\Audio\MusicAlbum.cs" /> <Compile Include="Entities\Audio\MusicArtist.cs" /> + <Compile Include="Entities\BaseGame.cs" /> <Compile Include="Entities\BaseItem.cs" /> <Compile Include="Entities\BasePluginFolder.cs" /> <Compile Include="Entities\Folder.cs" /> diff --git a/MediaBrowser.Controller/Providers/ImageFromMediaLocationProvider.cs b/MediaBrowser.Controller/Providers/ImageFromMediaLocationProvider.cs index 4cd9b20a1..465cfec92 100644 --- a/MediaBrowser.Controller/Providers/ImageFromMediaLocationProvider.cs +++ b/MediaBrowser.Controller/Providers/ImageFromMediaLocationProvider.cs @@ -160,6 +160,7 @@ namespace MediaBrowser.Controller.Providers private void PopulateBaseItemImages(BaseItem item) { var backdropFiles = new List<string>(); + var screenshotFiles = new List<string>(); // Primary Image var image = GetImage(item, "folder"); @@ -201,6 +202,22 @@ namespace MediaBrowser.Controller.Providers item.SetImage(ImageType.Thumb, image.Value.Path); } + // Thumbnail Image + image = GetImage(item, "box"); + + if (image.HasValue) + { + item.SetImage(ImageType.Box, image.Value.Path); + } + + // Thumbnail Image + image = GetImage(item, "menu"); + + if (image.HasValue) + { + item.SetImage(ImageType.Menu, image.Value.Path); + } + // Backdrop Image image = GetImage(item, "backdrop"); @@ -234,7 +251,40 @@ namespace MediaBrowser.Controller.Providers { item.BackdropImagePaths = backdropFiles; } - } + // Screenshot Image + image = GetImage(item, "screenshot"); + + if (image.HasValue) + { + screenshotFiles.Add(image.Value.Path); + } + + unfound = 0; + for (var i = 1; i <= 20; i++) + { + // Screenshot Image + image = GetImage(item, "screenshot" + i); + + if (image.HasValue) + { + screenshotFiles.Add(image.Value.Path); + } + else + { + unfound++; + + if (unfound >= 3) + { + break; + } + } + } + + if (screenshotFiles.Count > 0) + { + item.ScreenshotImagePaths = screenshotFiles; + } + } } } diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj index ba79ff5d5..66ec69f08 100644 --- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj +++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj @@ -256,7 +256,7 @@ <ItemGroup> <EmbeddedResource Include="MediaEncoder\fonts\ARIALUNI.TTF" /> <EmbeddedResource Include="MediaEncoder\fonts\fonts.conf" /> - <EmbeddedResource Include="MediaEncoder\ffmpeg20130408.zip" /> + <EmbeddedResource Include="MediaEncoder\ffmpeg20130412.zip" /> <None Include="packages.config" /> </ItemGroup> <ItemGroup /> diff --git a/MediaBrowser.Server.Implementations/MediaEncoder/ffmpeg20130408.zip.REMOVED.git-id b/MediaBrowser.Server.Implementations/MediaEncoder/ffmpeg20130408.zip.REMOVED.git-id deleted file mode 100644 index c1a4c08b1..000000000 --- a/MediaBrowser.Server.Implementations/MediaEncoder/ffmpeg20130408.zip.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -13efb0e506699c6d90c23a7600b3556d91dd31a1
\ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/MediaEncoder/ffmpeg20130412.zip.REMOVED.git-id b/MediaBrowser.Server.Implementations/MediaEncoder/ffmpeg20130412.zip.REMOVED.git-id new file mode 100644 index 000000000..71f2b701c --- /dev/null +++ b/MediaBrowser.Server.Implementations/MediaEncoder/ffmpeg20130412.zip.REMOVED.git-id @@ -0,0 +1 @@ +1b75cc4abcfd185b6db07bbe433d010f947d50ae
\ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/Providers/ProviderManager.cs b/MediaBrowser.Server.Implementations/Providers/ProviderManager.cs index ff7222e7c..58bb232a2 100644 --- a/MediaBrowser.Server.Implementations/Providers/ProviderManager.cs +++ b/MediaBrowser.Server.Implementations/Providers/ProviderManager.cs @@ -237,7 +237,7 @@ namespace MediaBrowser.Server.Implementations.Providers } catch (OperationCanceledException ex) { - _logger.Debug("{0} cancelled for {1}", provider.GetType().Name, item.Name); + _logger.Debug("{0} canceled for {1}", provider.GetType().Name, item.Name); // If the outer cancellation token is the one that caused the cancellation, throw it if (cancellationToken.IsCancellationRequested && ex.CancellationToken == cancellationToken) diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index ad84b3ae3..a9bf0ac97 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -484,7 +484,14 @@ namespace MediaBrowser.WebDashboard.Api "userprofilespage.js", "wizardfinishpage.js", "wizardstartpage.js", - "wizarduserpage.js" + "wizarduserpage.js", + "gamesrecommendedpage.js", + "gamesystemspage.js", + "gamesystempage.js", + "gamespage.js", + "gamegenrepage.js", + "gamestudiospage.js", + "gamedetailpage.js" }; var memoryStream = new MemoryStream(); diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js index 4c88b35c3..fe361a868 100644 --- a/MediaBrowser.WebDashboard/ApiClient.js +++ b/MediaBrowser.WebDashboard/ApiClient.js @@ -95,6 +95,10 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { return name; }()); + function encodeName(name) { + return encodeURIComponent(name).replace("'", '%27'); + } + /** * Wraps around jQuery ajax methods to add additional info to the request. */ @@ -867,7 +871,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { throw new Error("null name"); } - var url = self.getUrl("Studios/" + name); + var url = self.getUrl("Studios/" + encodeName(name)); return self.ajax({ type: "GET", @@ -885,7 +889,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { throw new Error("null name"); } - var url = self.getUrl("Genres/" + name); + var url = self.getUrl("Genres/" + encodeName(name)); return self.ajax({ type: "GET", @@ -921,7 +925,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { throw new Error("null name"); } - var url = self.getUrl("Persons/" + name); + var url = self.getUrl("Persons/" + encodeName(name)); return self.ajax({ type: "GET", @@ -1047,7 +1051,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }; - var url = "Persons/" + name + "/Images/" + options.type; + var url = "Persons/" + encodeName(name) + "/Images/" + options.type; if (options.index != null) { url += "/" + options.index; @@ -1117,7 +1121,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }; - var url = "Genres/" + name + "/Images/" + options.type; + var url = "Genres/" + encodeName(name) + "/Images/" + options.type; if (options.index != null) { url += "/" + options.index; @@ -1131,7 +1135,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }; /** - * Constructs a url for a genre image + * Constructs a url for a studio image * @param {String} name * @param {Object} options * Options supports the following properties: @@ -1152,7 +1156,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }; - var url = "Studios/" + name + "/Images/" + options.type; + var url = "Studios/" + encodeName(name) + "/Images/" + options.type; if (options.index != null) { url += "/" + options.index; @@ -1739,7 +1743,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { throw new Error("null name"); } - var url = self.getUrl("Users/" + userId + "/ItemsByName/Favorites/" + name); + var url = self.getUrl("Users/" + userId + "/ItemsByName/Favorites/" + encodeName(name)); var method = isFavorite ? "POST" : "DELETE"; @@ -1766,7 +1770,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { throw new Error("null name"); } - var url = self.getUrl("Users/" + userId + "/ItemsByName/" + name + "/Rating", { + var url = self.getUrl("Users/" + userId + "/ItemsByName/" + encodeName(name) + "/Rating", { likes: likes }); @@ -1791,7 +1795,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { throw new Error("null name"); } - var url = self.getUrl("Users/" + userId + "/ItemsByName/" + name + "/Rating"); + var url = self.getUrl("Users/" + userId + "/ItemsByName/" + encodeName(name) + "/Rating"); return self.ajax({ type: "DELETE", @@ -1815,7 +1819,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { throw new Error("null name"); } - var url = self.getUrl("Users/" + userId + "/ItemsByName/" + name + "/UserData"); + var url = self.getUrl("Users/" + userId + "/ItemsByName/" + encodeName(name) + "/UserData"); return self.ajax({ type: "GET", diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 4aaa0e3d4..a8f796148 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -186,6 +186,27 @@ <Content Include="dashboard-ui\css\userimage.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\gamedetail.html">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\gamegenres.html">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\games.html">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\gamesrecommended.html">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\gamestudios.html">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\gamesystem.html">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\gamesystems.html">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\index.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -228,6 +249,27 @@ <Content Include="dashboard-ui\scripts\boxsets.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\scripts\gamedetailpage.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\scripts\gamegenrepage.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\scripts\gamespage.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\scripts\gamesrecommendedpage.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\scripts\gamestudiospage.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\scripts\gamesystempage.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\scripts\gamesystemspage.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\scripts\itembynamedetailpage.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -308,6 +350,18 @@ <Content Include="dashboard-ui\thirdparty\video-js\video.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\thirdparty\video-js\video-js.min.css">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\thirdparty\video-js\video-js.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\thirdparty\video-js\video-js.swf">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="dashboard-ui\thirdparty\video-js\video.min.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\tvgenres.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config index 01740f591..edc26a238 100644 --- a/MediaBrowser.WebDashboard/packages.config +++ b/MediaBrowser.WebDashboard/packages.config @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="MediaBrowser.ApiClient.Javascript" version="3.0.76" targetFramework="net45" /> + <package id="MediaBrowser.ApiClient.Javascript" version="3.0.77" targetFramework="net45" /> <package id="ServiceStack.Common" version="3.9.43" targetFramework="net45" /> <package id="ServiceStack.Text" version="3.9.43" targetFramework="net45" /> </packages>
\ No newline at end of file diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 7663d918b..213a00da5 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Common.Internal</id> - <version>3.0.76</version> + <version>3.0.77</version> <title>MediaBrowser.Common.Internal</title> <authors>Luke</authors> <owners>ebr,Luke,scottisafool</owners> @@ -12,7 +12,7 @@ <description>Contains common components shared by Media Browser Theatre and Media Browser Server. Not intended for plugin developer consumption.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.74" /> + <dependency id="MediaBrowser.Common" version="3.0.77" /> <dependency id="NLog" version="2.0.0.2000" /> <dependency id="ServiceStack.Text" version="3.9.38" /> <dependency id="protobuf-net" version="2.0.0.621" /> diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index a2202f1db..4a645f87e 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata> <id>MediaBrowser.Common</id> - <version>3.0.76</version> + <version>3.0.77</version> <title>MediaBrowser.Common</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index b6870c309..7e1cef288 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata> <id>MediaBrowser.Server.Core</id> - <version>3.0.76</version> + <version>3.0.77</version> <title>Media Browser.Server.Core</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> @@ -12,7 +12,7 @@ <description>Contains core components required to build plugins for Media Browser Server.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.76" /> + <dependency id="MediaBrowser.Common" version="3.0.77" /> </dependencies> </metadata> <files> |
