converted over to a flat settings table, no more key-value pairs of settings

This commit is contained in:
2021-01-12 18:32:47 +11:00
parent 86c7fbd0be
commit e83a40ee52
4 changed files with 47 additions and 68 deletions

View File

@@ -97,10 +97,9 @@ class FileData():
# multiple valid paths in import_path) #
##############################################################################
def GenerateFileData(self):
import_path = Settings.query.filter(Settings.name=="import_path").all()[0].value
last_import_date_obj = Settings.query.filter(Settings.name=="last_import_date").all()
last_import_date = float(last_import_date_obj[0].value)
paths= import_path.split("#")
settings = Settings.query.all()
last_import_date = settings[0].last_import_date
paths = settings[0].import_path.split("#")
for path in paths:
print( "GenerateFileData: Checking {}".format( path ) )
@@ -144,7 +143,7 @@ class FileData():
db.session.add(file_obj)
else:
print( "{} - {} is OLDER than {}".format( file, stat.st_ctime, last_import_date ) )
last_import_date_obj[0].value = str(time.time())
settings[0].last_import_date = time.time()
db.session.commit()
self.view_list = Files.query.all()
return self