mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
update channels
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using MediaBrowser.Common.Progress;
|
||||
using MediaBrowser.Controller.Channels;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Channels;
|
||||
using MediaBrowser.Model.Logging;
|
||||
@@ -28,7 +29,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
public async Task Run(IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
var users = _userManager.Users
|
||||
.DistinctBy(ChannelDownloadScheduledTask.GetUserDistinctValue)
|
||||
.DistinctBy(GetUserDistinctValue)
|
||||
.Select(i => i.Id.ToString("N"))
|
||||
.ToList();
|
||||
|
||||
@@ -54,6 +55,15 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
progress.Report(100);
|
||||
}
|
||||
|
||||
public static string GetUserDistinctValue(User user)
|
||||
{
|
||||
var channels = user.Policy.EnabledChannels
|
||||
.OrderBy(i => i)
|
||||
.ToList();
|
||||
|
||||
return string.Join("|", channels.ToArray());
|
||||
}
|
||||
|
||||
private async Task DownloadContent(string user, CancellationToken cancellationToken, IProgress<double> progress)
|
||||
{
|
||||
var channels = await _channelManager.GetChannelsInternal(new ChannelQuery
|
||||
|
||||
Reference in New Issue
Block a user