connect updates

This commit is contained in:
Luke Pulverenti
2014-10-28 19:17:55 -04:00
parent 67528a0799
commit 5ca4d60c34
30 changed files with 194 additions and 92 deletions

View File

@@ -5,19 +5,8 @@ using System.Collections.Generic;
namespace MediaBrowser.Controller.Entities
{
[Obsolete]
public class AdultVideo : Video, IHasProductionLocations, IHasPreferredMetadataLanguage, IHasTaglines
public class AdultVideo : Video, IHasProductionLocations, IHasTaglines
{
/// <summary>
/// Gets or sets the preferred metadata language.
/// </summary>
/// <value>The preferred metadata language.</value>
public string PreferredMetadataLanguage { get; set; }
/// <summary>
/// Gets or sets the preferred metadata country code.
/// </summary>
/// <value>The preferred metadata country code.</value>
public string PreferredMetadataCountryCode { get; set; }
public List<string> ProductionLocations { get; set; }
public List<string> Taglines { get; set; }

View File

@@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Entities.Movies
/// <summary>
/// Class Movie
/// </summary>
public class Movie : Video, IHasCriticRating, IHasSoundtracks, IHasSpecialFeatures, IHasProductionLocations, IHasBudget, IHasKeywords, IHasTrailers, IHasThemeMedia, IHasTaglines, IHasPreferredMetadataLanguage, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping
public class Movie : Video, IHasCriticRating, IHasSoundtracks, IHasSpecialFeatures, IHasProductionLocations, IHasBudget, IHasKeywords, IHasTrailers, IHasThemeMedia, IHasTaglines, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping
{
public List<Guid> SpecialFeatureIds { get; set; }
@@ -30,14 +30,6 @@ namespace MediaBrowser.Controller.Entities.Movies
[IgnoreDataMember]
public List<Guid> BoxSetIdList { get; set; }
/// <summary>
/// Gets or sets the preferred metadata country code.
/// </summary>
/// <value>The preferred metadata country code.</value>
public string PreferredMetadataCountryCode { get; set; }
public string PreferredMetadataLanguage { get; set; }
public Movie()
{
SpecialFeatureIds = new List<Guid>();

View File

@@ -12,19 +12,12 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// Class Trailer
/// </summary>
public class Trailer : Video, IHasCriticRating, IHasSoundtracks, IHasProductionLocations, IHasBudget, IHasTrailers, IHasKeywords, IHasTaglines, IHasPreferredMetadataLanguage, IHasMetascore, IHasLookupInfo<TrailerInfo>
public class Trailer : Video, IHasCriticRating, IHasSoundtracks, IHasProductionLocations, IHasBudget, IHasTrailers, IHasKeywords, IHasTaglines, IHasMetascore, IHasLookupInfo<TrailerInfo>
{
public List<Guid> SoundtrackIds { get; set; }
public string PreferredMetadataLanguage { get; set; }
public List<string> ProductionLocations { get; set; }
/// <summary>
/// Gets or sets the preferred metadata country code.
/// </summary>
/// <value>The preferred metadata country code.</value>
public string PreferredMetadataCountryCode { get; set; }
public Trailer()
{
RemoteTrailers = new List<MediaUrl>();

View File

@@ -25,6 +25,7 @@ namespace MediaBrowser.Controller.Entities
ISupportsPlaceHolders,
IHasMediaSources,
IHasShortOverview,
IHasPreferredMetadataLanguage,
IThemeMedia
{
public bool IsMultiPart { get; set; }
@@ -43,6 +44,13 @@ namespace MediaBrowser.Controller.Entities
public string ShortOverview { get; set; }
public ExtraType ExtraType { get; set; }
/// <summary>
/// Gets or sets the preferred metadata country code.
/// </summary>
/// <value>The preferred metadata country code.</value>
public string PreferredMetadataCountryCode { get; set; }
public string PreferredMetadataLanguage { get; set; }
/// <summary>
/// Gets or sets the timestamp.
/// </summary>

View File

@@ -50,6 +50,11 @@ namespace MediaBrowser.Controller.LiveTv
}
}
public override bool IsSaveLocalMetadataEnabled()
{
return true;
}
/// <summary>
/// Gets or sets the number.
/// </summary>

View File

@@ -1,10 +1,11 @@
using ServiceStack.Web;
using System;
using System.Collections.Generic;
using System.Linq;
namespace MediaBrowser.Controller.Net
{
public class AuthenticatedAttribute : Attribute, IHasRequestFilter
public class AuthenticatedAttribute : Attribute, IHasRequestFilter, IAuthenticated
{
public IAuthService AuthService { get; set; }
@@ -14,8 +15,18 @@ namespace MediaBrowser.Controller.Net
/// <value><c>true</c> if [allow local]; otherwise, <c>false</c>.</value>
public bool AllowLocal { get; set; }
/// <summary>
/// Gets or sets the roles.
/// </summary>
/// <value>The roles.</value>
public string Roles { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [escape parental control].
/// </summary>
/// <value><c>true</c> if [escape parental control]; otherwise, <c>false</c>.</value>
public bool EscapeParentalControl { get; set; }
/// <summary>
/// The request filter is executed before the service.
/// </summary>
@@ -24,11 +35,7 @@ namespace MediaBrowser.Controller.Net
/// <param name="requestDto">The request DTO</param>
public void RequestFilter(IRequest request, IResponse response, object requestDto)
{
var roles = (Roles ?? string.Empty).Split(',')
.Where(i => !string.IsNullOrWhiteSpace(i))
.ToArray();
AuthService.Authenticate(request, response, requestDto, AllowLocal, roles);
AuthService.Authenticate(request, response, requestDto, this);
}
/// <summary>
@@ -50,5 +57,20 @@ namespace MediaBrowser.Controller.Net
{
get { return 0; }
}
public IEnumerable<string> GetRoles()
{
return (Roles ?? string.Empty).Split(',')
.Where(i => !string.IsNullOrWhiteSpace(i));
}
}
public interface IAuthenticated
{
bool EscapeParentalControl { get; }
bool AllowLocal { get; }
IEnumerable<string> GetRoles();
}
}

View File

@@ -1,5 +1,4 @@
using ServiceStack.Web;
using System.Collections.Generic;
namespace MediaBrowser.Controller.Net
{
@@ -8,7 +7,6 @@ namespace MediaBrowser.Controller.Net
void Authenticate(IRequest request,
IResponse response,
object requestDto,
bool allowLocal,
string[] roles);
IAuthenticated authAttribtues);
}
}

View File

@@ -33,6 +33,11 @@ namespace MediaBrowser.Controller.Playlists
}
}
public override bool IsSaveLocalMetadataEnabled()
{
return true;
}
public override IEnumerable<BaseItem> GetChildren(User user, bool includeLinkedChildren)
{
return GetPlayableItems(user);