feat: Add custom video thumbnails for Drive uploads
- Implemented custom thumbnail injection in GASDriveService.getResumableUploadUrl. - Fetches thumbnails from Google Photos using w320 size to avoid API limits. - Added strict < 2MB size check for thumbnails. - Updated mediaHandlers and MediaManager to pass sourceUrl to the backend. - This allows Drive to display a visual cue immediately for video files still processing.
This commit is contained in:
@ -128,7 +128,7 @@ export function linkDriveFileToShopifyMedia(sku: string, driveId: string, shopif
|
||||
}
|
||||
|
||||
// NEW: Resumable Upload Ticket
|
||||
export function getUploadUrl(sku: string, filename: string, mimeType: string) {
|
||||
export function getUploadUrl(sku: string, filename: string, mimeType: string, sourceUrl?: string) {
|
||||
const config = new Config()
|
||||
const driveService = new GASDriveService()
|
||||
|
||||
@ -136,7 +136,7 @@ export function getUploadUrl(sku: string, filename: string, mimeType: string) {
|
||||
const folder = driveService.getOrCreateFolder(sku, config.productPhotosFolderId)
|
||||
|
||||
// Generate Ticket
|
||||
return driveService.getResumableUploadUrl(filename, mimeType, folder.getId())
|
||||
return driveService.getResumableUploadUrl(filename, mimeType, folder.getId(), sourceUrl)
|
||||
}
|
||||
|
||||
// Deprecated (but kept for fallback/legacy small files if needed)
|
||||
|
||||
Reference in New Issue
Block a user