Skip to content
Open
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
37 changes: 26 additions & 11 deletions Grayjay.ClientServer/Settings/GrayjaySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,22 +159,37 @@ public string GetPrimaryLanguage()
public bool PreferOriginalAudio { get; set; } = true;

[SettingsField("Default Playback Speed", SettingsField.DROPDOWN, "", 1)]
[SettingsDropdownOptions("0.25", "0.5", "0.75", "1.0", "1.25", "1.5", "1.75", "2.0", "2.25")]
public int DefaultPlaybackSpeed { get; set; } = 3;
[SettingsDropdownOptions("0.05","0.1","0.25", "0.5", "0.75", "1.0", "1.25", "1.5", "1.75", "2.0", "2.33", "2.66", "3", "3.5", "4", "5","6","8","10","12","15","20","30","60")]
public int DefaultPlaybackSpeed { get; set; } = 5;

public float GetDefaultPlaybackSpeed()
{
return DefaultPlaybackSpeed switch
{
0 => 0.25f,
1 => 0.5f,
2 => 0.75f,
3 => 1.0f,
4 => 1.25f,
5 => 1.5f,
6 => 1.75f,
7 => 2.0f,
8 => 2.25f,
0 => 0.05f,
1 => 0.1f,
2 => 0.25f,
3 => 0.5f,
4 => 0.75f,
5 => 1.0f,
6 => 1.25f,
7 => 1.5f,
8 => 1.75f,
9 => 2.0f,
10 => 2.33f,
11 => 2.66f,
12 => 3f,
13 => 3.5f,
14 => 4f,
15 => 5f,
16 => 6f,
17 => 8f,
18 => 10f,
19 => 12f,
20 => 15f,
21 => 20f,
22 => 30f,
23 => 60f,
_ => 1.0f
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,30 @@ const VideoDetailView: Component<VideoDetailsProps> = (props) => {
async function getDefaultPlaybackSpeed() {
const value = (await SettingsBackend.settings())?.object?.playback?.defaultPlaybackSpeed;
switch (value) {
case 0: return 0.25;
case 1: return 0.5;
case 2: return 0.75;
case 3: return 1.0;
case 4: return 1.25;
case 5: return 1.5;
case 6: return 1.75;
case 7: return 2.0;
case 8: return 2.25;
case 0: return 0.05;
case 1: return 0.1;
case 2: return 0.25;
case 3: return 0.5;
case 4: return 0.75;
case 5: return 1.0;
case 6: return 1.25;
case 7: return 1.5;
case 8: return 1.75;
case 9: return 2.0;
case 10: return 2.33;
case 11: return 2.66;
case 12: return 3;
case 13: return 3.5;
case 14: return 4;
case 15: return 5;
case 16: return 6;
case 17: return 8;
case 18: return 10;
case 19: return 12;
case 20: return 15;
case 21: return 20;
case 22: return 30;
case 23: return 60;
default: return 1.0;
}
}
Expand Down Expand Up @@ -997,7 +1012,7 @@ const VideoDetailView: Component<VideoDetailsProps> = (props) => {
type: "group",
subMenu: {
title: "Playback Speed",
items: [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25].map(s => {
items: [0.05,0.1,0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.33,2.66,3,3.5,4,5,6,8,10,12,15,20,30,60].map(s => {
return {
name: `${s.toFixed(2)}x`,
value: s,
Expand Down