mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 01:46:23 +00:00
SpotifyControls: Setting to restart playing song if playtime >3s (#3103)
This commit is contained in:
parent
20ed7dc96b
commit
34629307dd
2 changed files with 9 additions and 1 deletions
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
import "./spotifyStyles.css";
|
import "./spotifyStyles.css";
|
||||||
|
|
||||||
|
import { Settings } from "@api/Settings";
|
||||||
import { Flex } from "@components/Flex";
|
import { Flex } from "@components/Flex";
|
||||||
import { ImageIcon, LinkIcon, OpenExternalIcon } from "@components/Icons";
|
import { ImageIcon, LinkIcon, OpenExternalIcon } from "@components/Icons";
|
||||||
import { debounce } from "@shared/debounce";
|
import { debounce } from "@shared/debounce";
|
||||||
|
@ -130,7 +131,9 @@ function Controls() {
|
||||||
>
|
>
|
||||||
<Shuffle />
|
<Shuffle />
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={() => SpotifyStore.prev()}>
|
<Button onClick={() => {
|
||||||
|
Settings.plugins.SpotifyControls.previousButtonRestartsTrack && SpotifyStore.position > 3000 ? SpotifyStore.seek(0) : SpotifyStore.prev();
|
||||||
|
}}>
|
||||||
<SkipPrev />
|
<SkipPrev />
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={() => SpotifyStore.setPlaying(!isPlaying)}>
|
<Button onClick={() => SpotifyStore.setPlaying(!isPlaying)}>
|
||||||
|
|
|
@ -44,6 +44,11 @@ export default definePlugin({
|
||||||
type: OptionType.BOOLEAN,
|
type: OptionType.BOOLEAN,
|
||||||
description: "Open Spotify URIs instead of Spotify URLs. Will only work if you have Spotify installed and might not work on all platforms",
|
description: "Open Spotify URIs instead of Spotify URLs. Will only work if you have Spotify installed and might not work on all platforms",
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
previousButtonRestartsTrack: {
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
description: "Restart currently playing track when pressing the previous button if playtime is >3s",
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
patches: [
|
patches: [
|
||||||
|
|
Loading…
Reference in a new issue