aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/LiveTv
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-02-14 16:35:09 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-02-14 16:35:09 -0500
commitdaa0b6cd0ecefd60611752802d062c15e6da85de (patch)
treef58a16e47afed9b61471e3871280faa9fc8bd951 /MediaBrowser.Controller/LiveTv
parent7d26b8995f313917829573a7cd96c37decc9158a (diff)
parentfd5f12e76227d96c52cdc31b67ef9543b485169b (diff)
Merge branch 'beta'
Diffstat (limited to 'MediaBrowser.Controller/LiveTv')
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvManager.cs11
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs17
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveTvChannel.cs4
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveTvProgram.cs48
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs17
-rw-r--r--MediaBrowser.Controller/LiveTv/RecordingGroup.cs6
6 files changed, 68 insertions, 35 deletions
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
index 241b01405..05c7448c3 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
@@ -45,6 +45,13 @@ namespace MediaBrowser.Controller.LiveTv
Task DeleteRecording(string id);
/// <summary>
+ /// Deletes the recording.
+ /// </summary>
+ /// <param name="recording">The recording.</param>
+ /// <returns>Task.</returns>
+ Task DeleteRecording(ILiveTvRecording recording);
+
+ /// <summary>
/// Cancels the timer.
/// </summary>
/// <param name="id">The identifier.</param>
@@ -338,9 +345,9 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary>
/// <param name="item">The item.</param>
/// <param name="dto">The dto.</param>
- /// <param name="addChannelInfo">if set to <c>true</c> [add channel information].</param>
+ /// <param name="fields">The fields.</param>
/// <param name="user">The user.</param>
- void AddInfoToProgramDto(BaseItem item, BaseItemDto dto, bool addChannelInfo, User user = null);
+ void AddInfoToProgramDto(BaseItem item, BaseItemDto dto, List<ItemFields> fields, User user = null);
/// <summary>
/// Saves the tuner host.
/// </summary>
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs
index 03c05ec69..c3d843f85 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs
@@ -9,6 +9,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
+using System.Threading.Tasks;
+using MediaBrowser.Controller.Library;
namespace MediaBrowser.Controller.LiveTv
{
@@ -36,7 +38,6 @@ namespace MediaBrowser.Controller.LiveTv
public bool IsLive { get; set; }
[IgnoreDataMember]
public bool IsPremiere { get; set; }
- public ProgramAudio? Audio { get; set; }
/// <summary>
/// Gets the user data key.
@@ -106,9 +107,9 @@ namespace MediaBrowser.Controller.LiveTv
}
}
- protected override bool GetBlockUnratedValue(UserPolicy config)
+ public override UnratedItem GetBlockUnratedType()
{
- return config.BlockUnratedItems.Contains(UnratedItem.LiveTvProgram);
+ return UnratedItem.LiveTvProgram;
}
protected override string GetInternalMetadataPath(string basePath)
@@ -140,5 +141,15 @@ namespace MediaBrowser.Controller.LiveTv
return list;
}
+
+ public override bool IsVisibleStandalone(User user)
+ {
+ return IsVisible(user);
+ }
+
+ public override Task Delete(DeleteOptions options)
+ {
+ return LiveTvManager.DeleteRecording(this);
+ }
}
}
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs
index 89168c578..8c4ee92cd 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs
@@ -22,9 +22,9 @@ namespace MediaBrowser.Controller.LiveTv
return GetClientTypeName() + "-" + Name;
}
- protected override bool GetBlockUnratedValue(UserPolicy config)
+ public override UnratedItem GetBlockUnratedType()
{
- return config.BlockUnratedItems.Contains(UnratedItem.LiveTvChannel);
+ return UnratedItem.LiveTvChannel;
}
/// <summary>
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
index 88bbe19b7..fcd065e79 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
@@ -40,10 +40,11 @@ namespace MediaBrowser.Controller.LiveTv
}
/// <summary>
- /// Gets or sets the type of the channel.
+ /// Gets or sets the name.
/// </summary>
- /// <value>The type of the channel.</value>
- public ChannelType ChannelType { get; set; }
+ /// <value>The name.</value>
+ [IgnoreDataMember]
+ public string ServiceName { get; set; }
/// <summary>
/// The start date of the program, in UTC.
@@ -52,12 +53,6 @@ namespace MediaBrowser.Controller.LiveTv
public DateTime StartDate { get; set; }
/// <summary>
- /// Gets or sets the audio.
- /// </summary>
- /// <value>The audio.</value>
- public ProgramAudio? Audio { get; set; }
-
- /// <summary>
/// Gets or sets a value indicating whether this instance is repeat.
/// </summary>
/// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
@@ -72,12 +67,6 @@ namespace MediaBrowser.Controller.LiveTv
public string EpisodeTitle { get; set; }
/// <summary>
- /// Gets or sets the name of the service.
- /// </summary>
- /// <value>The name of the service.</value>
- public string ServiceName { get; set; }
-
- /// <summary>
/// Gets or sets a value indicating whether this instance is movie.
/// </summary>
/// <value><c>true</c> if this instance is movie; otherwise, <c>false</c>.</value>
@@ -153,14 +142,14 @@ namespace MediaBrowser.Controller.LiveTv
}
}
- [IgnoreDataMember]
- public override string MediaType
- {
- get
- {
- return ChannelType == ChannelType.TV ? Model.Entities.MediaType.Video : Model.Entities.MediaType.Audio;
- }
- }
+ //[IgnoreDataMember]
+ //public override string MediaType
+ //{
+ // get
+ // {
+ // return ChannelType == ChannelType.TV ? Model.Entities.MediaType.Video : Model.Entities.MediaType.Audio;
+ // }
+ //}
[IgnoreDataMember]
public bool IsAiring
@@ -189,9 +178,9 @@ namespace MediaBrowser.Controller.LiveTv
return "Program";
}
- protected override bool GetBlockUnratedValue(UserPolicy config)
+ public override UnratedItem GetBlockUnratedType()
{
- return config.BlockUnratedItems.Contains(UnratedItem.LiveTvProgram);
+ return UnratedItem.LiveTvProgram;
}
protected override string GetInternalMetadataPath(string basePath)
@@ -236,5 +225,14 @@ namespace MediaBrowser.Controller.LiveTv
return base.SupportsPeople;
}
}
+
+ [IgnoreDataMember]
+ public override bool SupportsAncestors
+ {
+ get
+ {
+ return false;
+ }
+ }
}
}
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs
index 27594317d..5492a29f3 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs
@@ -9,6 +9,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
+using System.Threading.Tasks;
+using MediaBrowser.Controller.Library;
namespace MediaBrowser.Controller.LiveTv
{
@@ -36,7 +38,6 @@ namespace MediaBrowser.Controller.LiveTv
public bool IsLive { get; set; }
[IgnoreDataMember]
public bool IsPremiere { get; set; }
- public ProgramAudio? Audio { get; set; }
/// <summary>
/// Gets the user data key.
@@ -121,9 +122,9 @@ namespace MediaBrowser.Controller.LiveTv
}
}
- protected override bool GetBlockUnratedValue(UserPolicy config)
+ public override UnratedItem GetBlockUnratedType()
{
- return config.BlockUnratedItems.Contains(UnratedItem.LiveTvProgram);
+ return UnratedItem.LiveTvProgram;
}
protected override string GetInternalMetadataPath(string basePath)
@@ -155,5 +156,15 @@ namespace MediaBrowser.Controller.LiveTv
return list;
}
+
+ public override bool IsVisibleStandalone(User user)
+ {
+ return IsVisible(user);
+ }
+
+ public override Task Delete(DeleteOptions options)
+ {
+ return LiveTvManager.DeleteRecording(this);
+ }
}
}
diff --git a/MediaBrowser.Controller/LiveTv/RecordingGroup.cs b/MediaBrowser.Controller/LiveTv/RecordingGroup.cs
index 175cf162b..2d58ef67f 100644
--- a/MediaBrowser.Controller/LiveTv/RecordingGroup.cs
+++ b/MediaBrowser.Controller/LiveTv/RecordingGroup.cs
@@ -1,4 +1,5 @@
using MediaBrowser.Controller.Entities;
+using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Users;
namespace MediaBrowser.Controller.LiveTv
@@ -11,6 +12,11 @@ namespace MediaBrowser.Controller.LiveTv
return false;
}
+ public override UnratedItem GetBlockUnratedType()
+ {
+ return UnratedItem.LiveTvProgram;
+ }
+
public override bool SupportsLocalMetadata
{
get