mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Finding the issue in the validator of the local repository's edit
This commit is contained in:
parent
3a2294ed2d
commit
4a15fa8363
1
Kyoo.Common/.gitignore
vendored
1
Kyoo.Common/.gitignore
vendored
@ -136,7 +136,6 @@ publish/
|
|||||||
# Publish Web Output
|
# Publish Web Output
|
||||||
*.[Pp]ublish.xml
|
*.[Pp]ublish.xml
|
||||||
*.azurePubxml
|
*.azurePubxml
|
||||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
|
||||||
# but database connection strings (with potential passwords) will be unencrypted
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
*.pubxml
|
*.pubxml
|
||||||
*.publishproj
|
*.publishproj
|
||||||
|
@ -191,6 +191,8 @@ namespace Kyoo
|
|||||||
throw new ArgumentNullException(nameof(obj));
|
throw new ArgumentNullException(nameof(obj));
|
||||||
if (genericType == null)
|
if (genericType == null)
|
||||||
throw new ArgumentNullException(nameof(genericType));
|
throw new ArgumentNullException(nameof(genericType));
|
||||||
|
if (!genericType.IsGenericType)
|
||||||
|
throw new ArgumentException($"{nameof(genericType)} is not a generic type.");
|
||||||
|
|
||||||
IEnumerable<Type> types = genericType.IsInterface
|
IEnumerable<Type> types = genericType.IsInterface
|
||||||
? obj.GetType().GetInterfaces()
|
? obj.GetType().GetInterfaces()
|
||||||
|
@ -231,8 +231,10 @@ namespace Kyoo.Controllers
|
|||||||
|
|
||||||
foreach (PropertyInfo property in typeof(T).GetProperties()
|
foreach (PropertyInfo property in typeof(T).GetProperties()
|
||||||
.Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType)
|
.Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType)
|
||||||
&& !typeof(string).IsAssignableFrom(x.PropertyType)))
|
&& !typeof(string).IsAssignableFrom(x.PropertyType))
|
||||||
{
|
{
|
||||||
|
// TODO For DE classes (like ShowDE), the basic ienumerable should not be verified (for exemple, GenreLinks should be checked & not Genres).
|
||||||
|
Console.WriteLine($"Validating {property.Name}");
|
||||||
object value = property.GetValue(resource);
|
object value = property.GetValue(resource);
|
||||||
if (value == null || value is ICollection || Utility.IsOfGenericType(value, typeof(ICollection<>)))
|
if (value == null || value is ICollection || Utility.IsOfGenericType(value, typeof(ICollection<>)))
|
||||||
continue;
|
continue;
|
||||||
|
1
Kyoo/.gitignore
vendored
1
Kyoo/.gitignore
vendored
@ -138,7 +138,6 @@ publish/
|
|||||||
# Publish Web Output
|
# Publish Web Output
|
||||||
*.[Pp]ublish.xml
|
*.[Pp]ublish.xml
|
||||||
*.azurePubxml
|
*.azurePubxml
|
||||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
|
||||||
# but database connection strings (with potential passwords) will be unencrypted
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
*.pubxml
|
*.pubxml
|
||||||
*.publishproj
|
*.publishproj
|
||||||
|
@ -112,7 +112,7 @@ namespace Kyoo
|
|||||||
|
|
||||||
services.AddAuthorization(options =>
|
services.AddAuthorization(options =>
|
||||||
{
|
{
|
||||||
AuthorizationPolicyBuilder scheme = new AuthorizationPolicyBuilder(IdentityConstants.ApplicationScheme, JwtBearerDefaults.AuthenticationScheme);
|
AuthorizationPolicyBuilder scheme = new(IdentityConstants.ApplicationScheme, JwtBearerDefaults.AuthenticationScheme);
|
||||||
options.DefaultPolicy = scheme.RequireAuthenticatedUser().Build();
|
options.DefaultPolicy = scheme.RequireAuthenticatedUser().Build();
|
||||||
|
|
||||||
string[] permissions = {"Read", "Write", "Play", "Admin"};
|
string[] permissions = {"Read", "Write", "Play", "Admin"};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user