mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-03 19:17:24 -05:00 
			
		
		
		
	add dlna channel factory
This commit is contained in:
		
							parent
							
								
									06118307dd
								
							
						
					
					
						commit
						97c5b468a0
					
				@ -535,9 +535,6 @@ namespace MediaBrowser.Api.Images
 | 
				
			|||||||
                throw new ResourceNotFoundException(string.Format("{0} does not have an image of type {1}", item.Name, request.Type));
 | 
					                throw new ResourceNotFoundException(string.Format("{0} does not have an image of type {1}", item.Name, request.Type));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // See if we can avoid a file system lookup by looking for the file in ResolveArgs
 | 
					 | 
				
			||||||
            var originalFileImageDateModified = imageInfo.DateModified;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            var supportedImageEnhancers = request.EnableImageEnhancers ? _imageProcessor.ImageEnhancers.Where(i =>
 | 
					            var supportedImageEnhancers = request.EnableImageEnhancers ? _imageProcessor.ImageEnhancers.Where(i =>
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                try
 | 
					                try
 | 
				
			||||||
 | 
				
			|||||||
@ -15,7 +15,6 @@ namespace MediaBrowser.Controller.Channels
 | 
				
			|||||||
        public ChannelFolderType ChannelFolderType { get; set; }
 | 
					        public ChannelFolderType ChannelFolderType { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string OriginalImageUrl { get; set; }
 | 
					        public string OriginalImageUrl { get; set; }
 | 
				
			||||||
        public List<string> Tags { get; set; }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        protected override bool GetBlockUnratedValue(UserConfiguration config)
 | 
					        protected override bool GetBlockUnratedValue(UserConfiguration config)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@ -31,11 +30,6 @@ namespace MediaBrowser.Controller.Channels
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public ChannelFolderItem()
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            Tags = new List<string>();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        public override string GetUserDataKey()
 | 
					        public override string GetUserDataKey()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return ExternalId;
 | 
					            return ExternalId;
 | 
				
			||||||
 | 
				
			|||||||
@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.Entities.Audio
 | 
				
			|||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Class MusicAlbum
 | 
					    /// Class MusicAlbum
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasTags, IHasLookupInfo<AlbumInfo>
 | 
					    public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<AlbumInfo>
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public List<Guid> SoundtrackIds { get; set; }
 | 
					        public List<Guid> SoundtrackIds { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -19,7 +19,6 @@ namespace MediaBrowser.Controller.Entities.Audio
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            Artists = new List<string>();
 | 
					            Artists = new List<string>();
 | 
				
			||||||
            SoundtrackIds = new List<Guid>();
 | 
					            SoundtrackIds = new List<Guid>();
 | 
				
			||||||
            Tags = new List<string>();
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [IgnoreDataMember]
 | 
					        [IgnoreDataMember]
 | 
				
			||||||
@ -65,12 +64,6 @@ namespace MediaBrowser.Controller.Entities.Audio
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// Gets or sets the tags.
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        /// <value>The tags.</value>
 | 
					 | 
				
			||||||
        public List<string> Tags { get; set; }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Gets the tracks.
 | 
					        /// Gets the tracks.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
 | 
				
			|||||||
@ -13,16 +13,9 @@ namespace MediaBrowser.Controller.Entities.Audio
 | 
				
			|||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Class MusicArtist
 | 
					    /// Class MusicArtist
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    public class MusicArtist : Folder, IMetadataContainer, IItemByName, IHasMusicGenres, IHasDualAccess, IHasTags, IHasProductionLocations, IHasLookupInfo<ArtistInfo>
 | 
					    public class MusicArtist : Folder, IMetadataContainer, IItemByName, IHasMusicGenres, IHasDualAccess, IHasProductionLocations, IHasLookupInfo<ArtistInfo>
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public bool IsAccessedByName { get; set; }
 | 
					        public bool IsAccessedByName { get; set; }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// Gets or sets the tags.
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        /// <value>The tags.</value>
 | 
					 | 
				
			||||||
        public List<string> Tags { get; set; }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        public List<string> ProductionLocations { get; set; }
 | 
					        public List<string> ProductionLocations { get; set; }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        public override bool IsFolder
 | 
					        public override bool IsFolder
 | 
				
			||||||
@ -60,7 +53,6 @@ namespace MediaBrowser.Controller.Entities.Audio
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        public MusicArtist()
 | 
					        public MusicArtist()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Tags = new List<string>();
 | 
					 | 
				
			||||||
            ProductionLocations = new List<string>();
 | 
					            ProductionLocations = new List<string>();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -14,13 +14,12 @@ namespace MediaBrowser.Controller.Entities.Movies
 | 
				
			|||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Class BoxSet
 | 
					    /// Class BoxSet
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    public class BoxSet : Folder, IHasTrailers, IHasTags, IHasKeywords, IHasPreferredMetadataLanguage, IHasDisplayOrder, IHasLookupInfo<BoxSetInfo>, IMetadataContainer
 | 
					    public class BoxSet : Folder, IHasTrailers, IHasKeywords, IHasPreferredMetadataLanguage, IHasDisplayOrder, IHasLookupInfo<BoxSetInfo>, IMetadataContainer
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public BoxSet()
 | 
					        public BoxSet()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            RemoteTrailers = new List<MediaUrl>();
 | 
					            RemoteTrailers = new List<MediaUrl>();
 | 
				
			||||||
            LocalTrailerIds = new List<Guid>();
 | 
					            LocalTrailerIds = new List<Guid>();
 | 
				
			||||||
            Tags = new List<string>();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            DisplayOrder = ItemSortBy.PremiereDate;
 | 
					            DisplayOrder = ItemSortBy.PremiereDate;
 | 
				
			||||||
            Keywords = new List<string>();
 | 
					            Keywords = new List<string>();
 | 
				
			||||||
@ -38,7 +37,6 @@ namespace MediaBrowser.Controller.Entities.Movies
 | 
				
			|||||||
        /// Gets or sets the tags.
 | 
					        /// Gets or sets the tags.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <value>The tags.</value>
 | 
					        /// <value>The tags.</value>
 | 
				
			||||||
        public List<string> Tags { get; set; }
 | 
					 | 
				
			||||||
        public List<string> Keywords { get; set; }
 | 
					        public List<string> Keywords { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string PreferredMetadataLanguage { get; set; }
 | 
					        public string PreferredMetadataLanguage { get; set; }
 | 
				
			||||||
 | 
				
			|||||||
@ -13,7 +13,7 @@ namespace MediaBrowser.Controller.Entities.TV
 | 
				
			|||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Class Series
 | 
					    /// Class Series
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    public class Series : Folder, IHasSoundtracks, IHasTrailers, IHasTags, IHasPreferredMetadataLanguage, IHasDisplayOrder, IHasLookupInfo<SeriesInfo>
 | 
					    public class Series : Folder, IHasSoundtracks, IHasTrailers, IHasPreferredMetadataLanguage, IHasDisplayOrder, IHasLookupInfo<SeriesInfo>
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public List<Guid> SpecialFeatureIds { get; set; }
 | 
					        public List<Guid> SpecialFeatureIds { get; set; }
 | 
				
			||||||
        public List<Guid> SoundtrackIds { get; set; }
 | 
					        public List<Guid> SoundtrackIds { get; set; }
 | 
				
			||||||
@ -36,7 +36,6 @@ namespace MediaBrowser.Controller.Entities.TV
 | 
				
			|||||||
            SoundtrackIds = new List<Guid>();
 | 
					            SoundtrackIds = new List<Guid>();
 | 
				
			||||||
            RemoteTrailers = new List<MediaUrl>();
 | 
					            RemoteTrailers = new List<MediaUrl>();
 | 
				
			||||||
            LocalTrailerIds = new List<Guid>();
 | 
					            LocalTrailerIds = new List<Guid>();
 | 
				
			||||||
            Tags = new List<string>();
 | 
					 | 
				
			||||||
            DisplaySpecialsWithSeasons = true;
 | 
					            DisplaySpecialsWithSeasons = true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -51,12 +50,6 @@ namespace MediaBrowser.Controller.Entities.TV
 | 
				
			|||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public string DisplayOrder { get; set; }
 | 
					        public string DisplayOrder { get; set; }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// Gets or sets the tags.
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        /// <value>The tags.</value>
 | 
					 | 
				
			||||||
        public List<string> Tags { get; set; }
 | 
					 | 
				
			||||||
     
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Gets or sets the status.
 | 
					        /// Gets or sets the status.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										88
									
								
								MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,88 @@
 | 
				
			|||||||
 | 
					using MediaBrowser.Controller.Channels;
 | 
				
			||||||
 | 
					using MediaBrowser.Controller.Providers;
 | 
				
			||||||
 | 
					using MediaBrowser.Model.Entities;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Threading;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace MediaBrowser.Dlna.Channels
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class DlnaChannelFactory : IChannelFactory
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public IEnumerable<IChannel> GetChannels()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // Check config here
 | 
				
			||||||
 | 
					            // If user wants all channels separate, return them all
 | 
				
			||||||
 | 
					            // If user wants one parent channel, return just that one
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return new List<IChannel>()
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                //new DummyChannel("test 1"),
 | 
				
			||||||
 | 
					                //new DummyChannel("test 2")
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public class DummyChannel : IChannel
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        private readonly string _name;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public DummyChannel(string name)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            _name = name;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public string Name
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return _name; }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public string Description
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return "Dummy Channel"; }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public string DataVersion
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return "1"; }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public string HomePageUrl
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return "http://www.google.com"; }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public ChannelParentalRating ParentalRating
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return ChannelParentalRating.GeneralAudience; }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public InternalChannelFeatures GetChannelFeatures()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return new InternalChannelFeatures
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool IsEnabledFor(string userId)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public Task<ChannelItemResult> GetChannelItems(InternalChannelItemQuery query, CancellationToken cancellationToken)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return Task.FromResult(new ChannelItemResult());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public Task<DynamicImageResponse> GetChannelImage(ImageType type, CancellationToken cancellationToken)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return Task.FromResult(new DynamicImageResponse());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public IEnumerable<ImageType> GetSupportedChannelImages()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return new List<ImageType>();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -51,6 +51,7 @@
 | 
				
			|||||||
    <Compile Include="..\SharedVersion.cs">
 | 
					    <Compile Include="..\SharedVersion.cs">
 | 
				
			||||||
      <Link>Properties\SharedVersion.cs</Link>
 | 
					      <Link>Properties\SharedVersion.cs</Link>
 | 
				
			||||||
    </Compile>
 | 
					    </Compile>
 | 
				
			||||||
 | 
					    <Compile Include="Channels\DlnaChannelFactory.cs" />
 | 
				
			||||||
    <Compile Include="ConfigurationExtension.cs" />
 | 
					    <Compile Include="ConfigurationExtension.cs" />
 | 
				
			||||||
    <Compile Include="ConnectionManager\ConnectionManager.cs" />
 | 
					    <Compile Include="ConnectionManager\ConnectionManager.cs" />
 | 
				
			||||||
    <Compile Include="ConnectionManager\ConnectionManagerXmlBuilder.cs" />
 | 
					    <Compile Include="ConnectionManager\ConnectionManagerXmlBuilder.cs" />
 | 
				
			||||||
 | 
				
			|||||||
@ -542,7 +542,7 @@ namespace MediaBrowser.Server.Implementations.Channels
 | 
				
			|||||||
                throw new ArgumentException("User not found.");
 | 
					                throw new ArgumentException("User not found.");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var channels = _channels;
 | 
					            var channels = GetAllChannels();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (query.ChannelIds.Length > 0)
 | 
					            if (query.ChannelIds.Length > 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@ -696,7 +696,7 @@ namespace MediaBrowser.Server.Implementations.Channels
 | 
				
			|||||||
                ? null
 | 
					                ? null
 | 
				
			||||||
                : _userManager.GetUserById(new Guid(query.UserId));
 | 
					                : _userManager.GetUserById(new Guid(query.UserId));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var channels = _channels;
 | 
					            var channels = GetAllChannels();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (query.ChannelIds.Length > 0)
 | 
					            if (query.ChannelIds.Length > 0)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
				
			|||||||
@ -94,7 +94,8 @@ namespace MediaBrowser.Server.Implementations.Notifications
 | 
				
			|||||||
            {
 | 
					            {
 | 
				
			||||||
                var config = GetConfiguration();
 | 
					                var config = GetConfiguration();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return _userManager.Users.Where(i => config.IsEnabledToSendToUser(request.NotificationType, i.Id.ToString("N"), i.Configuration))
 | 
					                return _userManager.Users
 | 
				
			||||||
 | 
					                    .Where(i => config.IsEnabledToSendToUser(request.NotificationType, i.Id.ToString("N"), i.Configuration))
 | 
				
			||||||
                    .Select(i => i.Id.ToString("N"));
 | 
					                    .Select(i => i.Id.ToString("N"));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user