Skip to content

Commit

Permalink
check for channel capturing when finding stale ts files
Browse files Browse the repository at this point in the history
related to #485
  • Loading branch information
MrBrax committed Jan 22, 2024
1 parent 5c8e3fd commit 811f06e
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions server/src/Core/LiveStreamDVR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -967,16 +967,20 @@ 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
)}`
);
}
for (const channel of this.getInstance().getChannels()) {
if ( channel.is_capturing ) continue; // skip currently capturing channels
const basePath = channel.getFolder();
const files = readdirRecursive(basePath);
for (const file of files) {
if (file.endsWith(".ts")) {
errors.push(
`Found ts file in channel folder: ${path.join(
basePath,
file
)}`
);
}
}
}

return errors;
Expand Down

0 comments on commit 811f06e

Please sign in to comment.