fix imports in rangement
This commit is contained in:
parent
0cf6afa026
commit
64cfe271ca
@ -1,8 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* la classe qui repère des patterns
|
* la classe qui repère des patterns
|
||||||
*/
|
*/
|
||||||
import {tagSectionSeparator} from "./configs";
|
import {tagSectionSeparator} from "./configs.mjs";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* finds patterns for file name
|
||||||
|
*/
|
||||||
export default class finders{
|
export default class finders{
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import finders from './finders.mjs'
|
|||||||
// })
|
// })
|
||||||
import exifr from 'exifr'
|
import exifr from 'exifr'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import {tagSectionSeparator, tagSeparator} from "./configs";
|
import {tagSectionSeparator, tagSeparator} from "./configs.mjs";
|
||||||
|
|
||||||
const pathFolder = '/home/poule/encrypted/stockage-syncable/photos/a_dispatcher/tout'
|
const pathFolder = '/home/poule/encrypted/stockage-syncable/photos/a_dispatcher/tout'
|
||||||
const sortingFolder = '/home/poule/encrypted/stockage-syncable/photos/a_dispatcher'
|
const sortingFolder = '/home/poule/encrypted/stockage-syncable/photos/a_dispatcher'
|
||||||
@ -148,7 +148,7 @@ if (fileMixedNewName !== originalFileName) {
|
|||||||
function addTagInFileName(tagName, fileName) {
|
function addTagInFileName(tagName, fileName) {
|
||||||
|
|
||||||
let tags = findTagSectionInString(fileName)
|
let tags = findTagSectionInString(fileName)
|
||||||
let firstPart = findFileNameFreeTextPart(fileName)
|
let firstPart = finders.findFileNameFreeTextPart(fileName)
|
||||||
|
|
||||||
tags.push(tagName)
|
tags.push(tagName)
|
||||||
let uniqueArray = [...new Set(tags)]
|
let uniqueArray = [...new Set(tags)]
|
||||||
@ -168,7 +168,7 @@ const fileDefinition = {
|
|||||||
function destructurateFileName(fileName) {
|
function destructurateFileName(fileName) {
|
||||||
return {
|
return {
|
||||||
dateStamp: finders.findFormattedDate(fileName),
|
dateStamp: finders.findFormattedDate(fileName),
|
||||||
freeText: findFileNameFreeTextPart(fileName),
|
freeText: finders.findFileNameFreeTextPart(fileName),
|
||||||
tags: findTagSectionInString(fileName),
|
tags: findTagSectionInString(fileName),
|
||||||
extension: finders.findFileExtension(fileName),
|
extension: finders.findFileExtension(fileName),
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
// import finders from "./finders.mjs";
|
import finders from "./finders.mjs";
|
||||||
const finders = require('./finders.mjs')
|
// const finders = require('./finders.mjs')
|
||||||
|
|
||||||
describe('rangement file name', () => {
|
describe('rangement file name', () => {
|
||||||
|
|
||||||
test('detects date in file name', () => {
|
test('detects date in file name', () => {
|
||||||
expect(finders.findFormattedDate('2023-06-23T18.36.47 -- machin bidule.jpg')).toBe('2023-06-23T18.36.47');
|
expect(finders.findFormattedDate('2023-06-23T18.36.47 -- machin bidule.jpg')).toBe('2023-06-23T18.36.47');
|
||||||
});
|
});
|
||||||
|
test('detects file extension in file name', () => {
|
||||||
|
expect(finders.findFileExtension()('2023-06-23T18.36.47 -- machin bidule.jpg')).toBe('jpg');
|
||||||
|
});
|
||||||
})
|
})
|
||||||
console.log('finders', finders)
|
console.log('finders', finders)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user