Skip to content

Commit

Permalink
Check for
Browse files Browse the repository at this point in the history
ts files in storage folder
  • Loading branch information
MrBrax committed Dec 7, 2023
1 parent 67d5825 commit aeaba92
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions server/src/Core/LiveStreamDVR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import type { BinaryStatus } from "@common/Api/About";
import type { ChannelConfig } from "@common/Config";
import { SubStatus } from "@common/Defs";
import checkDiskSpace from "check-disk-space";
import readdirRecursive from "fs-readdir-recursive";
import i18next, { t } from "i18next";
import path from "node:path";
import type { WebSocketServer } from "ws";
Expand Down Expand Up @@ -476,16 +477,19 @@ export class LiveStreamDVR {

public cleanLingeringVODs(): void {
this.vods.forEach((vod) => {
const channel = vod.getChannel();
if (!channel) {
let channel;
try {
channel = vod.getChannel();
} catch (error) {
log(
LOGLEVEL.WARNING,
LOGLEVEL.ERROR,
"dvr.cleanLingeringVODs",
`Channel ${vod.getChannel().internalName} removed but VOD ${
vod.basename
} still lingering`
);
}

if (!fs.existsSync(vod.filename)) {
log(
LOGLEVEL.WARNING,
Expand Down Expand Up @@ -962,6 +966,19 @@ export class LiveStreamDVR {
}
}

// check for ts files in storage
const files = readdirRecursive(BaseConfigDataFolder.storage);
for (const file of files) {
if (file.endsWith(".ts")) {
errors.push(
`Found ts file in storage folder: ${path.join(
BaseConfigDataFolder.storage,
file
)}`
);
}
}

return errors;
}

Expand Down

0 comments on commit aeaba92

Please sign in to comment.