feat: backend implementation for media manager v2 (WIP - Undeployed)
This commit is contained in:
@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user