Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Sep 2, 2023
1 parent ff987e9 commit 0c89ab8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/hub/tabControllers/VideoController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default class VideoController extends TimelineVizController {
this.TBA_SOURCE = sourceCell.children[2] as HTMLButtonElement;
this.LOCAL_SOURCE.addEventListener("click", () => {
this.YOUTUBE_SOURCE.classList.remove("animating");
this.TBA_SOURCE.classList.add("animating");
this.TBA_SOURCE.classList.remove("animating");
window.sendMainMessage("select-video", {
uuid: this.UUID,
source: VideoSource.Local,
Expand Down
8 changes: 6 additions & 2 deletions src/main/VideoProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,12 @@ export class VideoProcessor {
properties: ["openFile"],
filters: [{ name: "Videos", extensions: VideoProcessor.extensions }]
})
.then((result) => result.filePaths[0]);
.then((result) => {
if (result.canceled || result.filePaths.length === 0) {
throw new Error();
}
return result.filePaths[0];
});
}

/** Gets the direct download URL based on a YouTube URL */
Expand Down Expand Up @@ -332,7 +337,6 @@ export class VideoProcessor {
new MenuItem({
label: titles[i],
click() {
console.log(videoKeys[i]);
resolved = true;
resolve("https://youtube.com/watch?v=" + videoKeys[i]);
}
Expand Down

0 comments on commit 0c89ab8

Please sign in to comment.