added image by name api methods

This commit is contained in:
Luke Pulverenti 2013-05-02 10:30:38 -04:00
parent b11d06f36f
commit 73b76a4f18
8 changed files with 51 additions and 4 deletions

View File

@ -76,6 +76,16 @@ namespace MediaBrowser.Api
{ {
return ResultFactory.GetCachedResult(RequestContext, cacheKey, lastDateModified, cacheDuration, factoryFn, contentType); 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> /// <summary>

View File

@ -64,6 +64,7 @@
<Compile Include="BaseApiService.cs" /> <Compile Include="BaseApiService.cs" />
<Compile Include="DisplayPreferencesService.cs" /> <Compile Include="DisplayPreferencesService.cs" />
<Compile Include="EnvironmentService.cs" /> <Compile Include="EnvironmentService.cs" />
<Compile Include="Images\ImageByNameService.cs" />
<Compile Include="Images\ImageRequest.cs" /> <Compile Include="Images\ImageRequest.cs" />
<Compile Include="Images\ImageService.cs" /> <Compile Include="Images\ImageService.cs" />
<Compile Include="Images\ImageWriter.cs" /> <Compile Include="Images\ImageWriter.cs" />

View File

@ -635,7 +635,7 @@ namespace MediaBrowser.Api.Playback
/// </summary> /// </summary>
/// <param name="process">The process.</param> /// <param name="process">The process.</param>
/// <param name="state">The state.</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) if (state.IsoMount != null)
{ {
@ -667,6 +667,8 @@ namespace MediaBrowser.Api.Playback
{ {
Logger.Info("Deleting partial stream file(s) {0}", outputFilePath); Logger.Info("Deleting partial stream file(s) {0}", outputFilePath);
await Task.Delay(1000).ConfigureAwait(false);
try try
{ {
DeletePartialStreamFiles(outputFilePath); DeletePartialStreamFiles(outputFilePath);

View File

@ -171,7 +171,8 @@ namespace MediaBrowser.Api
{ {
var allEpisodes = series.GetRecursiveChildren(user) var allEpisodes = series.GetRecursiveChildren(user)
.OfType<Episode>() .OfType<Episode>()
.OrderByDescending(i => i.PremiereDate) .OrderByDescending(i => i.PremiereDate ?? DateTime.MinValue)
.ThenByDescending(i => i.IndexNumber ?? 0)
.ToList(); .ToList();
Episode lastWatched = null; Episode lastWatched = null;

View File

@ -70,6 +70,12 @@ namespace MediaBrowser.Controller
/// <value>The ratings path.</value> /// <value>The ratings path.</value>
string RatingsPath { get; } string RatingsPath { get; }
/// <summary>
/// Gets the media info images path.
/// </summary>
/// <value>The media info images path.</value>
string MediaInfoImagesPath { get; }
/// <summary> /// <summary>
/// Gets the path to the user configuration directory /// Gets the path to the user configuration directory
/// </summary> /// </summary>

View File

@ -1,6 +1,7 @@
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net; using MediaBrowser.Model.Net;
@ -49,7 +50,7 @@ namespace MediaBrowser.Controller.Providers.Music
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
public override bool Supports(BaseItem item) public override bool Supports(BaseItem item)
{ {
return false; return item is MusicArtist;
} }
protected virtual bool SaveLocalMeta protected virtual bool SaveLocalMeta

View File

@ -90,7 +90,7 @@ namespace MediaBrowser.Controller.Providers.Music
public override bool Supports(BaseItem item) public override bool Supports(BaseItem item)
{ {
return false; return item is MusicArtist;
} }
} }
} }

View File

@ -132,6 +132,7 @@ namespace MediaBrowser.Server.Implementations
_musicArtistsPath = null; _musicArtistsPath = null;
_generalPath = null; _generalPath = null;
_ratingsPath = 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> /// <summary>
/// The _user configuration directory path /// The _user configuration directory path
/// </summary> /// </summary>