aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Controller/LiveTv/EventArgs.cs12
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvService.cs10
-rw-r--r--MediaBrowser.Controller/MediaBrowser.Controller.csproj1
-rw-r--r--MediaBrowser.Model/ApiClient/IApiClient.cs48
-rw-r--r--MediaBrowser.Model/LiveTv/RecordingInfoDto.cs6
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs24
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs1
-rw-r--r--Nuget/MediaBrowser.Common.Internal.nuspec4
-rw-r--r--Nuget/MediaBrowser.Common.nuspec2
-rw-r--r--Nuget/MediaBrowser.Server.Core.nuspec4
10 files changed, 102 insertions, 10 deletions
diff --git a/MediaBrowser.Controller/LiveTv/EventArgs.cs b/MediaBrowser.Controller/LiveTv/EventArgs.cs
new file mode 100644
index 000000000..90ea329fe
--- /dev/null
+++ b/MediaBrowser.Controller/LiveTv/EventArgs.cs
@@ -0,0 +1,12 @@
+using MediaBrowser.Model.LiveTv;
+using System;
+
+namespace MediaBrowser.Controller.LiveTv
+{
+ public class RecordingStatusChangedEventArgs : EventArgs
+ {
+ public string RecordingId { get; set; }
+
+ public RecordingStatus NewStatus { get; set; }
+ }
+}
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
index 004f0b452..7217b6e13 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
@@ -11,6 +11,16 @@ namespace MediaBrowser.Controller.LiveTv
public interface ILiveTvService
{
/// <summary>
+ /// Occurs when [data source changed].
+ /// </summary>
+ event EventHandler DataSourceChanged;
+
+ /// <summary>
+ /// Occurs when [recording status changed].
+ /// </summary>
+ event EventHandler<RecordingStatusChangedEventArgs> RecordingStatusChanged;
+
+ /// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index ec6c88705..9452700b5 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -112,6 +112,7 @@
<Compile Include="Library\ItemUpdateType.cs" />
<Compile Include="Library\IUserDataManager.cs" />
<Compile Include="Library\UserDataSaveEventArgs.cs" />
+ <Compile Include="LiveTv\EventArgs.cs" />
<Compile Include="LiveTv\ILiveTvRecording.cs" />
<Compile Include="LiveTv\LiveStreamInfo.cs" />
<Compile Include="LiveTv\LiveTvAudioRecording.cs" />
diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs
index c5b5311b2..55ca9edc7 100644
--- a/MediaBrowser.Model/ApiClient/IApiClient.cs
+++ b/MediaBrowser.Model/ApiClient/IApiClient.cs
@@ -2,6 +2,7 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization;
+using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Notifications;
using MediaBrowser.Model.Plugins;
using MediaBrowser.Model.Querying;
@@ -749,6 +750,22 @@ namespace MediaBrowser.Model.ApiClient
string GetImageUrl(BaseItemDto item, ImageOptions options);
/// <summary>
+ /// Gets the image URL.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="options">The options.</param>
+ /// <returns>System.String.</returns>
+ string GetImageUrl(ChannelInfoDto item, ImageOptions options);
+
+ /// <summary>
+ /// Gets the image URL.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="options">The options.</param>
+ /// <returns>System.String.</returns>
+ string GetImageUrl(RecordingInfoDto item, ImageOptions options);
+
+ /// <summary>
/// Gets an image url that can be used to download an image from the api
/// </summary>
/// <param name="itemId">The Id of the item</param>
@@ -918,5 +935,36 @@ namespace MediaBrowser.Model.ApiClient
/// <returns>System.String.</returns>
/// <exception cref="ArgumentNullException">options</exception>
string GetHlsVideoStreamUrl(VideoStreamOptions options);
+
+ /// <summary>
+ /// Gets the live tv information asynchronous.
+ /// </summary>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task{LiveTvInfo}.</returns>
+ Task<LiveTvInfo> GetLiveTvInfoAsync(CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Gets the live tv channels asynchronous.
+ /// </summary>
+ /// <param name="query">The query.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task{LiveTvInfo}.</returns>
+ Task<QueryResult<ChannelInfoDto>> GetLiveTvChannelsAsync(ChannelQuery query, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Gets the live tv recordings asynchronous.
+ /// </summary>
+ /// <param name="query">The query.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task{QueryResult{RecordingInfoDto}}.</returns>
+ Task<QueryResult<RecordingInfoDto>> GetLiveTvRecordingsAsync(RecordingQuery query, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Gets the live tv recording groups asynchronous.
+ /// </summary>
+ /// <param name="query">The query.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task{QueryResult{RecordingGroupDto}}.</returns>
+ Task<QueryResult<RecordingGroupDto>> GetLiveTvRecordingGroupsAsync(RecordingGroupQuery query, CancellationToken cancellationToken);
}
} \ No newline at end of file
diff --git a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs
index c1161f4ec..4d56d0ae3 100644
--- a/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/RecordingInfoDto.cs
@@ -1,7 +1,7 @@
-using System;
-using System.Collections.Generic;
-using MediaBrowser.Model.Dto;
+using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
+using System;
+using System.Collections.Generic;
namespace MediaBrowser.Model.LiveTv
{
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
index eff919f17..5da6e697d 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -1,5 +1,6 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO;
+using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Drawing;
@@ -37,6 +38,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
private readonly IUserDataManager _userDataManager;
private readonly ILibraryManager _libraryManager;
private readonly IMediaEncoder _mediaEncoder;
+ private readonly ITaskManager _taskManager;
private readonly LiveTvDtoService _tvDtoService;
@@ -81,7 +83,27 @@ namespace MediaBrowser.Server.Implementations.LiveTv
{
_services.AddRange(services);
- ActiveService = _services.FirstOrDefault();
+ SetActiveService(_services.FirstOrDefault());
+ }
+
+ private void SetActiveService(ILiveTvService service)
+ {
+ if (ActiveService != null)
+ {
+ ActiveService.DataSourceChanged -= service_DataSourceChanged;
+ }
+
+ ActiveService = service;
+
+ if (service != null)
+ {
+ service.DataSourceChanged += service_DataSourceChanged;
+ }
+ }
+
+ void service_DataSourceChanged(object sender, EventArgs e)
+ {
+ _taskManager.CancelIfRunningAndQueue<RefreshChannelsScheduledTask>();
}
public Task<QueryResult<ChannelInfoDto>> GetChannels(ChannelQuery query, CancellationToken cancellationToken)
diff --git a/MediaBrowser.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs b/MediaBrowser.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs
index fe565e094..1edd79d69 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs
@@ -42,7 +42,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
{
return new ITaskTrigger[]
{
-
new StartupTrigger(),
new SystemEventTrigger{ SystemEvent = SystemEvent.WakeFromSleep},
diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec
index e325c9804..0505b0992 100644
--- a/Nuget/MediaBrowser.Common.Internal.nuspec
+++ b/Nuget/MediaBrowser.Common.Internal.nuspec
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common.Internal</id>
- <version>3.0.301</version>
+ <version>3.0.302</version>
<title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners>
@@ -12,7 +12,7 @@
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Media Browser 2013</copyright>
<dependencies>
- <dependency id="MediaBrowser.Common" version="3.0.301" />
+ <dependency id="MediaBrowser.Common" version="3.0.302" />
<dependency id="NLog" version="2.1.0" />
<dependency id="SimpleInjector" version="2.4.0" />
<dependency id="sharpcompress" version="0.10.2" />
diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec
index 4a8b2f700..e6ea16efa 100644
--- a/Nuget/MediaBrowser.Common.nuspec
+++ b/Nuget/MediaBrowser.Common.nuspec
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
- <version>3.0.301</version>
+ <version>3.0.302</version>
<title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>
diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec
index 9cbcf30a4..2935fb958 100644
--- a/Nuget/MediaBrowser.Server.Core.nuspec
+++ b/Nuget/MediaBrowser.Server.Core.nuspec
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
- <version>3.0.301</version>
+ <version>3.0.302</version>
<title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright>
<dependencies>
- <dependency id="MediaBrowser.Common" version="3.0.301" />
+ <dependency id="MediaBrowser.Common" version="3.0.302" />
</dependencies>
</metadata>
<files>