mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-13 01:10:27 -07:00
Add logging if file size does not match
This commit is contained in:
parent
d949b203e5
commit
949e4cfa9a
2 changed files with 18 additions and 0 deletions
|
|
@ -75,6 +75,11 @@ export const moveFileAndValidate = async ({
|
|||
}
|
||||
|
||||
if (!res1 || inputSize !== outputSize) {
|
||||
if (inputSize !== outputSize) {
|
||||
args.jobLog(`File sizes do not match, input: ${inputSize} `
|
||||
+ `does not equal output: ${outputSize}`);
|
||||
}
|
||||
|
||||
args.jobLog(`Attempt 1 failed: Moving file from ${inputPath} to ${outputPath}`);
|
||||
args.jobLog(`Attempt 2: Moving file from ${inputPath} to ${outputPath}`);
|
||||
|
||||
|
|
@ -92,6 +97,11 @@ export const moveFileAndValidate = async ({
|
|||
outputSize = await getFileSize(outputPath);
|
||||
|
||||
if (!res2 || inputSize !== outputSize) {
|
||||
if (inputSize !== outputSize) {
|
||||
args.jobLog(`File sizes do not match, input: ${inputSize} `
|
||||
+ `does not equal output: ${outputSize}`);
|
||||
}
|
||||
|
||||
const errMessage = `Failed to move file from ${inputPath} to ${outputPath}, check errors above`;
|
||||
args.jobLog(errMessage);
|
||||
throw new Error(errMessage);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue