Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: automate generate sprite thumbnails #583

Merged
merged 5 commits into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func main() {
VideoPostProcessWorkers: envConfig.MaxVideoConvertExecutions,
ChatDownloadWorkers: envConfig.MaxChatDownloadExecutions,
ChatRenderWorkers: envConfig.MaxChatRenderExecutions,
SpriteThumbnailWorkers: envConfig.MaxVideoSpriteThumbnailExecutions,
})
if err != nil {
log.Panic().Err(err).Msg("Error creating river worker")
Expand Down
7 changes: 6 additions & 1 deletion frontend/app/admin/blocked-videos/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ const AdminBlockedVideosPage = () => {
openDeleteModal()
};

const handleMultiDeleteModalCallback = () => {
closeMultiDeleteModal()
setActiveBlockedVideos([])
}

if (isPending) return (
<GanymedeLoadingText message="Loading Blocked Videos" />
)
Expand Down Expand Up @@ -189,7 +194,7 @@ const AdminBlockedVideosPage = () => {

<Modal opened={multiDeleteModalOpened} onClose={closeMultiDeleteModal} title="Delete Queue Items">
{activeBlockedVideos && (
<MultiDeleteBlockedVideoModalContent blockedVideos={activeBlockedVideos} handleClose={closeMultiDeleteModal} />
<MultiDeleteBlockedVideoModalContent blockedVideos={activeBlockedVideos} handleClose={handleMultiDeleteModalCallback} />
)}
</Modal>

Expand Down
7 changes: 6 additions & 1 deletion frontend/app/admin/queue/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ const AdminQueuePage = () => {
openDeleteModal()
};

const handleMultiDeleteModalCallback = () => {
closeMultiDeleteModal()
setActiveQueueItems([])
}

if (isPending) return (
<GanymedeLoadingText message="Loading queue items" />
)
Expand Down Expand Up @@ -249,7 +254,7 @@ const AdminQueuePage = () => {

<Modal opened={multiDeleteModalOpened} onClose={closeMultiDeleteModal} title="Delete Queue Items">
{activeQueueItems && (
<MultiDeleteQueueModalContent queues={activeQueueItems} handleClose={closeMultiDeleteModal} />
<MultiDeleteQueueModalContent queues={activeQueueItems} handleClose={handleMultiDeleteModalCallback} />
)}
</Modal>

Expand Down
36 changes: 34 additions & 2 deletions frontend/app/admin/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import GanymedeLoadingText from "@/app/components/utils/GanymedeLoadingText"
import { useAxiosPrivate } from "@/app/hooks/useAxios"
import { Config, NotificationType, ProxyListItem, useEditConfig, useGetConfig, useTestNotification } from "@/app/hooks/useConfig"
import { ActionIcon, Button, Card, Checkbox, Code, Collapse, Container, Flex, MultiSelect, Text, Textarea, TextInput, Title } from "@mantine/core"
import { ActionIcon, Button, Card, Checkbox, Code, Collapse, Container, Flex, MultiSelect, NumberInput, Text, Textarea, TextInput, Title } from "@mantine/core"
import { useForm } from "@mantine/form"
import { useDisclosure } from "@mantine/hooks"
import Link from "next/link"
Expand Down Expand Up @@ -35,6 +35,8 @@ const AdminSettingsPage = () => {
const form = useForm({
mode: "controlled",
initialValues: {
live_check_interval_seconds: data?.live_check_interval_seconds || 300,
video_check_interval_minutes: data?.video_check_interval_minutes || 180,
registration_enabled: data?.registration_enabled ?? true,
parameters: {
twitch_token: data?.parameters.twitch_token || "",
Expand All @@ -44,6 +46,7 @@ const AdminSettingsPage = () => {
},
archive: {
save_as_hls: data?.archive.save_as_hls ?? false,
generate_sprite_thumbnails: data?.archive.generate_sprite_thumbnails ?? true
},
notifications: {
video_success_webhook_url: data?.notifications.video_success_webhook_url || "",
Expand Down Expand Up @@ -338,14 +341,43 @@ const AdminSettingsPage = () => {

<Title mt={10} order={3}>Archive</Title>

<Checkbox
<NumberInput
label="Live Stream Check Interval Seconds"
description="How often watched channels are checked for live streams in seconds. REQUIRES RESTART!"
placeholder="300"
key={form.key('live_check_interval_seconds')}
{...form.getInputProps('live_check_interval_seconds')}
min={5}
/>

<NumberInput
mt={10}
label="Video Check Interval Minutes"
description="How often watched channels are checked for videos in minutes. REQUIRES RESTART!"
placeholder="180"
key={form.key('video_check_interval_minutes')}
{...form.getInputProps('video_check_interval_minutes')}
min={1}
/>


<Checkbox
mt={15}
label="Convert MP4 to HLS"
key={form.key('archive.save_as_hls')}
{...form.getInputProps('archive.save_as_hls', { type: "checkbox" })}
mr={15}
/>

<Checkbox
mt={15}
label="Generate Sprite Thumbnails"
description="Preview thumbnail when scrubbing a video's timeline. These are generated after the video is archived."
key={form.key('archive.generate_sprite_thumbnails')}
{...form.getInputProps('archive.generate_sprite_thumbnails', { type: "checkbox" })}
mr={15}
/>

<Button
mt={15}
onClick={toggleStorageTemplate}
Expand Down
7 changes: 6 additions & 1 deletion frontend/app/admin/videos/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ const AdminVideosPage = () => {
openDeleteModal()
};

const handleMultiDeleteModalCallback = () => {
closeMultiDeleteModal()
setActiveVideos([])
}

if (isPending) return (
<GanymedeLoadingText message="Loading Videos" />
)
Expand Down Expand Up @@ -254,7 +259,7 @@ const AdminVideosPage = () => {
</Modal>
<Modal opened={multiDeleteModalOpened} onClose={closeMultiDeleteModal} title="Delete Videos">
{activeVideos && (
<MultiDeleteVideoModalContent videos={activeVideos} handleClose={closeMultiDeleteModal} />
<MultiDeleteVideoModalContent videos={activeVideos} handleClose={handleMultiDeleteModalCallback} />
)}
</Modal>

Expand Down
3 changes: 3 additions & 0 deletions frontend/app/hooks/useConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { User } from "./useAuthentication";
import { NullResponse } from "./usePlayback";

export interface Config {
live_check_interval_seconds: number;
video_check_interval_minutes: number;
registration_enabled: boolean;
parameters: {
twitch_token: string;
Expand All @@ -14,6 +16,7 @@ export interface Config {
};
archive: {
save_as_hls: boolean;
generate_sprite_thumbnails: boolean;
};
notifications: Notification;
storage_templates: StorageTemplate;
Expand Down
5 changes: 0 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ require (
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gabriel-vasile/mimetype v1.4.7 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
Expand All @@ -67,9 +66,6 @@ require (
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect
github.com/magiconair/properties v1.8.9 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.6.0 // indirect
Expand Down Expand Up @@ -119,7 +115,6 @@ require (
github.com/google/go-cmp v0.6.0 // indirect
github.com/hashicorp/hcl/v2 v2.23.0 // indirect
github.com/jackc/pgx/v5 v5.7.2
github.com/knadh/koanf v1.5.0
github.com/labstack/gommon v0.4.2 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand Down
Loading
Loading