jellyfin-server/MediaBrowser.Api/HttpHandlers/AudioHandler.cs
LukePulverenti Luke Pulverenti luke pulverenti fbf3916bce Added an audio handler
2012-08-10 09:18:30 -04:00

46 lines
1.1 KiB
C#

using System;
using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Controller;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Api.HttpHandlers
{
public class AudioHandler : StaticFileHandler
{
private BaseItem _LibraryItem;
/// <summary>
/// Gets the library item that will be played, if any
/// </summary>
private BaseItem LibraryItem
{
get
{
if (_LibraryItem == null)
{
string id = QueryString["id"];
if (!string.IsNullOrEmpty(id))
{
_LibraryItem = Kernel.Instance.GetItemById(Guid.Parse(id));
}
}
return _LibraryItem;
}
}
public override string Path
{
get
{
if (LibraryItem != null)
{
return LibraryItem.Path;
}
return base.Path;
}
}
}
}