From e88493c58e9f7e9f6b4a9a1de05384aaef0494d6 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Sun, 10 Sep 2023 11:29:25 +0200 Subject: [PATCH] hop --- index.ts | 2 -- utils/finder.ts | 34 ++++++++++++++++++++++++---------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/index.ts b/index.ts index 15319fa..a6f8766 100644 --- a/index.ts +++ b/index.ts @@ -16,8 +16,6 @@ import * as path from 'node:path' import rangement_instance from './conf/configs' import finder from './utils/finder' -let mini_arguments -let expandedFileList = [] log.setLevel(rangement_instance.log_level) log.info(' ') diff --git a/utils/finder.ts b/utils/finder.ts index d649eb9..b7670a8 100644 --- a/utils/finder.ts +++ b/utils/finder.ts @@ -185,9 +185,7 @@ export default class finder { if (rangement_instance.reportStatistics || this.mini_arguments.stats) { finder.reportStatistics() - } - - } + } } static makeFileNameFromProperties(fileProperties: fileDestructuration) { @@ -198,9 +196,13 @@ export default class finder { tagPlace = ' ' + rangement_instance.tagSectionSeparator + ' ' + fileProperties.tags.join(rangement_instance.tagSeparator) } log.debug('fileProperties.dateStampExif', fileProperties.dateStampExif) + let spacer = ''; + if(fileProperties.dateStampExif && fileProperties.freeText && rangement_instance.keepFreeText){ + spacer = ' ' + } let newName = '' + fileProperties.dateStampExif - // + ' ' + + spacer + (rangement_instance.keepFreeText ? fileProperties.freeText : '') + tagPlace.trim() + fileProperties.extension.trim() @@ -462,31 +464,43 @@ export default class finder { let moments = [] - log.debug(' finder - exif data : ', exifData) // Do something with your data! + console.log(' finder - exif data : ', exifData) + log.info(' finder - exif data : ', exifData) if (exifData.DateTimeOriginal) { - log.debug(' finder - image créée le : DateTimeOriginal : ', exifData.DateTimeOriginal) // Do something with your data! + log.debug(' finder - image créée le : DateTimeOriginal : ', exifData.DateTimeOriginal) moments.push(exifData.DateTimeOriginal) } + if (exifData.FileModificationDateTime) { + log.debug(' finder - image créée le : File Modification Date/Time : ', exifData.FileModificationDateTime) + moments.push(exifData.FileModificationDateTime) + } + if (exifData.FileModificationDate) { + log.debug(' finder - image créée le : File Modification Date/Time : ', exifData.FileModificationDate) + moments.push(exifData.FileModificationDate) + } if (exifData.ModificationDateTime) { - log.debug(' finder - image créée le : ModificationDateTime : ', exifData.ModificationDateTime) // Do something with your data! + log.debug(' finder - image créée le : ModificationDateTime : ', exifData.ModificationDateTime) moments.push(exifData.ModificationDateTime) } if (exifData.ModifyDate) { - log.debug(' finder - image créée le : ModifyDate : ', exifData.ModifyDate) // Do something with your data! + log.debug(' finder - image créée le : ModifyDate : ', exifData.ModifyDate) moments.push(exifData.ModifyDate) } if (exifData.FileAccessDateTime) { moments.push(exifData.FileAccessDateTime) } + if (exifData.DateTime) { + moments.push(exifData.DateTime) + } if (exifData.FileInodeChangeDateTime) { moments.push(exifData.FileInodeChangeDateTime) } if (exifData.FileModificationDateTime) { - log.debug(' finder - image créée le : FileModificationDateTime : ', exifData.FileModificationDateTime) // Do something with your data! + log.debug(' finder - image créée le : FileModificationDateTime : ', exifData.FileModificationDateTime) moments.push(exifData.FileModificationDateTime) } if (exifData.CreateDate) { - log.debug(' finder - image créée le : CreateDate : ', exifData.CreateDate) // Do something with your data! + log.debug(' finder - image créée le : CreateDate : ', exifData.CreateDate) moments.push(exifData.CreateDate) }