mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 10:04:44 +01:00
remove IChannelItem interface
This commit is contained in:
@@ -1079,7 +1079,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(folderId))
|
||||
{
|
||||
var categoryItem = (IChannelItem)_libraryManager.GetItemById(new Guid(folderId));
|
||||
var categoryItem = _libraryManager.GetItemById(new Guid(folderId));
|
||||
|
||||
query.FolderId = categoryItem.ExternalId;
|
||||
}
|
||||
@@ -1195,7 +1195,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
}
|
||||
|
||||
private T GetItemById<T>(string idString, string channelName, string channnelDataVersion, out bool isNew)
|
||||
where T : BaseItem, IChannelItem, new()
|
||||
where T : BaseItem, new()
|
||||
{
|
||||
var id = GetIdToHash(idString, channelName).GetMBId(typeof(T));
|
||||
|
||||
@@ -1263,9 +1263,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
item.Tags = info.Tags;
|
||||
}
|
||||
|
||||
var channelItem = (IChannelItem)item;
|
||||
|
||||
channelItem.ChannelId = internalChannelId.ToString("N");
|
||||
item.ChannelId = internalChannelId.ToString("N");
|
||||
|
||||
if (item.ParentId != internalChannelId)
|
||||
{
|
||||
@@ -1273,11 +1271,11 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
}
|
||||
item.ParentId = internalChannelId;
|
||||
|
||||
if (!string.Equals(channelItem.ExternalId, info.Id, StringComparison.OrdinalIgnoreCase))
|
||||
if (!string.Equals(item.ExternalId, info.Id, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
forceUpdate = true;
|
||||
}
|
||||
channelItem.ExternalId = info.Id;
|
||||
item.ExternalId = info.Id;
|
||||
|
||||
var channelMediaItem = item as IChannelMediaItem;
|
||||
|
||||
|
||||
@@ -480,7 +480,7 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
|
||||
var folder = (Folder)item;
|
||||
|
||||
if (!(folder is IChannelItem) && !(folder is Channel))
|
||||
if (item.SourceType == SourceType.Library)
|
||||
{
|
||||
dto.ChildCount = GetChildCount(folder, user);
|
||||
|
||||
@@ -1531,10 +1531,9 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
|
||||
dto.ChannelId = item.ChannelId;
|
||||
|
||||
var channelItem = item as IChannelItem;
|
||||
if (channelItem != null)
|
||||
if (item.SourceType == SourceType.Channel)
|
||||
{
|
||||
dto.ChannelName = _channelManagerFactory().GetChannel(channelItem.ChannelId).Name;
|
||||
dto.ChannelName = _channelManagerFactory().GetChannel(item.ChannelId).Name;
|
||||
}
|
||||
|
||||
var channelMediaItem = item as IChannelMediaItem;
|
||||
|
||||
@@ -342,7 +342,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||
|
||||
void _libraryManager_ItemRemoved(object sender, ItemChangeEventArgs e)
|
||||
{
|
||||
if (e.Item is LiveTvProgram || e.Item is IChannelItem)
|
||||
if (e.Item.SourceType != SourceType.Library)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -356,7 +356,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||
|
||||
void _libraryManager_ItemAdded(object sender, ItemChangeEventArgs e)
|
||||
{
|
||||
if (e.Item is LiveTvProgram || e.Item is IChannelItem)
|
||||
if (e.Item.SourceType != SourceType.Library)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||
return false;
|
||||
}
|
||||
|
||||
return !(item is IChannelItem) && !(item is ILiveTvItem);
|
||||
return item.SourceType == SourceType.Library;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -346,7 +346,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
||||
return false;
|
||||
}
|
||||
|
||||
return !(item is IChannelItem) && !(item is ILiveTvItem);
|
||||
return item.SourceType == SourceType.Library;
|
||||
}
|
||||
|
||||
private async void LibraryUpdateTimerCallback(object state)
|
||||
|
||||
@@ -347,11 +347,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
|
||||
private void RegisterItem(Guid id, BaseItem item)
|
||||
{
|
||||
if (item is LiveTvProgram)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (item is IChannelItem)
|
||||
if (item.SourceType != SourceType.Library)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -536,7 +536,7 @@ namespace MediaBrowser.Server.Implementations.Sync
|
||||
}
|
||||
}
|
||||
|
||||
if (item is LiveTvChannel || item is IChannelItem)
|
||||
if (item.SourceType != SourceType.Library)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user