You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Server.Impleme.../Channels/RefreshChannelsScheduledTas...

64 lines
1.6 KiB

using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Model.Tasks;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace MediaBrowser.Server.Implementations.Channels
{
class RefreshChannelsScheduledTask : IScheduledTask, IConfigurableScheduledTask
{
private readonly IChannelManager _manager;
public RefreshChannelsScheduledTask(IChannelManager manager)
{
_manager = manager;
}
public string Name
{
get { return "Refresh Channels"; }
}
public string Description
{
get { return "Refreshes internet channel information."; }
}
public string Category
{
get { return "Channels"; }
}
public Task Execute(System.Threading.CancellationToken cancellationToken, IProgress<double> progress)
{
var manager = (ChannelManager)_manager;
return manager.RefreshChannels(progress, cancellationToken);
}
public IEnumerable<ITaskTrigger> GetDefaultTriggers()
{
return new ITaskTrigger[]
{
new StartupTrigger{DelayMs = 10000},
new SystemEventTrigger{ SystemEvent = SystemEvent.WakeFromSleep},
new IntervalTrigger{ Interval = TimeSpan.FromHours(24)}
};
}
public bool IsHidden
{
get { return true; }
}
public bool IsEnabled
{
get { return true; }
}
}
}