Skip to content

Commit

Permalink
feat: Add more speeds to speed watch feature
Browse files Browse the repository at this point in the history
  • Loading branch information
VampireChicken12 committed Sep 16, 2023
1 parent 3691a98 commit 68f82d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/components/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useAutoAnimate } from "@formkit/auto-animate/react";
import React, { ChangeEvent, Dispatch, SetStateAction, useEffect, useState } from "react";
import { Checkbox, NumberInput, Select, SelectOption } from "../Inputs";
import { settingsAreDefault } from "@/src/utils/utilities";
import { YoutubePlayerSpeedRates } from "@/src/utils/constants";

export default function Settings({
settings,
Expand Down Expand Up @@ -191,16 +192,7 @@ export default function Settings({
{ label: "4320p", value: "highres" },
{ label: "auto", value: "auto" }
].reverse();
const YouTubePlayerSpeedOptions: SelectOption[] = [
{ label: "0.25", value: "0.25" },
{ label: "0.5", value: "0.5" },
{ label: "0.75", value: "0.75" },
{ label: "1", value: "1" },
{ label: "1.25", value: "1.25" },
{ label: "1.5", value: "1.5" },
{ label: "1.75", value: "1.75" },
{ label: "2", value: "2" }
];
const YouTubePlayerSpeedOptions: SelectOption[] = YoutubePlayerSpeedRates.map((rate) => ({ label: rate.toString(), value: rate.toString() }));
const ScreenshotFormatOptions: SelectOption[] = [
{ label: "PNG", value: "png" },
{ label: "JPEG", value: "jpeg" },
Expand Down
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export type YoutubePlayerQualityLevel =
| "hd2880"
| "highres"
| "auto";
export type YouTubePlayerSpeedRate = 0.25 | 0.5 | 0.75 | 1 | 1.25 | 1.5 | 1.75 | 2;
export type YouTubePlayerSpeedRateExpanded = 2.25 | 2.5 | 2.75 | 3 | 3.25 | 3.75 | 4;
export type YouTubePlayerSpeedRate = 0.25 | 0.5 | 0.75 | 1 | 1.25 | 1.5 | 1.75 | 2 | YouTubePlayerSpeedRateExpanded;
export type ScreenshotType = "file" | "clipboard";

export type ScreenshotFormat = "png" | "jpeg" | "webp";
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ export const YoutubePlayerQualityLevels = [
"highres",
"auto"
] as const;
export const YoutubePlayerSpeedRates = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2] as const;
export const YoutubePlayerSpeedRates = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4] as const;

0 comments on commit 68f82d8

Please sign in to comment.