Skip to content

Commit 1b21915

Browse files
committed
bug fixes
1 parent e0c3951 commit 1b21915

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

portal/src/file-explorer/ThumbnailComponent.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,14 @@ export class ThumbnailComponent extends Component<{ fileId: number; mediaType: s
9494
throw new Error("TODO: implement me");
9595

9696
versions = response.data;
97-
const thumbs = versions.Values().Filter(x => x.title.startsWith("thumb_")).Map(x => {
97+
const thumbs = versions.Values().Filter(x => x.title.startsWith("thumb_") || x.title === "thumb").Map(x => {
98+
if(x.title === "thumb")
99+
{
100+
return {
101+
version: x,
102+
t: 0
103+
};
104+
}
98105
return {
99106
version: x,
100107
t: parseInt(x.title.substring("thumb_".length))

service/src/services/FileUploadService.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,21 +148,28 @@ export class FileUploadService
148148
{
149149
const blockId = await this.blobsController.FindBlobBlock(blobBlock.byteLength, sha256sum);
150150
if(blockId !== undefined)
151+
{
152+
console.log("found");
151153
return blockId;
154+
}
152155

153156
let newBlockId;
154157
try
155158
{
156159
newBlockId = await this.blobsController.AddBlobBlock(blobBlock.byteLength, sha256sum);
160+
console.log("added blob block", newBlockId, blobBlock.byteLength, sha256sum);
157161
}
158162
catch(e: any)
159163
{
164+
console.log("error", e);
160165
if(e?.code === "ER_DUP_ENTRY")
161166
return await this.ProcessBlobBlockHashed(blobBlock, sha256sum);
162167
throw e;
163168
}
169+
console.log("adding", newBlockId);
164170
const storageBlock = await this.storageBackendsManager.StoreBlobBlock(blobBlock);
165171
await this.blobsController.AddBlobBlockStorage(newBlockId, storageBlock.id, storageBlock.offset);
172+
console.log("added", newBlockId, storageBlock.id, storageBlock.offset);
166173

167174
return newBlockId;
168175
}

0 commit comments

Comments
 (0)