mirror of
https://github.com/sbondCo/Watcharr.git
synced 2026-08-07 07:14:44 +00:00
wip: arr progress - response requests management, auto approve perm ui
This commit is contained in:
@@ -161,6 +161,7 @@ func createSonarrRequest(db *gorm.DB, userId uint, userPerms int, ur arr.SonarrR
|
||||
return &ArrRequest{}, errors.New("failed to get arr id")
|
||||
}
|
||||
arrReq.ArrID = int(arrId)
|
||||
arrReq.Status = ARR_REQUEST_AUTO_APPROVED
|
||||
}
|
||||
return arrReq, nil
|
||||
}
|
||||
@@ -221,6 +222,7 @@ func createRadarrRequest(db *gorm.DB, userId uint, userPerms int, ur arr.RadarrR
|
||||
return &ArrRequest{}, errors.New("failed to get arr id")
|
||||
}
|
||||
arrReq.ArrID = int(arrId)
|
||||
arrReq.Status = ARR_REQUEST_AUTO_APPROVED
|
||||
}
|
||||
return arrReq, nil
|
||||
}
|
||||
|
||||
@@ -68,10 +68,15 @@
|
||||
{#each allRequests as r}
|
||||
<div class={`request ${r.content.type}`}>
|
||||
<div class="poster">
|
||||
<img src={`${baseURL}/img${r.content?.poster_path}`} alt="" />
|
||||
<img src={`${baseURL}/img${r.content?.poster_path}`} alt="" loading="lazy" />
|
||||
<span title={r.serverName}>{r.serverName}</span>
|
||||
</div>
|
||||
<img class="backdrop" src={`${baseURL}/img${r.content?.poster_path}`} alt="" />
|
||||
<img
|
||||
class="backdrop"
|
||||
src={`${baseURL}/img${r.content?.poster_path}`}
|
||||
alt=""
|
||||
loading="lazy"
|
||||
/>
|
||||
<div class="wordsnstuff">
|
||||
<h2 class="norm">
|
||||
<span>{r.content.title}</span>
|
||||
@@ -137,12 +142,12 @@
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.request {
|
||||
.content .request {
|
||||
display: flex;
|
||||
flex-flow: row;
|
||||
position: relative;
|
||||
gap: 10px;
|
||||
max-height: 333px;
|
||||
max-height: 245px;
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
background-color: $img-blend-multiply-bg-col;
|
||||
@@ -164,6 +169,11 @@
|
||||
filter: blur(4px) grayscale(80%);
|
||||
mix-blend-mode: multiply;
|
||||
z-index: -2;
|
||||
|
||||
@media screen and (max-width: 400px) {
|
||||
transform: unset;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,6 +204,7 @@
|
||||
& > div {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
gap: 5px;
|
||||
|
||||
&.wordsnstuff {
|
||||
overflow: hidden;
|
||||
@@ -202,12 +213,18 @@
|
||||
|
||||
& > h2 {
|
||||
font-size: 22px;
|
||||
white-space: wrap;
|
||||
overflow: visible;
|
||||
|
||||
& span:last-of-type {
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
& > p {
|
||||
@@ -241,6 +258,26 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 400px) {
|
||||
flex-flow: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
|
||||
& button:first-of-type {
|
||||
margin-left: unset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
flex-flow: column;
|
||||
max-height: unset;
|
||||
align-items: center;
|
||||
|
||||
.wordsnstuff p {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,7 +295,6 @@
|
||||
|
||||
h2 {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,6 +85,19 @@
|
||||
/>
|
||||
</Setting>
|
||||
|
||||
<Setting title="Auto Approve Content Request" desc="Auto approve user's content requests." row>
|
||||
<Checkbox
|
||||
name="PERM_REQUEST_CONTENT_AUTO_APPROVE"
|
||||
value={userHasPermission(
|
||||
user.permissions,
|
||||
UserPermission.PERM_REQUEST_CONTENT_AUTO_APPROVE
|
||||
)}
|
||||
toggled={() => {
|
||||
userTogglePermission(UserPermission.PERM_REQUEST_CONTENT_AUTO_APPROVE);
|
||||
}}
|
||||
/>
|
||||
</Setting>
|
||||
|
||||
<div class="btns">
|
||||
<button on:click={() => save()}>Save</button>
|
||||
</div>
|
||||
|
||||
+2
-1
@@ -179,7 +179,8 @@ export interface PrivateUser {
|
||||
export enum UserPermission {
|
||||
PERM_NONE = 1,
|
||||
PERM_ADMIN = 2,
|
||||
PERM_REQUEST_CONTENT = 4
|
||||
PERM_REQUEST_CONTENT = 4,
|
||||
PERM_REQUEST_CONTENT_AUTO_APPROVE = 8
|
||||
}
|
||||
|
||||
export interface Image {
|
||||
|
||||
Reference in New Issue
Block a user