diff --git a/README.md b/README.md index b9e4ea5..838c3e1 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,13 @@ you may need to add this to your PATH. An alternative I have is setting `DENO_INSTALL_ROOT` to `~/.local/bin`, which I have in my PATH. ## Upgrading + You can upgrade in a similar way to installing: ```bash deno cache --reload "https://git.froth.zone/sam/cytube-json-generator/raw/branch/master/generator.ts" ``` + then [install](#installation) again. ## Usage diff --git a/file_name_test.ts b/file_name_test.ts index 02f11ec..cccdf18 100644 --- a/file_name_test.ts +++ b/file_name_test.ts @@ -3,21 +3,21 @@ import { assertEquals } from "https://deno.land/std@0.141.0/testing/asserts.ts"; const files = new Map(); files.set( "8.Mile.2002.720p.BluRay.999MB.HQ.x265.10bit.mp4", - "8.Mile.2002.720p.BluRay.999MB.HQ.x265.10bit.srt" + "8.Mile.2002.720p.BluRay.999MB.HQ.x265.10bit.srt", ); files.set("Blade.Runner (1997).mp4", "Blade.Runner (1997).srt"); files.set( "Total.Recall.1990.REMASTERED.720p.BluRay.999MB.HQ.x265.mp4", - "Total.Recall.1990.REMASTERED.720p.BluRay.999MB.HQ.x265.srt" + "Total.Recall.1990.REMASTERED.720p.BluRay.999MB.HQ.x265.srt", ); files.set("", ""); files.set( "[Biraru] Chi's Sweet Home - 022 [DVD][576p][10-bit][x264][AC3][3CBD659E].mkv", - "[Biraru] Chi's Sweet Home - 022 [DVD][576p][10-bit][x264][AC3][3CBD659E].srt" + "[Biraru] Chi's Sweet Home - 022 [DVD][576p][10-bit][x264][AC3][3CBD659E].srt", ); files.set( "[Reaktor] Legend of the Galactic Heroes - Ginga Eiyuu Densetsu - Gaiden - Arc 1 - E1 [720p][x265][10-bit].mp4", - "[Reaktor] Legend of the Galactic Heroes - Ginga Eiyuu Densetsu - Gaiden - Arc 1 - E1 [720p][x265][10-bit].srt" + "[Reaktor] Legend of the Galactic Heroes - Ginga Eiyuu Densetsu - Gaiden - Arc 1 - E1 [720p][x265][10-bit].srt", ); Deno.test({ diff --git a/generator.ts b/generator.ts index a54f975..7095d4b 100644 --- a/generator.ts +++ b/generator.ts @@ -60,9 +60,12 @@ async function main(): Promise { // Get video file length const videoFile: string = args._[0] as string; - + //preserve file name for JSON file and strip file extension and final . - const videoName = videoFile.split('/').pop()!.slice(0,videoFile.length-4) as string; + const videoName = videoFile.split("/").pop()!.slice( + 0, + videoFile.length - 4, + ) as string; const stats = await ffprobe(videoFile).catch(() => { Deno.exit(1); }); @@ -94,7 +97,7 @@ async function main(): Promise { // Upload the subtitles const subtitlesUrl = await upload(`./${videoName}.vtt`); - const subtitleName = `${videoName}.vtt` + const subtitleName = `${videoName}.vtt`; // Generate the JSON const json = { title: videoName,