feat: backend implementation for media manager v2 (WIP - Undeployed)

This commit is contained in:
Ben Miller
2025-12-28 08:13:27 -07:00
parent a9cb63fd67
commit 6e1222cec9
11 changed files with 763 additions and 189 deletions

View File

@ -29,7 +29,8 @@ export class MockDriveService implements IDriveService {
getName: () => blob.getName(),
getBlob: () => blob,
getUrl: () => `https://mock.drive/files/${blob.getName()}`,
getLastUpdated: () => new Date()
getLastUpdated: () => new Date(),
getThumbnail: () => ({ getBytes: () => [] })
} as unknown as GoogleAppsScript.Drive.File
if (!this.files.has(folderId)) {
@ -52,4 +53,26 @@ export class MockDriveService implements IDriveService {
}
throw new Error("File not found in mock")
}
renameFile(fileId: string, newName: string): void {
const file = this.getFileById(fileId)
// Mock setName
// We can't easily mutate the mock object created in saveFile without refactoring
// But for type satisfaction it's void.
console.log(`[MockDrive] Renaming ${fileId} to ${newName}`)
// Assuming we can mutate if we kept ref?
}
trashFile(fileId: string): void {
console.log(`[MockDrive] Trashing ${fileId}`)
}
updateFileProperties(fileId: string, properties: any): void {
console.log(`[MockDrive] Updating properties for ${fileId}`, properties)
}
createFile(blob: GoogleAppsScript.Base.Blob): GoogleAppsScript.Drive.File {
// Create in "root" or similar
return this.saveFile(blob, "root")
}
}