From 2a2ece88a79df48bf19f8990ec58b4feb6e83ab7 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Tue, 27 Jun 2023 16:19:39 +0200 Subject: [PATCH] split tags --- rangement/index.mjs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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