Skip to content

Commit

Permalink
reworked fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NeloBlivion authored Nov 14, 2023
1 parent 501331b commit 09ffea8
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/views/MultiView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,9 @@ export default {
// show the dialog
this.overwriteDialog = true;
},
handleToolbarClick(video) {
handleToolbarClick(v) {
const video = this.checkStreamType(v);
if (!video) return;
const hasEmptyCell = this.findEmptyCell();
// more cells needed, increment to next preset with space
if (!hasEmptyCell) {
Expand All @@ -397,21 +399,13 @@ export default {
}
},
handleVideoClicked(v) {
let video = v;
if (video.type === "placeholder") {
const twitchChannel = video.link.match(TWITCH_VIDEO_URL_REGEX)?.groups.id;
if (!twitchChannel) return;
video = {
...video,
id: twitchChannel,
type: "twitch",
};
}
if (this.showSelectorForId < -1) {
this.handleToolbarClick(video);
this.handleToolbarClick(v);
this.showSelectorForId = -1;
return;
}
const video = this.checkStreamType(v);
if (!video) return;
this.addVideoWithId(video, this.showSelectorForId);
this.showSelectorForId = -1;
},
Expand Down Expand Up @@ -442,6 +436,19 @@ export default {
toggleSyncBar() {
this.showSyncBar = !this.showSyncBar;
},
checkStreamType(v) {
let video = v;
if (video.type === "placeholder") {
const twitchChannel = video.link.match(TWITCH_VIDEO_URL_REGEX)?.groups.id;
if (!twitchChannel) return;
video = {
...video,
id: twitchChannel,
type: "twitch",
};
}
return video;
}
},
};
</script>
Expand Down

0 comments on commit 09ffea8

Please sign in to comment.