mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
only show requested by users to admins + start maintaining a list of users with each request
This commit is contained in:
parent
5a5512a1cd
commit
b8a01b62b9
8 changed files with 54 additions and 20 deletions
|
@ -2,6 +2,8 @@
|
|||
using System.Security.Cryptography;
|
||||
|
||||
using Dapper.Contrib.Extensions;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace PlexRequests.Store
|
||||
{
|
||||
|
@ -18,7 +20,10 @@ namespace PlexRequests.Store
|
|||
public RequestType Type { get; set; }
|
||||
public string Status { get; set; }
|
||||
public bool Approved { get; set; }
|
||||
|
||||
[Obsolete("Use RequestedUsers")]
|
||||
public string RequestedBy { get; set; }
|
||||
|
||||
public DateTime RequestedDate { get; set; }
|
||||
public bool Available { get; set; }
|
||||
public IssueState Issues { get; set; }
|
||||
|
@ -27,6 +32,17 @@ namespace PlexRequests.Store
|
|||
public int[] SeasonList { get; set; }
|
||||
public int SeasonCount { get; set; }
|
||||
public string SeasonsRequested { get; set; }
|
||||
public List<string> RequestedUsers { get; set; }
|
||||
|
||||
public bool UserHasRequested(string username)
|
||||
{
|
||||
bool alreadyRequested = !string.IsNullOrEmpty(RequestedBy) && RequestedBy.Equals(username, StringComparison.OrdinalIgnoreCase);
|
||||
if (!alreadyRequested && RequestedUsers != null && RequestedUsers.Count > 0)
|
||||
{
|
||||
alreadyRequested = RequestedUsers.Any(x => x.Equals(username, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
return alreadyRequested;
|
||||
}
|
||||
}
|
||||
|
||||
public enum RequestType
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue