Skip to content

Commit

Permalink
Fix the adding of videos to the queue (#144)
Browse files Browse the repository at this point in the history
* Fix the socket receiving too much data from youtubei

* Fix useRoute().name being undefined
  • Loading branch information
ysbrandB authored Feb 2, 2025
1 parent 3b13472 commit d8002a6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
22 changes: 8 additions & 14 deletions client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
<keep-alive v-if="new Date().getMonth() === 11">
<SnowFall
:class="
currentRoute === 'Screen' ||
currentRoute === 'Admin Screen' ||
currentRoute === 'Error' ||
currentRoute === 'Local Admin Screen'
$route.name === 'Screen' ||
$route.name === 'Admin Screen' ||
$route.name === 'Error' ||
$route.name === 'Local Admin Screen'
? ''
: '-z-10'
" />
</keep-alive>
<div
v-if="
currentRoute == 'Screen' ||
currentRoute == 'Admin Screen' ||
currentRoute == 'Error' ||
currentRoute == 'Local Admin Screen'
$route.name == 'Screen' ||
$route.name == 'Admin Screen' ||
$route.name == 'Error' ||
$route.name === 'Local Admin Screen'
">
<router-view v-slot="{ Component, route }">
<transition :name="route.meta.transition || ''">
Expand All @@ -32,9 +32,6 @@
</template>

<script setup>
import { useRoute } from "vue-router";
import { computed } from "vue";
// snowflake's
import SnowFall from "@/components/SnowFall";
Expand All @@ -52,9 +49,6 @@ if (
document.documentElement.classList.remove("dark");
}
const currentRoute = computed(() => {
return useRoute().name;
});
</script>

<style>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/MasterControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

<script setup>
import socket, { connectSocket } from "@/js/AdminRemoteSocket";
import { ref, onBeforeMount, onBeforeUnmount, defineEmits } from "vue";
import { ref, onBeforeMount, onBeforeUnmount } from "vue";
import { useRouter } from "vue-router";
import enums from "@/js/Enums";
import ContentField from "../layout/ContentField.vue";
Expand Down
4 changes: 3 additions & 1 deletion server/utils/yt.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ exports.search = async (
let newContinuation = result.continuation;

if (!videos) return new Error("Could not find any videos");

videos.map((video) => sanitizeVideo(video));

// Checking if video already in queue
videos.forEach((video) => {
if (queue.some((queueVid) => queueVid.id === video.id)) {
Expand Down Expand Up @@ -114,6 +114,8 @@ const sanitizeVideo = (video) => {
delete video.description;
delete video.comments;
delete video.client;
delete video.chapters;
delete video.captions;

video.channel = video.channel.name;
video.thumbnail = video.thumbnails[video.thumbnails.length - 1];
Expand Down

0 comments on commit d8002a6

Please sign in to comment.