blob: 8ebaf04bcd68db1580ff7c65b321f8b2448ee8ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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;
}
}
}
}
|