Polish 5 (#3579)
This commit is contained in:
parent
78a98d0d18
commit
5af851af08
9 changed files with 264 additions and 117 deletions
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using API.Entities.Enums;
|
||||
using API.Entities.Interfaces;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
@ -101,4 +102,24 @@ public class SeriesMetadata : IHasConcurrencyToken
|
|||
{
|
||||
RowVersion++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Any People in this Role present
|
||||
/// </summary>
|
||||
/// <param name="role"></param>
|
||||
/// <returns></returns>
|
||||
public bool AnyOfRole(PersonRole role)
|
||||
{
|
||||
return People.Any(p => p.Role == role);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Are all instances of the role from Kavita+
|
||||
/// </summary>
|
||||
/// <param name="role"></param>
|
||||
/// <returns></returns>
|
||||
public bool AllKavitaPlus(PersonRole role)
|
||||
{
|
||||
return People.Where(p => p.Role == role).All(p => p.KavitaPlusConnection);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue