Skip to content

Commit

Permalink
restored upvotes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelTattersfield committed May 5, 2024
1 parent c966fd7 commit 773e0ea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ui/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
</h5>
</div>
<div class="btn-group-vertical" role="group" aria-label="Basic example">
<button type="button" class="btn btn-success btn-lg" @click="voteUp">{{ upVoteText }}</button>
<button type="button" class="btn btn-danger btn-lg" @click="voteDown">{{ skipText }}</button>
</div>
</div>
Expand All @@ -38,12 +39,24 @@
const playlist = ref([]);
const nowPlaying = ref({});
const upVoteText = ref("Upvote this bop");
const upVoteShitpost = [
"Upgrade to LanOps premium™ to unlock this feature",
"Shit taste, no thanks",
'Song "upvoted"',
"Purchase a lanops box and key for a chance to unlock upvotes"
]
const skipText = ref("Vote song uploader is a cunt");
async function refreshPlaylist () {
playlist.value = await $fetch(runtimeConfig.public.apiEndpoint + `/tracks`).catch((error) => error.data)
}
async function voteUp() {
upVoteText.value = upVoteShitpost[Math.floor(Math.random() * upVoteShitpost.length)];
}
async function voteDown() {
try {
await $fetch(`${runtimeConfig.public.apiEndpoint}/votes/skip`, {method: 'POST', body: { uri: nowPlaying.value.uri }})
Expand Down

0 comments on commit 773e0ea

Please sign in to comment.