d
This commit is contained in:
@@ -2736,6 +2736,12 @@ def register_url_with_local_library(
|
||||
if not storage_path:
|
||||
return False
|
||||
|
||||
# Optimization: Don't open DB if file isn't in library root
|
||||
try:
|
||||
path_obj.resolve().relative_to(Path(storage_path).resolve())
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
with API_folder_store(storage_path) as db:
|
||||
file_hash = db.get_file_hash(path_obj)
|
||||
if not file_hash:
|
||||
|
||||
Reference in New Issue
Block a user