Skip to content

Commit

Permalink
chore: move playlist length feature
Browse files Browse the repository at this point in the history
  • Loading branch information
livingflore committed Nov 15, 2024
1 parent c63fdda commit bbc8d3c
Showing 1 changed file with 48 additions and 48 deletions.
96 changes: 48 additions & 48 deletions src/components/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,54 @@ export default function Settings() {
value={settings.forward_rewind_buttons_time}
/>
</SettingSection>
<SettingSection title={t("settings.sections.playlistLength.title")}>
<SettingTitle />
<Setting
checked={settings.enable_playlist_length?.toString() === "true"}
id="enable_playlist_length"
label={t("settings.sections.playlistLength.enable.label")}
onChange={setCheckboxOption("enable_playlist_length")}
title={t("settings.sections.playlistLength.enable.title")}
type="checkbox"
/>
<Setting
disabled={settings.enable_playlist_length?.toString() !== "true"}
id="playlist_length_get_method"
label={t("settings.sections.playlistLength.wayToGetLength.select.label")}
onChange={setValueOption("playlist_length_get_method")}
options={playlistLengthGetMethodOptions}
selectedOption={getSelectedOption("playlist_length_get_method")}
title={t("settings.sections.playlistLength.wayToGetLength.select.title")}
type="select"
/>
<Setting
disabled={settings.enable_playlist_length?.toString() !== "true"}
id="playlist_watch_time_get_method"
label={t("settings.sections.playlistLength.wayToGetWatchTime.select.label")}
onChange={setValueOption("playlist_watch_time_get_method")}
options={playlistWatchTimeGetMethodOptions}
selectedOption={getSelectedOption("playlist_watch_time_get_method")}
title={t("settings.sections.playlistLength.wayToGetWatchTime.select.title")}
type="select"
/>
</SettingSection>
<SettingSection title={t("settings.sections.youtubeDataApiV3Key.title")}>
<SettingTitle />
<Setting
id="youtube_data_api_v3_key"
input_type="password"
label={t("settings.sections.youtubeDataApiV3Key.input.label")}
onChange={setValueOption("youtube_data_api_v3_key")}
title={t("settings.sections.youtubeDataApiV3Key.input.title")}
type="text-input"
value={settings.youtube_data_api_v3_key}
/>
<fieldset className={cn("flex flex-row gap-1")}>
<Link className="ml-2" href="https://developers.google.com/youtube/v3/getting-started" target="_blank">
{t("settings.sections.youtubeDataApiV3Key.getApiKeyLinkText")}
</Link>
</fieldset>
</SettingSection>
<SettingSection title={t("settings.sections.youtubeDeepDark.title")}>
<SettingTitle />
<fieldset className={cn("flex flex-row gap-1")}>
Expand Down Expand Up @@ -1228,54 +1276,6 @@ export default function Settings() {
value={settings.custom_css_code}
/>
</SettingSection>
<SettingSection title={t("settings.sections.playlistLength.title")}>
<SettingTitle />
<Setting
checked={settings.enable_playlist_length?.toString() === "true"}
id="enable_playlist_length"
label={t("settings.sections.playlistLength.enable.label")}
onChange={setCheckboxOption("enable_playlist_length")}
title={t("settings.sections.playlistLength.enable.title")}
type="checkbox"
/>
<Setting
disabled={settings.enable_playlist_length?.toString() !== "true"}
id="playlist_length_get_method"
label={t("settings.sections.playlistLength.wayToGetLength.select.label")}
onChange={setValueOption("playlist_length_get_method")}
options={playlistLengthGetMethodOptions}
selectedOption={getSelectedOption("playlist_length_get_method")}
title={t("settings.sections.playlistLength.wayToGetLength.select.title")}
type="select"
/>
<Setting
disabled={settings.enable_playlist_length?.toString() !== "true"}
id="playlist_watch_time_get_method"
label={t("settings.sections.playlistLength.wayToGetWatchTime.select.label")}
onChange={setValueOption("playlist_watch_time_get_method")}
options={playlistWatchTimeGetMethodOptions}
selectedOption={getSelectedOption("playlist_watch_time_get_method")}
title={t("settings.sections.playlistLength.wayToGetWatchTime.select.title")}
type="select"
/>
</SettingSection>
<SettingSection title={t("settings.sections.youtubeDataApiV3Key.title")}>
<SettingTitle />
<Setting
id="youtube_data_api_v3_key"
input_type="password"
label={t("settings.sections.youtubeDataApiV3Key.input.label")}
onChange={setValueOption("youtube_data_api_v3_key")}
title={t("settings.sections.youtubeDataApiV3Key.input.title")}
type="text-input"
value={settings.youtube_data_api_v3_key}
/>
<fieldset className={cn("flex flex-row gap-1")}>
<Link className="ml-2" href="https://developers.google.com/youtube/v3/getting-started" target="_blank">
{t("settings.sections.youtubeDataApiV3Key.getApiKeyLinkText")}
</Link>
</fieldset>
</SettingSection>

<div className="sticky bottom-0 left-0 z-10 flex justify-between gap-1 bg-[#f5f5f5] p-2 dark:bg-[#181a1b]">
<input
Expand Down

0 comments on commit bbc8d3c

Please sign in to comment.