Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Commit

Permalink
Add more constants
Browse files Browse the repository at this point in the history
  • Loading branch information
EsotericEnderman committed Aug 4, 2024
1 parent 946eb32 commit 8799ae0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
11 changes: 7 additions & 4 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { readFileSync } from "fs";

export const moviesFolder = "C:\\XboxGames\\Minecraft Dungeons\\Content\\Dungeons\\Content\\Movies";
export const driveLetter = "C";
export const drivePathSeparator = ":";
export const fileSeparator = "/";

export const blankSplashFileName = "blank_splash720.mp4";
export const moviesFolderPath = driveLetter + drivePathSeparator + fileSeparator + "XboxGames" + fileSeparator + "Minecraft Dungeons" + fileSeparator + "Content" + fileSeparator + "Dungeons" + fileSeparator + "Content" + fileSeparator + "Movies";

export const blankSplashContent = readFileSync(moviesFolder + "/" + blankSplashFileName);
export const blankSplashFileName = "blank_splash720.mp4";
export const blankSplashContent = readFileSync(moviesFolderPath + fileSeparator + blankSplashFileName);

export const splashesToRemove = [
"double11_splash720.mp4",
Expand All @@ -19,4 +22,4 @@ export const splashesToRemove = [
"unreal_splash1080.mp4"
]

export const archivedVideoEnding = "-archived";
export const archivedVideoSuffix = "-archived";
6 changes: 3 additions & 3 deletions src/scripts/remove-loading-videos.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { archivedVideoEnding, blankSplashContent, moviesFolder, splashesToRemove } from "../constants";
import { archivedVideoSuffix, blankSplashContent, fileSeparator, moviesFolderPath, splashesToRemove } from "../constants";
import { existsSync, readFileSync, writeFileSync } from "fs";

export function removeLoadingVideos() {
for (const loadingVideo of splashesToRemove) {
const fullFilePath = moviesFolder + "/" + loadingVideo;
const fullFilePath = moviesFolderPath + fileSeparator + 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;
split[1] = archivedVideoSuffix;

let archivedVideoFilePath = split.join("")
archivedVideoFilePath += ".mp4";
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/revert-changes.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { readFileSync, rmSync, writeFileSync } from "fs";
import { archivedVideoEnding, moviesFolder, splashesToRemove } from "../constants";
import { archivedVideoSuffix, moviesFolderPath, splashesToRemove } from "../constants";

export function revertChanges() {
for (const loadingVideo of splashesToRemove) {
const fullFilePath = moviesFolder + "/" + loadingVideo;
const fullFilePath = moviesFolderPath + "/" + loadingVideo;

const split = fullFilePath.split(".");
split[1] = archivedVideoEnding;
split[1] = archivedVideoSuffix;

let archivedVideoFilePath = split.join("")
archivedVideoFilePath += ".mp4";
Expand Down

0 comments on commit 8799ae0

Please sign in to comment.