Skip to content

Commit

Permalink
feat: watched channel max video age
Browse files Browse the repository at this point in the history
  • Loading branch information
Zibbp committed Mar 31, 2024
1 parent 26cfd76 commit c210a20
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/components/Admin/Watched/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Group,
Loader,
MultiSelect,
NumberInput,
Select,
Switch,
Text,
Expand Down Expand Up @@ -31,6 +32,7 @@ const AdminWatchedDrawer = ({ handleClose, watched, mode }) => {
const [lastLive, setLastLive] = useState(watched?.last_live);
const [channelId, setChannelId] = useState([]);
const [downloadSubOnly, setDownloadSubOnly] = useState(false);
const [maxVideoAge, setMaxVideoAge] = useState<string | number>(0)

const [channelData, setChannelData] = useState([]);
const [loading, setLoading] = useState(false);
Expand Down Expand Up @@ -63,6 +65,7 @@ const AdminWatchedDrawer = ({ handleClose, watched, mode }) => {
setChannelId([...channelId, watched?.edges.channel.id]);
setRenderChat(watched?.render_chat);
setDownloadSubOnly(watched?.download_sub_only);
setMaxVideoAge(watched?.video_age);

if (watched?.edges?.categories) {
const tmpArr = [];
Expand Down Expand Up @@ -96,6 +99,7 @@ const AdminWatchedDrawer = ({ handleClose, watched, mode }) => {
render_chat: renderChat,
download_sub_only: downloadSubOnly,
categories: selectedTwitchCategories,
max_age: maxVideoAge,
},
withCredentials: true,
},
Expand Down Expand Up @@ -135,6 +139,7 @@ const AdminWatchedDrawer = ({ handleClose, watched, mode }) => {
render_chat: renderChat,
download_sub_only: downloadSubOnly,
categories: selectedTwitchCategories,
max_age: maxVideoAge,
},
withCredentials: true,
},
Expand All @@ -157,6 +162,7 @@ const AdminWatchedDrawer = ({ handleClose, watched, mode }) => {
render_chat: renderChat,
download_sub_only: downloadSubOnly,
categories: selectedTwitchCategories,
max_age: maxVideoAge,
},
withCredentials: true,
},
Expand Down Expand Up @@ -358,6 +364,15 @@ const AdminWatchedDrawer = ({ handleClose, watched, mode }) => {
<div>
<Title order={3}>Advanced</Title>
</div>
<div>
<NumberInput
label="Max Video Age (days)"
description="Archive videos that are not older than this number of days (0 to archive all)"
placeholder="Enter a number"
value={maxVideoAge}
onChange={setMaxVideoAge}
/>
</div>
<div>
{twitchCategoriesLoading || formattedTwitchCategories.length == 0 ? (
<Loader color="violet" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/Queue/Header.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
height: auto;
padding-bottom: 10px;
padding-top: 10px;
background-color: var(--mantine-color-dark-6);
background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-6));
}
.queueHeaderContents {
display: flex;
Expand Down

0 comments on commit c210a20

Please sign in to comment.