diff --git a/rangement/index.mjs b/rangement/index.mjs index 82fc521b..426d833e 100644 --- a/rangement/index.mjs +++ b/rangement/index.mjs @@ -38,7 +38,7 @@ function getExifCreationDate (filepath) { let moments = [] - console.log('exif data : ', exifData) // Do something with your data! + // console.log('exif data : ', exifData) // Do something with your data! if (exifData.DateTimeOriginal) { // console.log('image créée le : DateTimeOriginal : ', exifData.DateTimeOriginal) // Do something with your data! @@ -75,6 +75,19 @@ function getExifCreationDate (filepath) { } +const tagSeparator = ' ' +const tagSectionSeparator = '--' +function findTagSectionInString(inputString){ + let listOfTags = [] + if(inputString.includes(tagSectionSeparator)){ + let boom = inputString.splice(tagSectionSeparator) + if(boom.length){ + listOfTags = [...boom.splice(tagSeparator)] + } + } + return listOfTags; +} + /** * écrit un nouveau nom de fichier formatté * @param convertedToName @@ -123,4 +136,5 @@ const patternsFiles = { } -getExifCreationDate('/home/poule/encrypted/stockage-syncable/photos/a_dispatcher/2023-06-23T18.36.47.jpg') +// getExifCreationDate('/home/poule/encrypted/stockage-syncable/photos/a_dispatcher/2023-06-23T18.36.47 -- machin bidule.jpg') +findTagSectionInString('2023-06-23T18.36.47 -- machin bidule.jpg') \ No newline at end of file