new fix for path shenanigans... python deals with it anyway, so just leave it "linux" pathed for simplicity
This commit is contained in:
@@ -300,20 +300,20 @@ def JobForceScan(job):
|
|||||||
|
|
||||||
def SymlinkName(path, file):
|
def SymlinkName(path, file):
|
||||||
sig_bit=file.replace(path, "")
|
sig_bit=file.replace(path, "")
|
||||||
last_dir=format( os.path.basename(path[0:-1]))
|
last_dir=os.path.basename(path[0:-1])
|
||||||
|
|
||||||
if sig_bit[-1] == os.path.sep:
|
if sig_bit[-1] == os.path.sep:
|
||||||
last_bit = os.path.dirname(sig_bit)[0:-1]
|
last_bit = os.path.dirname(sig_bit)[0:-1]
|
||||||
else:
|
else:
|
||||||
last_bit = os.path.dirname(sig_bit)
|
last_bit = os.path.dirname(sig_bit)
|
||||||
symlink = os.path.join('static', last_dir, last_bit )
|
symlink = 'static'+'/'+last_dir+'/'+last_bit
|
||||||
if symlink[-1] == os.path.sep:
|
if symlink[-1] == os.path.sep:
|
||||||
symlink=symlink[0:-1]
|
symlink=symlink[0:-1]
|
||||||
return symlink
|
return symlink
|
||||||
|
|
||||||
# to serve static content of the images, we create a symlink from inside the static subdir of each import_path that exists
|
# 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):
|
def CreateSymlink(job,path):
|
||||||
symlink=os.path.join('static', os.path.basename(path[0:-1]))
|
symlink='static/{}'.format(os.path.basename(path[0:-1]))
|
||||||
if not os.path.exists(symlink):
|
if not os.path.exists(symlink):
|
||||||
os.symlink(path, symlink)
|
os.symlink(path, symlink)
|
||||||
return symlink
|
return symlink
|
||||||
@@ -395,7 +395,7 @@ def JobImportDir(job):
|
|||||||
AddLogForJob(job, "DEBUG: {} - {} is newer than {}".format( file, stat.st_ctime, keep_dirs[dirname].last_import_date ), file )
|
AddLogForJob(job, "DEBUG: {} - {} is newer than {}".format( file, stat.st_ctime, keep_dirs[dirname].last_import_date ), file )
|
||||||
print("DEBUG: {} - {} is newer than {}".format( file, stat.st_ctime, keep_dirs[dirname].last_import_date ) )
|
print("DEBUG: {} - {} is newer than {}".format( file, stat.st_ctime, keep_dirs[dirname].last_import_date ) )
|
||||||
if os.path.isdir(file):
|
if os.path.isdir(file):
|
||||||
path_prefix=os.path.join(symlink,fname)
|
path_prefix=symlink+'/'+fname
|
||||||
dir=AddDir( job, fname, path_prefix, dir )
|
dir=AddDir( job, fname, path_prefix, dir )
|
||||||
fcnt[path_prefix]=0
|
fcnt[path_prefix]=0
|
||||||
keep_dirs[dir.path_prefix]=dir
|
keep_dirs[dir.path_prefix]=dir
|
||||||
@@ -439,11 +439,11 @@ def ProcessFilesInDir(job, e):
|
|||||||
if DEBUG==1:
|
if DEBUG==1:
|
||||||
print("DEBUG: files in dir - process: {}".format(e.name))
|
print("DEBUG: files in dir - process: {}".format(e.name))
|
||||||
if e.type.name != 'Directory':
|
if e.type.name != 'Directory':
|
||||||
e.file_details[0].hash = md5( job, os.path.join( e.in_dir[0].path_prefix, e.name ) )
|
e.file_details[0].hash = md5( job, e.in_dir[0].path_prefix+'/'+ e.name )
|
||||||
if e.type.name == 'Image':
|
if e.type.name == 'Image':
|
||||||
e.file_details[0].thumbnail = GenImageThumbnail( job, os.path.join( e.in_dir[0].path_prefix, e.name ) )
|
e.file_details[0].thumbnail = GenImageThumbnail( job, e.in_dir[0].path_prefix+'/'+ e.name )
|
||||||
elif e.type.name == 'Video':
|
elif e.type.name == 'Video':
|
||||||
e.file_details[0].thumbnail = GenVideoThumbnail( job, os.path.join( e.in_dir[0].path_prefix, e.name ) )
|
e.file_details[0].thumbnail = GenVideoThumbnail( job, e.in_dir[0].path_prefix+'/'+ e.name )
|
||||||
else:
|
else:
|
||||||
dir=session.query(Dir).filter(Dir.eid==e.id).first()
|
dir=session.query(Dir).filter(Dir.eid==e.id).first()
|
||||||
stat = os.stat( dir.path_prefix )
|
stat = os.stat( dir.path_prefix )
|
||||||
@@ -464,7 +464,7 @@ def JobGetFileDetails(job):
|
|||||||
for jex in job.extra:
|
for jex in job.extra:
|
||||||
if jex.name =="path":
|
if jex.name =="path":
|
||||||
path=jex.value
|
path=jex.value
|
||||||
path=os.path.join('static', os.path.basename(path[0:-1]))
|
path='static'+'/'+os.path.basename(path[0:-1])
|
||||||
if DEBUG==1:
|
if DEBUG==1:
|
||||||
print("DEBUG: JobGetFileDetails for path={}".format( path ) )
|
print("DEBUG: JobGetFileDetails for path={}".format( path ) )
|
||||||
dir=session.query(Dir).filter(Dir.path_prefix==path).first()
|
dir=session.query(Dir).filter(Dir.path_prefix==path).first()
|
||||||
|
|||||||
Reference in New Issue
Block a user