mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-07 05:13:01 +00:00
Refactor R2 key prefix for deterministic identifiers
This commit is contained in:
1 parent
00b0e85438
commit
c02db755ac
6 files changed
+42
-12
No files matched your search
@@ -215,6 +215,11 @@ class S3UploadService {
|
||||
try {
|
||||
await ensureS3SdkLoaded();
|
||||
|
||||
const normalizedInfoHash = normalizeInfoHash(infoHash);
|
||||
const keyIdentifier = isValidInfoHash(normalizedInfoHash)
|
||||
? normalizedInfoHash
|
||||
: "";
|
||||
|
||||
const s3 = makeS3Client({
|
||||
endpoint: normalized.endpoint,
|
||||
region: normalized.region,
|
||||
@@ -223,7 +228,7 @@ class S3UploadService {
|
||||
forcePathStyle: Boolean(normalized.forcePathStyle),
|
||||
});
|
||||
|
||||
const key = forcedVideoKey || buildR2Key(npub, file);
|
||||
const key = forcedVideoKey || buildR2Key(npub, file, keyIdentifier);
|
||||
const publicUrl =
|
||||
forcedVideoUrl ||
|
||||
buildS3ObjectUrl({
|
||||
|
||||
Reference in new issue
Block a user