2015-01-26 23:47:16 +01:00
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
using MediaBrowser.Controller.Entities.Audio;
|
2014-02-21 16:24:29 +01:00
|
|
|
|
using MediaBrowser.Model.Configuration;
|
2013-12-19 22:51:32 +01:00
|
|
|
|
using MediaBrowser.Model.Entities;
|
2014-12-20 07:06:27 +01:00
|
|
|
|
using MediaBrowser.Model.Users;
|
2015-01-13 04:46:44 +01:00
|
|
|
|
using System.Linq;
|
2013-12-19 22:51:32 +01:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.LiveTv
|
|
|
|
|
{
|
2014-01-01 19:26:31 +01:00
|
|
|
|
public class LiveTvAudioRecording : Audio, ILiveTvRecording
|
2013-12-19 22:51:32 +01:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the user data key.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>System.String.</returns>
|
2015-01-24 23:33:26 +01:00
|
|
|
|
protected override string CreateUserDataKey()
|
2013-12-19 22:51:32 +01:00
|
|
|
|
{
|
2014-01-06 02:59:21 +01:00
|
|
|
|
var name = GetClientTypeName();
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(RecordingInfo.ProgramId))
|
|
|
|
|
{
|
|
|
|
|
return name + "-" + RecordingInfo.ProgramId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return name + "-" + RecordingInfo.Name + (RecordingInfo.EpisodeTitle ?? string.Empty);
|
2013-12-19 22:51:32 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public RecordingInfo RecordingInfo { get; set; }
|
|
|
|
|
|
|
|
|
|
public string ServiceName { get; set; }
|
|
|
|
|
|
2014-02-07 23:40:03 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a value indicating whether this instance is owned item.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value>
|
2015-01-26 23:47:16 +01:00
|
|
|
|
[IgnoreDataMember]
|
2014-02-07 23:40:03 +01:00
|
|
|
|
public override bool IsOwnedItem
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-26 23:47:16 +01:00
|
|
|
|
[IgnoreDataMember]
|
2013-12-19 22:51:32 +01:00
|
|
|
|
public override string MediaType
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2014-01-01 19:26:31 +01:00
|
|
|
|
return Model.Entities.MediaType.Audio;
|
2013-12-19 22:51:32 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-26 23:47:16 +01:00
|
|
|
|
[IgnoreDataMember]
|
2013-12-19 22:51:32 +01:00
|
|
|
|
public override LocationType LocationType
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2014-01-01 19:26:31 +01:00
|
|
|
|
if (!string.IsNullOrEmpty(Path))
|
|
|
|
|
{
|
|
|
|
|
return base.LocationType;
|
|
|
|
|
}
|
|
|
|
|
|
2013-12-19 22:51:32 +01:00
|
|
|
|
return LocationType.Remote;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string GetClientTypeName()
|
|
|
|
|
{
|
|
|
|
|
return "Recording";
|
|
|
|
|
}
|
2014-01-01 19:26:31 +01:00
|
|
|
|
|
|
|
|
|
public override bool IsSaveLocalMetadataEnabled()
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2014-02-11 05:55:01 +01:00
|
|
|
|
|
2015-01-26 23:47:16 +01:00
|
|
|
|
[IgnoreDataMember]
|
2014-02-11 05:55:01 +01:00
|
|
|
|
public override bool SupportsLocalMetadata
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-02-21 16:24:29 +01:00
|
|
|
|
|
2014-12-20 07:06:27 +01:00
|
|
|
|
protected override bool GetBlockUnratedValue(UserPolicy config)
|
2014-02-21 16:24:29 +01:00
|
|
|
|
{
|
|
|
|
|
return config.BlockUnratedItems.Contains(UnratedItem.LiveTvProgram);
|
|
|
|
|
}
|
2015-01-13 04:46:44 +01:00
|
|
|
|
|
|
|
|
|
protected override string GetInternalMetadataPath(string basePath)
|
|
|
|
|
{
|
|
|
|
|
return System.IO.Path.Combine(basePath, "livetv", Id.ToString("N"));
|
|
|
|
|
}
|
2013-12-19 22:51:32 +01:00
|
|
|
|
}
|
|
|
|
|
}
|