Name uploaded and downloaded files J-<id>.<ext>
Files added through the upload pipeline and Download to Library are renamed to their J-ID right after indexing, so every new library file is traceable by its identifier (scanned files keep their existing names). index_file now returns the created location so callers can rename it; the location record is updated to the new path.
This commit is contained in:
@@ -67,7 +67,9 @@ class Command(BaseCommand):
|
||||
continue
|
||||
path = Path(root) / name
|
||||
try:
|
||||
item, created_item, created_location = index_file(path, folder)
|
||||
item, created_item, _location, created_location = index_file(
|
||||
path, folder
|
||||
)
|
||||
except OSError as exc:
|
||||
skipped += 1
|
||||
self.stderr.write(f"Skipped {path}: {exc}")
|
||||
|
||||
Reference in New Issue
Block a user