This repository has been archived by the owner on Sep 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62e3430
commit 4e6f951
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { removeLoadingVideos } from "./scripts/remove-loading-videos"; | ||
|
||
removeLoadingVideos(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { archivedVideoEnding, blankSplashContent, moviesFolder, splashesToRemove } from "../constants.js"; | ||
import { readFileSync, rmSync, writeFileSync } from "fs"; | ||
|
||
export function removeLoadingVideos() { | ||
for (const loadingVideo of splashesToRemove) { | ||
const fullFilePath = moviesFolder + "/" + loadingVideo; | ||
|
||
const content = readFileSync(fullFilePath); | ||
|
||
// Save content to new file, in case the user wants to re-add the loading videos | ||
const split = fullFilePath.split("."); | ||
split[1] = archivedVideoEnding; | ||
|
||
let archivedVideoFilePath = split.join(".") | ||
archivedVideoFilePath += ".mp4"; | ||
|
||
console.log("Removing video " + fullFilePath + " and archiving it at " + archivedVideoFilePath + "."); | ||
|
||
writeFileSync(archivedVideoFilePath, content); | ||
|
||
rmSync(fullFilePath); | ||
writeFileSync(fullFilePath, blankSplashContent); | ||
} | ||
} |