aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-06-01 10:49:23 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-06-01 10:49:23 -0400
commitf2abd8ba39eefd5397eb3f0e327efbca8d8ecd0f (patch)
treeb2759d5a30620db61d324d00d5956d9bfc4e43e1 /MediaBrowser.Controller
parent68e64feafd1e5e91522938fa91217d3d9ce26e62 (diff)
update live tv database
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Channels/ChannelAudioItem.cs1
-rw-r--r--MediaBrowser.Controller/Channels/ChannelFolderItem.cs1
-rw-r--r--MediaBrowser.Controller/Channels/ChannelVideoItem.cs1
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs6
-rw-r--r--MediaBrowser.Controller/Entities/IHasProgramAttributes.cs9
-rw-r--r--MediaBrowser.Controller/Entities/IHasStartDate.cs9
-rw-r--r--MediaBrowser.Controller/Entities/InternalItemsQuery.cs12
-rw-r--r--MediaBrowser.Controller/Library/ILibraryManager.cs8
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveTvProgram.cs20
-rw-r--r--MediaBrowser.Controller/MediaBrowser.Controller.csproj2
-rw-r--r--MediaBrowser.Controller/Persistence/IItemRepository.cs29
11 files changed, 65 insertions, 33 deletions
diff --git a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs
index 82fe66c7b..aa4b6731c 100644
--- a/MediaBrowser.Controller/Channels/ChannelAudioItem.cs
+++ b/MediaBrowser.Controller/Channels/ChannelAudioItem.cs
@@ -15,7 +15,6 @@ namespace MediaBrowser.Controller.Channels
{
public string ExternalId { get; set; }
- public string ChannelId { get; set; }
public string DataVersion { get; set; }
public ChannelItemType ChannelItemType { get; set; }
diff --git a/MediaBrowser.Controller/Channels/ChannelFolderItem.cs b/MediaBrowser.Controller/Channels/ChannelFolderItem.cs
index 641d37161..7e9da52a9 100644
--- a/MediaBrowser.Controller/Channels/ChannelFolderItem.cs
+++ b/MediaBrowser.Controller/Channels/ChannelFolderItem.cs
@@ -12,7 +12,6 @@ namespace MediaBrowser.Controller.Channels
{
public string ExternalId { get; set; }
- public string ChannelId { get; set; }
public string DataVersion { get; set; }
public ChannelItemType ChannelItemType { get; set; }
diff --git a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs
index ef3cc7cba..ca5e343f8 100644
--- a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs
+++ b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs
@@ -16,7 +16,6 @@ namespace MediaBrowser.Controller.Channels
{
public string ExternalId { get; set; }
- public string ChannelId { get; set; }
public string DataVersion { get; set; }
public ChannelItemType ChannelItemType { get; set; }
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 8b6cbdc93..014b3ae6a 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -59,6 +59,12 @@ namespace MediaBrowser.Controller.Entities
public List<ItemImageInfo> ImageInfos { get; set; }
+ /// <summary>
+ /// Gets or sets the channel identifier.
+ /// </summary>
+ /// <value>The channel identifier.</value>
+ public string ChannelId { get; set; }
+
[IgnoreDataMember]
public virtual bool SupportsAddingToPlaylist
{
diff --git a/MediaBrowser.Controller/Entities/IHasProgramAttributes.cs b/MediaBrowser.Controller/Entities/IHasProgramAttributes.cs
new file mode 100644
index 000000000..1878d8d2c
--- /dev/null
+++ b/MediaBrowser.Controller/Entities/IHasProgramAttributes.cs
@@ -0,0 +1,9 @@
+
+namespace MediaBrowser.Controller.Entities
+{
+ public interface IHasProgramAttributes
+ {
+ bool IsMovie { get; set; }
+ bool IsSports { get; set; }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/IHasStartDate.cs b/MediaBrowser.Controller/Entities/IHasStartDate.cs
new file mode 100644
index 000000000..a6714fb96
--- /dev/null
+++ b/MediaBrowser.Controller/Entities/IHasStartDate.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace MediaBrowser.Controller.Entities
+{
+ public interface IHasStartDate
+ {
+ DateTime StartDate { get; set; }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
index 727f756f1..245c11169 100644
--- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
+++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
@@ -73,6 +73,17 @@ namespace MediaBrowser.Controller.Entities
public string[] Tags { get; set; }
public string[] OfficialRatings { get; set; }
+ public DateTime? MinStartDate { get; set; }
+ public DateTime? MaxStartDate { get; set; }
+ public DateTime? MinEndDate { get; set; }
+ public DateTime? MaxEndDate { get; set; }
+ public bool? IsAiring { get; set; }
+
+ public bool? IsMovie { get; set; }
+ public bool? IsSports { get; set; }
+
+ public string[] ChannelIds { get; set; }
+
public InternalItemsQuery()
{
Tags = new string[] { };
@@ -89,6 +100,7 @@ namespace MediaBrowser.Controller.Entities
Years = new int[] { };
PersonTypes = new string[] { };
PersonIds = new string[] { };
+ ChannelIds = new string[] { };
}
}
}
diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs
index c00912115..aa8799fa6 100644
--- a/MediaBrowser.Controller/Library/ILibraryManager.cs
+++ b/MediaBrowser.Controller/Library/ILibraryManager.cs
@@ -10,6 +10,7 @@ using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
+using MediaBrowser.Model.Querying;
namespace MediaBrowser.Controller.Library
{
@@ -133,6 +134,13 @@ namespace MediaBrowser.Controller.Library
BaseItem GetItemById(Guid id);
/// <summary>
+ /// Gets the items.
+ /// </summary>
+ /// <param name="query">The query.</param>
+ /// <returns>QueryResult&lt;BaseItem&gt;.</returns>
+ QueryResult<BaseItem> GetItems(InternalItemsQuery query);
+
+ /// <summary>
/// Gets the memory item by identifier.
/// </summary>
/// <param name="id">The identifier.</param>
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
index 0609df4c6..8232c5c7a 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
@@ -1,5 +1,4 @@
using MediaBrowser.Controller.Entities;
-using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.LiveTv;
@@ -7,12 +6,10 @@ using MediaBrowser.Model.Users;
using System;
using System.Linq;
using System.Runtime.Serialization;
-using System.Threading;
-using System.Threading.Tasks;
namespace MediaBrowser.Controller.LiveTv
{
- public class LiveTvProgram : BaseItem, ILiveTvItem, IHasLookupInfo<LiveTvProgramLookupInfo>
+ public class LiveTvProgram : BaseItem, ILiveTvItem, IHasLookupInfo<LiveTvProgramLookupInfo>, IHasStartDate, IHasProgramAttributes
{
/// <summary>
/// Gets the user data key.
@@ -29,12 +26,6 @@ namespace MediaBrowser.Controller.LiveTv
public string ExternalId { get; set; }
/// <summary>
- /// Gets or sets the channel identifier.
- /// </summary>
- /// <value>The channel identifier.</value>
- public string ExternalChannelId { get; set; }
-
- /// <summary>
/// Gets or sets the original air date.
/// </summary>
/// <value>The original air date.</value>
@@ -204,15 +195,6 @@ namespace MediaBrowser.Controller.LiveTv
return "Program";
}
- public override Task UpdateToRepository(ItemUpdateType updateReason, CancellationToken cancellationToken)
- {
- DateLastSaved = DateTime.UtcNow;
-
- // Avoid library manager and keep out of in-memory cache
- // Not great that this class has to know about that, but we'll improve that later.
- return ItemRepository.SaveItem(this, cancellationToken);
- }
-
protected override bool GetBlockUnratedValue(UserPolicy config)
{
return config.BlockUnratedItems.Contains(UnratedItem.LiveTvProgram);
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index b66e6b9c8..e1a18164e 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -149,10 +149,12 @@
<Compile Include="Entities\IHasOriginalTitle.cs" />
<Compile Include="Entities\IHasPreferredMetadataLanguage.cs" />
<Compile Include="Entities\IHasProductionLocations.cs" />
+ <Compile Include="Entities\IHasProgramAttributes.cs" />
<Compile Include="Entities\IHasScreenshots.cs" />
<Compile Include="Entities\IHasSeries.cs" />
<Compile Include="Entities\IHasShortOverview.cs" />
<Compile Include="Entities\IHasSpecialFeatures.cs" />
+ <Compile Include="Entities\IHasStartDate.cs" />
<Compile Include="Entities\IHasTaglines.cs" />
<Compile Include="Entities\IHasTags.cs" />
<Compile Include="Entities\IHasThemeMedia.cs" />
diff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.cs
index aa5376ec3..7c02a0ea1 100644
--- a/MediaBrowser.Controller/Persistence/IItemRepository.cs
+++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs
@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
+using MediaBrowser.Model.Querying;
namespace MediaBrowser.Controller.Persistence
{
@@ -103,13 +104,6 @@ namespace MediaBrowser.Controller.Persistence
IEnumerable<Guid> GetChildren(Guid parentId);
/// <summary>
- /// Gets the type of the items of.
- /// </summary>
- /// <param name="type">The type.</param>
- /// <returns>IEnumerable{Guid}.</returns>
- IEnumerable<Guid> GetItemIdsOfType(Type type);
-
- /// <summary>
/// Saves the children.
/// </summary>
/// <param name="parentId">The parent id.</param>
@@ -135,11 +129,24 @@ namespace MediaBrowser.Controller.Persistence
Task SaveMediaStreams(Guid id, IEnumerable<MediaStream> streams, CancellationToken cancellationToken);
/// <summary>
- /// Gets the type of the items of.
+ /// Gets the item ids.
/// </summary>
- /// <param name="type">The type.</param>
- /// <returns>IEnumerable&lt;BaseItem&gt;.</returns>
- IEnumerable<BaseItem> GetItemsOfType(Type type);
+ /// <param name="query">The query.</param>
+ /// <returns>IEnumerable&lt;Guid&gt;.</returns>
+ QueryResult<Guid> GetItemIds(InternalItemsQuery query);
+ /// <summary>
+ /// Gets the items.
+ /// </summary>
+ /// <param name="query">The query.</param>
+ /// <returns>QueryResult&lt;BaseItem&gt;.</returns>
+ QueryResult<BaseItem> GetItems(InternalItemsQuery query);
+
+ /// <summary>
+ /// Gets the item ids list.
+ /// </summary>
+ /// <param name="query">The query.</param>
+ /// <returns>List&lt;Guid&gt;.</returns>
+ List<Guid> GetItemIdsList(InternalItemsQuery query);
}
}