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:
2026-09-17 11:56:01 -05:00
parent d4f5df2e4e
commit bf00cf36a2
4 changed files with 29 additions and 6 deletions
@@ -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}")