bazarr/frontend/src/pages/Settings/Scheduler/index.tsx

181 lines
5.8 KiB
TypeScript
Raw Normal View History

import { SelectorOption } from "@/components";
import { FunctionComponent, useMemo } from "react";
2021-03-25 14:22:43 +00:00
import {
Check,
2021-03-25 14:22:43 +00:00
CollapseBox,
Group,
Input,
Layout,
Message,
2021-03-25 14:22:43 +00:00
Selector,
} from "../components";
import {
backupOptions,
2021-03-25 14:22:43 +00:00
dayOptions,
diskUpdateOptions,
episodesSyncOptions,
2021-03-25 14:22:43 +00:00
moviesSyncOptions,
seriesSyncOptions,
upgradeOptions,
} from "./options";
const SettingsSchedulerView: FunctionComponent = () => {
const timeOptions = useMemo(() => {
return Array(24)
.fill(null)
.map<SelectorOption<number>>((_, idx) => ({
label: `${idx}:00`,
value: idx,
}));
}, []);
return (
<Layout name="Scheduler">
2021-03-25 14:22:43 +00:00
<Group header="Sonarr/Radarr Sync">
<Input name="Update Series List from Sonarr">
2021-03-25 14:22:43 +00:00
<Selector
options={seriesSyncOptions}
settingKey="settings-sonarr-series_sync"
></Selector>
</Input>
<Input name="Update Episodes List from Sonarr">
<Selector
options={episodesSyncOptions}
settingKey="settings-sonarr-episodes_sync"
></Selector>
</Input>
<Input name="Update Movies List from Radarr">
2021-03-25 14:22:43 +00:00
<Selector
options={moviesSyncOptions}
settingKey="settings-radarr-movies_sync"
></Selector>
</Input>
</Group>
<Group header="Disk Indexing">
<CollapseBox>
<CollapseBox.Control>
<Input name="Update all Episode Subtitles from Disk">
<Selector
settingKey="settings-sonarr-full_update"
options={diskUpdateOptions}
></Selector>
</Input>
</CollapseBox.Control>
<CollapseBox.Content on={(k) => k === "Weekly"}>
<Input name="Day of The Week">
<Selector
settingKey="settings-sonarr-full_update_day"
options={dayOptions}
></Selector>
</Input>
</CollapseBox.Content>
<CollapseBox.Content on={(k) => k === "Daily" || k === "Weekly"}>
<Input name="Time of The Day">
<Selector
settingKey="settings-sonarr-full_update_hour"
options={timeOptions}
></Selector>
</Input>
</CollapseBox.Content>
<Input>
<Check
label="Use cached ffprobe results"
settingKey="settings-sonarr-use_ffprobe_cache"
></Check>
<Message>
If disabled, Bazarr will use ffprobe to index video file
properties on each run. This will result in higher disk I/O.
</Message>
</Input>
2021-03-25 14:22:43 +00:00
</CollapseBox>
<CollapseBox>
<CollapseBox.Control>
<Input name="Update all Movie Subtitles from Disk">
<Selector
settingKey="settings-radarr-full_update"
options={diskUpdateOptions}
></Selector>
</Input>
</CollapseBox.Control>
<CollapseBox.Content on={(k) => k === "Weekly"}>
<Input name="Day of The Week">
<Selector
settingKey="settings-radarr-full_update_day"
options={dayOptions}
></Selector>
</Input>
</CollapseBox.Content>
<CollapseBox.Content on={(k) => k === "Daily" || k === "Weekly"}>
<Input name="Time of The Day">
<Selector
settingKey="settings-radarr-full_update_hour"
options={timeOptions}
></Selector>
</Input>
</CollapseBox.Content>
<Input>
<Check
label="Use cached ffprobe results"
settingKey="settings-radarr-use_ffprobe_cache"
></Check>
<Message>
If disabled, Bazarr will use ffprobe to index video file
properties on each run. This will result in higher disk I/O.
</Message>
</Input>
2021-03-25 14:22:43 +00:00
</CollapseBox>
</Group>
<Group header="Search and Upgrade Subtitles">
<Input name="Search for Missing Series Subtitles">
<Selector
settingKey="settings-general-wanted_search_frequency"
options={upgradeOptions}
></Selector>
</Input>
<Input name="Search for Missing Movies Subtitles">
<Selector
options={upgradeOptions}
settingKey="settings-general-wanted_search_frequency_movie"
></Selector>
</Input>
<Input name="Upgrade Previously Downloaded Subtitles">
<Selector
options={upgradeOptions}
settingKey="settings-general-upgrade_frequency"
></Selector>
</Input>
</Group>
<Group header="Backup">
<CollapseBox>
<CollapseBox.Control>
<Input name="Backup config and database">
<Selector
settingKey="settings-backup-frequency"
options={backupOptions}
></Selector>
</Input>
</CollapseBox.Control>
<CollapseBox.Content on={(k) => k === "Weekly"}>
<Input name="Day of The Week">
<Selector
settingKey="settings-backup-day"
options={dayOptions}
></Selector>
</Input>
</CollapseBox.Content>
<CollapseBox.Content on={(k) => k === "Daily" || k === "Weekly"}>
<Input name="Time of The Day">
<Selector
settingKey="settings-backup-hour"
options={timeOptions}
></Selector>
</Input>
</CollapseBox.Content>
</CollapseBox>
</Group>
</Layout>
2021-03-25 14:22:43 +00:00
);
};
export default SettingsSchedulerView;