mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 13:57:14 -04:00
add new web client sidebar
This commit is contained in:
parent
ac2c1563d5
commit
f031bb744b
@ -61,6 +61,11 @@ namespace MediaBrowser.Controller.Channels
|
|||||||
IEnumerable<ImageType> GetSupportedChannelImages();
|
IEnumerable<ImageType> GetSupportedChannelImages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface IChannelFactory
|
||||||
|
{
|
||||||
|
IEnumerable<IChannel> GetChannels();
|
||||||
|
}
|
||||||
|
|
||||||
public class ChannelInfo
|
public class ChannelInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -13,7 +13,8 @@ namespace MediaBrowser.Controller.Channels
|
|||||||
/// Adds the parts.
|
/// Adds the parts.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="channels">The channels.</param>
|
/// <param name="channels">The channels.</param>
|
||||||
void AddParts(IEnumerable<IChannel> channels);
|
/// <param name="factories">The factories.</param>
|
||||||
|
void AddParts(IEnumerable<IChannel> channels, IEnumerable<IChannelFactory> factories);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the channels.
|
/// Gets the channels.
|
||||||
|
@ -414,11 +414,11 @@ namespace MediaBrowser.Dlna.Didl
|
|||||||
{
|
{
|
||||||
classType = "object.container.album.musicAlbum";
|
classType = "object.container.album.musicAlbum";
|
||||||
}
|
}
|
||||||
if (item is MusicArtist)
|
else if (item is MusicArtist)
|
||||||
{
|
{
|
||||||
classType = "object.container.person.musicArtist";
|
classType = "object.container.person.musicArtist";
|
||||||
}
|
}
|
||||||
if (item is Series || item is Season || item is BoxSet || item is CollectionFolder)
|
else if (item is Series || item is Season || item is BoxSet)
|
||||||
{
|
{
|
||||||
classType = "object.container.album.videoAlbum";
|
classType = "object.container.album.videoAlbum";
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,12 @@ namespace MediaBrowser.Model.Querying
|
|||||||
/// <value>The user id.</value>
|
/// <value>The user id.</value>
|
||||||
public string UserId { get; set; }
|
public string UserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the parent identifier.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The parent identifier.</value>
|
||||||
|
public string ParentId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the series id.
|
/// Gets or sets the series id.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -42,6 +48,12 @@ namespace MediaBrowser.Model.Querying
|
|||||||
/// <value>The user id.</value>
|
/// <value>The user id.</value>
|
||||||
public string UserId { get; set; }
|
public string UserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the parent identifier.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The parent identifier.</value>
|
||||||
|
public string ParentId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Skips over a given number of items within the results. Use for paging.
|
/// Skips over a given number of items within the results. Use for paging.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -23,6 +23,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
|||||||
public class ChannelManager : IChannelManager
|
public class ChannelManager : IChannelManager
|
||||||
{
|
{
|
||||||
private IChannel[] _channels;
|
private IChannel[] _channels;
|
||||||
|
private IChannelFactory[] _factories;
|
||||||
private List<Channel> _channelEntities = new List<Channel>();
|
private List<Channel> _channelEntities = new List<Channel>();
|
||||||
|
|
||||||
private readonly IUserManager _userManager;
|
private readonly IUserManager _userManager;
|
||||||
@ -44,9 +45,29 @@ namespace MediaBrowser.Server.Implementations.Channels
|
|||||||
_userDataManager = userDataManager;
|
_userDataManager = userDataManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddParts(IEnumerable<IChannel> channels)
|
public void AddParts(IEnumerable<IChannel> channels, IEnumerable<IChannelFactory> factories)
|
||||||
{
|
{
|
||||||
_channels = channels.ToArray();
|
_channels = channels.ToArray();
|
||||||
|
_factories = factories.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerable<IChannel> GetAllChannels()
|
||||||
|
{
|
||||||
|
return _factories
|
||||||
|
.SelectMany(i =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return i.GetChannels().ToList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.ErrorException("Error getting channel list", ex);
|
||||||
|
return new List<IChannel>();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.Concat(_channels)
|
||||||
|
.OrderBy(i => i.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<QueryResult<BaseItemDto>> GetChannels(ChannelQuery query, CancellationToken cancellationToken)
|
public Task<QueryResult<BaseItemDto>> GetChannels(ChannelQuery query, CancellationToken cancellationToken)
|
||||||
@ -82,7 +103,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
|||||||
|
|
||||||
public async Task RefreshChannels(IProgress<double> progress, CancellationToken cancellationToken)
|
public async Task RefreshChannels(IProgress<double> progress, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var allChannelsList = _channels.ToList();
|
var allChannelsList = GetAllChannels().ToList();
|
||||||
|
|
||||||
var list = new List<Channel>();
|
var list = new List<Channel>();
|
||||||
|
|
||||||
@ -380,7 +401,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
|||||||
|
|
||||||
internal IChannel GetChannelProvider(Channel channel)
|
internal IChannel GetChannelProvider(Channel channel)
|
||||||
{
|
{
|
||||||
return _channels.First(i => string.Equals(i.Name, channel.OriginalChannelName, StringComparison.OrdinalIgnoreCase));
|
return GetAllChannels().First(i => string.Equals(i.Name, channel.OriginalChannelName, StringComparison.OrdinalIgnoreCase));
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<BaseItem> ApplyFilters(IEnumerable<BaseItem> items, IEnumerable<ItemFilter> filters, User user)
|
private IEnumerable<BaseItem> ApplyFilters(IEnumerable<BaseItem> items, IEnumerable<ItemFilter> filters, User user)
|
||||||
|
@ -164,7 +164,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
|||||||
|
|
||||||
var item = e.MediaInfo;
|
var item = e.MediaInfo;
|
||||||
|
|
||||||
if (e.Item !=null && e.Item.Parent == null)
|
if (e.Item != null && e.Item.Parent == null)
|
||||||
{
|
{
|
||||||
// Don't report theme song or local trailer playback
|
// Don't report theme song or local trailer playback
|
||||||
// TODO: This will also cause movie specials to not be reported
|
// TODO: This will also cause movie specials to not be reported
|
||||||
|
@ -624,5 +624,8 @@
|
|||||||
"ButtonMute": "Mute",
|
"ButtonMute": "Mute",
|
||||||
"HeaderLatestMedia": "Latest Media",
|
"HeaderLatestMedia": "Latest Media",
|
||||||
"OptionNoSubtitles": "No Subtitles",
|
"OptionNoSubtitles": "No Subtitles",
|
||||||
"OptionSpecialFeatures": "Special Features"
|
"OptionSpecialFeatures": "Special Features",
|
||||||
|
"HeaderCollections": "Collections",
|
||||||
|
"HeaderChannels": "Channels",
|
||||||
|
"HeaderMyLibrary": "My Library"
|
||||||
}
|
}
|
@ -712,7 +712,7 @@ namespace MediaBrowser.ServerApplication
|
|||||||
|
|
||||||
SessionManager.AddParts(GetExports<ISessionControllerFactory>());
|
SessionManager.AddParts(GetExports<ISessionControllerFactory>());
|
||||||
|
|
||||||
ChannelManager.AddParts(GetExports<IChannel>());
|
ChannelManager.AddParts(GetExports<IChannel>(), GetExports<IChannelFactory>());
|
||||||
|
|
||||||
NotificationManager.AddParts(GetExports<INotificationService>(), GetExports<INotificationTypeFactory>());
|
NotificationManager.AddParts(GetExports<INotificationService>(), GetExports<INotificationTypeFactory>());
|
||||||
}
|
}
|
||||||
|
@ -211,6 +211,30 @@
|
|||||||
<Content Include="dashboard-ui\css\images\items\detail\tv.png">
|
<Content Include="dashboard-ui\css\images\items\detail\tv.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\css\images\items\folders\books.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\css\images\items\folders\channels.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\css\images\items\folders\games.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\css\images\items\folders\homevideos.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\css\images\items\folders\movies.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\css\images\items\folders\music.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\css\images\items\folders\photos.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\css\images\items\folders\tv.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\css\images\items\list\remotesearch.png">
|
<Content Include="dashboard-ui\css\images\items\list\remotesearch.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
Loading…
Reference in New Issue
Block a user