The Free Software Media System - Server Backend & API
added image by name api methods
Luke Pulverenti73b76a4f189e
diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.csindex e644f1f313..0c95f61120 100644--- a/MediaBrowser.Api/BaseApiService.cs+++ b/MediaBrowser.Api/BaseApiService.cs@@ -76,6 +76,16 @@ namespace MediaBrowser.Api{return ResultFactory.GetCachedResult(RequestContext, cacheKey, lastDateModified, cacheDuration, factoryFn, contentType);}++ /// <summary>+ /// To the static file result.+ /// </summary>+ /// <param name="path">The path.</param>+ /// <returns>System.Object.</returns>+ protected object ToStaticFileResult(string path)+ {+ return ResultFactory.GetStaticFileResult(RequestContext, path);+ }}/// <summary>diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csprojindex 579a8d2411..1d0777bd59 100644--- a/MediaBrowser.Api/MediaBrowser.Api.csproj+++ b/MediaBrowser.Api/MediaBrowser.Api.csproj@@ -64,6 +64,7 @@<Compile Include="BaseApiService.cs" /><Compile Include="DisplayPreferencesService.cs" /><Compile Include="EnvironmentService.cs" />+ <Compile Include="Images\ImageByNameService.cs" /><Compile Include="Images\ImageRequest.cs" /><Compile Include="Images\ImageService.cs" /><Compile Include="Images\ImageWriter.cs" />diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.csindex 3e5da5b533..04b6a656d5 100644--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs@@ -635,7 +635,7 @@ namespace MediaBrowser.Api.Playback/// </summary>/// <param name="process">The process.</param>/// <param name="state">The state.</param>- protected void OnFfMpegProcessExited(Process process, StreamState state)+ protected async void OnFfMpegProcessExited(Process process, StreamState state){if (state.IsoMount != null){@@ -667,6 +667,8 @@ namespace MediaBrowser.Api.Playback{Logger.Info("Deleting partial stream file(s) {0}", outputFilePath);+ await Task.Delay(1000).ConfigureAwait(false);+try{DeletePartialStreamFiles(outputFilePath);diff --git a/MediaBrowser.Api/TvShowsService.cs b/MediaBrowser.Api/TvShowsService.csindex 840b88af56..84b9a66b62 100644--- a/MediaBrowser.Api/TvShowsService.cs+++ b/MediaBrowser.Api/TvShowsService.cs@@ -171,7 +171,8 @@ namespace MediaBrowser.Api{var allEpisodes = series.GetRecursiveChildren(user).OfType<Episode>()- .OrderByDescending(i => i.PremiereDate)+ .OrderByDescending(i => i.PremiereDate ?? DateTime.MinValue)+ .ThenByDescending(i => i.IndexNumber ?? 0).ToList();Episode lastWatched = null;diff --git a/MediaBrowser.Controller/IServerApplicationPaths.cs b/MediaBrowser.Controller/IServerApplicationPaths.csindex 09f2f5e8e6..9325d20545 100644--- a/MediaBrowser.Controller/IServerApplicationPaths.cs+++ b/MediaBrowser.Controller/IServerApplicationPaths.cs@@ -70,6 +70,12 @@ namespace MediaBrowser.Controller/// <value>The ratings path.</value>string RatingsPath { get; }+ /// <summary>+ /// Gets the media info images path.+ /// </summary>+ /// <value>The media info images path.</value>+ string MediaInfoImagesPath { get; }+/// <summary>/// Gets the path to the user configuration directory/// </summary>diff --git a/MediaBrowser.Controller/Providers/Music/FanArtArtistProvider.cs b/MediaBrowser.Controller/Providers/Music/FanArtArtistProvider.csindex ba07da2c12..86c7a22f49 100644--- a/MediaBrowser.Controller/Providers/Music/FanArtArtistProvider.cs+++ b/MediaBrowser.Controller/Providers/Music/FanArtArtistProvider.cs@@ -1,6 +1,7 @@using MediaBrowser.Common.Net;using MediaBrowser.Controller.Configuration;using MediaBrowser.Controller.Entities;+using MediaBrowser.Controller.Entities.Audio;using MediaBrowser.Model.Entities;using MediaBrowser.Model.Logging;using MediaBrowser.Model.Net;@@ -49,7 +50,7 @@ namespace MediaBrowser.Controller.Providers.Music/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>public override bool Supports(BaseItem item){- return false;+ return item is MusicArtist;}protected virtual bool SaveLocalMetadiff --git a/MediaBrowser.Controller/Providers/Music/LastfmArtistProvider.cs b/MediaBrowser.Controller/Providers/Music/LastfmArtistProvider.csindex 8fabf2368d..c846fcd97a 100644--- a/MediaBrowser.Controller/Providers/Music/LastfmArtistProvider.cs+++ b/MediaBrowser.Controller/Providers/Music/LastfmArtistProvider.cs@@ -90,7 +90,7 @@ namespace MediaBrowser.Controller.Providers.Musicpublic override bool Supports(BaseItem item){- return false;+ return item is MusicArtist;}}}diff --git a/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs b/MediaBrowser.Server.Implementations/ServerApplicationPaths.csindex 6d345a99c5..c30c1b9db2 100644--- a/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs+++ b/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs@@ -132,6 +132,7 @@ namespace MediaBrowser.Server.Implementations_musicArtistsPath = null;_generalPath = null;_ratingsPath = null;+ _mediaInfoImagesPath = null;}}@@ -285,6 +286,31 @@ namespace MediaBrowser.Server.Implementations}}+ /// <summary>+ /// The _media info images path+ /// </summary>+ private string _mediaInfoImagesPath;+ /// <summary>+ /// Gets the media info images path.+ /// </summary>+ /// <value>The media info images path.</value>+ public string MediaInfoImagesPath+ {+ get+ {+ if (_mediaInfoImagesPath == null)+ {+ _mediaInfoImagesPath = Path.Combine(ItemsByNamePath, "MediaInfo");+ if (!Directory.Exists(_mediaInfoImagesPath))+ {+ Directory.CreateDirectory(_mediaInfoImagesPath);+ }+ }++ return _mediaInfoImagesPath;+ }+ }+/// <summary>/// The _user configuration directory path/// </summary>