mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-17 11:16:26 -07:00
Handle error
This commit is contained in:
parent
f3937b9f0c
commit
5158943290
1 changed files with 7 additions and 4 deletions
|
|
@ -60,17 +60,20 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
|
||||||
try {
|
try {
|
||||||
log('Changing date...');
|
log('Changing date...');
|
||||||
|
|
||||||
|
const { mtimeMs } = otherArguments.originalLibraryFile.statSync;
|
||||||
if (os.platform() === 'win32') {
|
if (os.platform() === 'win32') {
|
||||||
fs.utimes(
|
fs.utimes(
|
||||||
file._id,
|
file._id,
|
||||||
new Date().getTime() / 1000,
|
new Date().getTime() / 1000,
|
||||||
otherArguments.originalLibraryFile.statSync.mtimeMs / 1000,
|
mtimeMs / 1000,
|
||||||
() => {
|
(err) => {
|
||||||
log('Error updating modified date');
|
if (err) {
|
||||||
|
log('Error updating modified date');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
touch.sync(file._id, { mtimeMs: otherArguments.originalLibraryFile.statSync.mtimeMs, force: true });
|
touch.sync(file._id, { mtimeMs, force: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
log('Done.');
|
log('Done.');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue