add config class

This commit is contained in:
Tykayn 2023-07-01 13:20:11 +02:00 committed by tykayn
parent 36ebdf2714
commit 74ffae4a31
2 changed files with 28 additions and 15 deletions

View File

@ -1,20 +1,21 @@
export const config_rangement = { export default class config_rangement{
log_level :'debug', // [ 'debug', 'none'] log_level ='debug' // [ 'debug' 'none']
version : '1.0.0', version = '1.0.0'
tagSeparator : '1.0.0', tagSeparator = '1.0.0'
tagSectionSeparator : '1.0.0', tagSectionSeparator = '1.0.0'
enableTestsLocally: false, enableTestsLocally= false
reportStatistics: false, reportStatistics= false
base_archive_folder: '/home/poule/encrypted/stockage-syncable/', base_archive_folder= '/home/poule/encrypted/stockage-syncable/'
photos_sub_folder: 'photos', photos_sub_folder= 'photos'
photos_sorting_base_sub_folder: 'photos/a_dispatcher', photos_sorting_base_sub_folder= 'photos/a_dispatcher'
bazar_sub_folder: 'BAZAR', bazar_sub_folder= 'BAZAR'
templates : { panoramax_captures_folder= 'photos/imagerie kartaview carto tel/open camera'
templates = {
// example FyB8cZnWIAc21rw.jpg // example FyB8cZnWIAc21rw.jpg
'downloaded_pic': { 'downloaded_pic': {
'pattern' : /^\-\w{15}\.jpg/, 'pattern' : /^\-\w{15}\.jpg/,
'auto_sort_folder' : '' 'auto_sort_folder' : this.bazar_sub_folder
}, },
// example -4900281569878475578_1109.jpg // example -4900281569878475578_1109.jpg
'telegram_pic': { 'telegram_pic': {
@ -24,12 +25,12 @@ export const config_rangement = {
// example IMG_20230617_092120_3.jpg // example IMG_20230617_092120_3.jpg
'open_camera_default': { 'open_camera_default': {
'pattern' : /^IMG_\d{8}/i, 'pattern' : /^IMG_\d{8}/i,
'auto_sort_folder' : '' 'auto_sort_folder' : this.panoramax_captures_folder
}, },
// example IMG_OC_20230617_092120_3.jpg // example IMG_OC_20230617_092120_3.jpg
'open_camera_custom': { 'open_camera_custom': {
'pattern' : /^IMG_OC_\d{8}/i, 'pattern' : /^IMG_OC_\d{8}/i,
'auto_sort_folder' : '' 'auto_sort_folder' : this.panoramax_captures_folder
}, },
// example "Screenshot 2023-06-15 at 15-26-04 Instance Panoramax OSM-FR.png" // example "Screenshot 2023-06-15 at 15-26-04 Instance Panoramax OSM-FR.png"
'screenshot': { 'screenshot': {

12
create_folders.mjs Normal file
View File

@ -0,0 +1,12 @@
/**
handles creation of global hierarchy of folders from config file
*/
import config_rangement from './configs.mjs'
let my_conf = new config_rangement()
console.log('config', my_conf.version)
function createFoldersFromConfig(){
// TODO
}