From 2939d91092739c85539a4c92378ec25ec7d27ec0 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sun, 21 Mar 2021 12:10:56 +1100 Subject: [PATCH] now using SymlinkName everywhere --- pa_job_manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pa_job_manager.py b/pa_job_manager.py index bcffc5a..225cbf3 100644 --- a/pa_job_manager.py +++ b/pa_job_manager.py @@ -429,7 +429,7 @@ def JobForceScan(job): # to serve static content of the images, we create a symlink from inside the static subdir of each import_path that exists def CreateSymlink(job,path): - symlink='static/{}'.format(os.path.basename(path[0:-1])) + symlink=SymlinkName(path, path) if not os.path.exists(symlink): os.symlink(path, symlink) return symlink @@ -762,7 +762,7 @@ def ProcessFilesInDir(job, e, file_func): def JobGetFileDetails(job): JobProgressState( job, "In Progress" ) path=[jex.value for jex in job.extra if jex.name == "path"][0] - path='static'+'/'+os.path.basename(path[0:-1]) + path=SymlinkName( path, path ) if DEBUG==1: print("DEBUG: JobGetFileDetails for path={}".format( path ) ) dir=session.query(Dir).filter(Dir.path_prefix==path).first() @@ -847,7 +847,7 @@ def GenVideoThumbnail(job, file): def CheckForDups(job): path=[jex.value for jex in job.extra if jex.name == "path"][0] - path='static'+'/'+os.path.basename(path[0:-1]) + path=SymlinkName( path, path ) AddLogForJob( job, f"Check for duplicates in import path: {path}" ) res = session.execute( f"select count(e1.name) as count from entry e1, file f1, dir d1, entry_dir_link edl1, entry e2, file f2, dir d2, entry_dir_link edl2 where e1.id = f1.eid and e2.id = f2.eid and d1.eid = edl1.dir_eid and edl1.entry_id = e1.id and edl2.dir_eid = d2.eid and edl2.entry_id = e2.id and d1.path_prefix like '%{path}%' and f1.hash = f2.hash and e1.id != e2.id" )