diff options
Diffstat (limited to 'MediaBrowser.Api/HttpHandlers/AudioHandler.cs')
| -rw-r--r-- | MediaBrowser.Api/HttpHandlers/AudioHandler.cs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/MediaBrowser.Api/HttpHandlers/AudioHandler.cs b/MediaBrowser.Api/HttpHandlers/AudioHandler.cs new file mode 100644 index 000000000..8ebaf04bc --- /dev/null +++ b/MediaBrowser.Api/HttpHandlers/AudioHandler.cs @@ -0,0 +1,45 @@ +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;
+ }
+ }
+ }
+}
|
