split tags

This commit is contained in:
Tykayn 2023-06-27 16:19:39 +02:00 committed by tykayn
parent 98487704f3
commit 2a2ece88a7
1 changed files with 16 additions and 2 deletions

View File

@ -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')