add dlna channel factory

pull/702/head
Luke Pulverenti 11 years ago
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));
}
// 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 =>
{
try

@ -15,7 +15,6 @@ namespace MediaBrowser.Controller.Channels
public ChannelFolderType ChannelFolderType { get; set; }
public string OriginalImageUrl { get; set; }
public List<string> Tags { get; set; }
protected override bool GetBlockUnratedValue(UserConfiguration config)
{
@ -31,11 +30,6 @@ namespace MediaBrowser.Controller.Channels
}
}
public ChannelFolderItem()
{
Tags = new List<string>();
}
public override string GetUserDataKey()
{
return ExternalId;

@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.Entities.Audio
/// <summary>
/// Class MusicAlbum
/// </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; }
@ -19,7 +19,6 @@ namespace MediaBrowser.Controller.Entities.Audio
{
Artists = new List<string>();
SoundtrackIds = new List<Guid>();
Tags = new List<string>();
}
[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>
/// Gets the tracks.
/// </summary>

@ -13,16 +13,9 @@ namespace MediaBrowser.Controller.Entities.Audio
/// <summary>
/// Class MusicArtist
/// </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; }
/// <summary>
/// Gets or sets the tags.
/// </summary>
/// <value>The tags.</value>
public List<string> Tags { get; set; }
public List<string> ProductionLocations { get; set; }
public override bool IsFolder
@ -60,7 +53,6 @@ namespace MediaBrowser.Controller.Entities.Audio
public MusicArtist()
{
Tags = new List<string>();
ProductionLocations = new List<string>();
}

@ -14,13 +14,12 @@ namespace MediaBrowser.Controller.Entities.Movies
/// <summary>
/// Class BoxSet
/// </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()
{
RemoteTrailers = new List<MediaUrl>();
LocalTrailerIds = new List<Guid>();
Tags = new List<string>();
DisplayOrder = ItemSortBy.PremiereDate;
Keywords = new List<string>();
@ -38,7 +37,6 @@ namespace MediaBrowser.Controller.Entities.Movies
/// Gets or sets the tags.
/// </summary>
/// <value>The tags.</value>
public List<string> Tags { get; set; }
public List<string> Keywords { get; set; }
public string PreferredMetadataLanguage { get; set; }

@ -13,7 +13,7 @@ namespace MediaBrowser.Controller.Entities.TV
/// <summary>
/// Class Series
/// </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> SoundtrackIds { get; set; }
@ -36,7 +36,6 @@ namespace MediaBrowser.Controller.Entities.TV
SoundtrackIds = new List<Guid>();
RemoteTrailers = new List<MediaUrl>();
LocalTrailerIds = new List<Guid>();
Tags = new List<string>();
DisplaySpecialsWithSeasons = true;
}
@ -51,12 +50,6 @@ namespace MediaBrowser.Controller.Entities.TV
/// </summary>
public string DisplayOrder { get; set; }
/// <summary>
/// Gets or sets the tags.
/// </summary>
/// <value>The tags.</value>
public List<string> Tags { get; set; }
/// <summary>
/// Gets or sets the status.
/// </summary>

@ -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">
<Link>Properties\SharedVersion.cs</Link>
</Compile>
<Compile Include="Channels\DlnaChannelFactory.cs" />
<Compile Include="ConfigurationExtension.cs" />
<Compile Include="ConnectionManager\ConnectionManager.cs" />
<Compile Include="ConnectionManager\ConnectionManagerXmlBuilder.cs" />

@ -542,7 +542,7 @@ namespace MediaBrowser.Server.Implementations.Channels
throw new ArgumentException("User not found.");
}
var channels = _channels;
var channels = GetAllChannels();
if (query.ChannelIds.Length > 0)
{
@ -696,7 +696,7 @@ namespace MediaBrowser.Server.Implementations.Channels
? null
: _userManager.GetUserById(new Guid(query.UserId));
var channels = _channels;
var channels = GetAllChannels();
if (query.ChannelIds.Length > 0)
{

@ -94,8 +94,9 @@ namespace MediaBrowser.Server.Implementations.Notifications
{
var config = GetConfiguration();
return _userManager.Users.Where(i => config.IsEnabledToSendToUser(request.NotificationType, i.Id.ToString("N"), i.Configuration))
.Select(i => i.Id.ToString("N"));
return _userManager.Users
.Where(i => config.IsEnabledToSendToUser(request.NotificationType, i.Id.ToString("N"), i.Configuration))
.Select(i => i.Id.ToString("N"));
}
return request.UserIds;

Loading…
Cancel
Save