Jump to content

RefreshInternetChannels for one specific channel only?


SimplyMe

Recommended Posts

SimplyMe

Executing the task "RefreshInternetChannels" refreshes all channels.

Is there a way to programatically refresh just a specific channel? 

I tried to fetch the channel using the library manager (as done in https://github.com/MediaBrowser/Emby/blob/1d7c2ab4bfebdae31f89fdaabd3b68782ccf495a/Emby.Server.Implementations/Channels/ChannelManager.cs#L283)

var id = _libraryManager.GetNewItemId("Channel " + channel.Name, typeof(Channel));
var embyChannel = _libraryManager.GetItemById(id) as Channel;
await embyChannel.RefreshMetadata(new MetadataRefreshOptions(_fileSystem)
{
    ForceSave = true
}, cancellationToken);

Sadly its not working. 

Link to comment
Share on other sites

10 hours ago, SimplyMe said:

Executing the task "RefreshInternetChannels" refreshes all channels.

Is there a way to programatically refresh just a specific channel? 

I tried to fetch the channel using the library manager (as done in https://github.com/MediaBrowser/Emby/blob/1d7c2ab4bfebdae31f89fdaabd3b68782ccf495a/Emby.Server.Implementations/Channels/ChannelManager.cs#L283)

var id = _libraryManager.GetNewItemId("Channel " + channel.Name, typeof(Channel));
var embyChannel = _libraryManager.GetItemById(id) as Channel;
await embyChannel.RefreshMetadata(new MetadataRefreshOptions(_fileSystem)
{
    ForceSave = true
}, cancellationToken);

Sadly its not working. 

The code above is for refreshing metadata..

To refresh channel content, you need to use IChannelManager.RefreshChannelContent

You can even restrict the refresh to a certain top-level folder in a channel with the restrictTopLevelFolderId parameter.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...