Fix Drive video upload to Shopify
- Detect video mime types in MediaService to set correct resource ('VIDEO') and mediaContentType.
- Add fileSize to stagedUploadsCreate payload as required by Shopify for videos.
- Add safety check for missing upload targets to prevent crashes.
- Implement getSize in MockDriveService.
- Add unit test in MediaService.test.ts to verify correct resource and fileSize handling for video uploads.
- Update mock in mediaManager.integration.test.ts to support getSize().
This commit is contained in:
@ -52,6 +52,7 @@ export class MockDriveService implements IDriveService {
|
||||
getThumbnail: () => ({ getBytes: () => [] }),
|
||||
getMimeType: () => (blob as any).getContentType ? (blob as any).getContentType() : "image/jpeg",
|
||||
getDownloadUrl: () => `https://drive.google.com/uc?export=download&id=${id}`,
|
||||
getSize: () => blob.getBytes ? blob.getBytes().length : 0,
|
||||
getAppProperty: (key) => {
|
||||
return (newFile as any)._properties?.[key]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user