return exif data in promise
This commit is contained in:
parent
4fa3c3d92d
commit
30c1189393
|
@ -64,28 +64,32 @@ async function guessFileNameOnAllFilesFromArguments () {
|
||||||
|
|
||||||
fileList.forEach(fileName => {
|
fileList.forEach(fileName => {
|
||||||
|
|
||||||
let structureForFile = finder.destructurateFileName(fileName)
|
let structureForFile = finder.destructurateFileName(fileName)
|
||||||
// examiner les infos exif de chaque fichier pour proposer un nouveau nom
|
// examiner les infos exif de chaque fichier pour proposer un nouveau nom
|
||||||
if (!structureForFile.dateStamp) {
|
if (!structureForFile.dateStamp) {
|
||||||
let foundDate = finder.findExifCreationDate(fileName)
|
let foundDate = finder.findExifCreationDate(fileName).then((data) => {
|
||||||
console.log(' =>>>>>>> foundDate : ', foundDate)
|
|
||||||
if (foundDate) {
|
|
||||||
structureForFile.dateStamp = (finder.findExifCreationDate(fileName) + '')
|
|
||||||
|
|
||||||
} else {
|
console.log(' =>>>>>>> foundDate : ', foundDate)
|
||||||
console.log(' pas de date trouvée dans le nom')
|
if (foundDate) {
|
||||||
|
structureForFile.dateStamp = finder.findExifCreationDate(fileName)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
console.log(' pas de date trouvée dans le nom')
|
||||||
|
}
|
||||||
|
let newname = makeFileNameFromProperties(structureForFile)
|
||||||
|
if (fileName !== newname) {
|
||||||
|
|
||||||
|
console.log(' nouveau nom:', newname)
|
||||||
|
} else {
|
||||||
|
console.log(' rien à changer')
|
||||||
|
}
|
||||||
|
|
||||||
|
}, (err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let newname = makeFileNameFromProperties(structureForFile)
|
)
|
||||||
if (fileName !== newname) {
|
|
||||||
|
|
||||||
console.log(' nouveau nom:', newname)
|
|
||||||
} else {
|
|
||||||
console.log(' rien à changer')
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue