Refactor Media Manager sync logic and fix duplication bugs
This major refactor addresses improper image matching and duplication: - Implemented strict ID-based matching in 'MediaService', removing the greedy filename matching fallback. - Redesigned synchronization pipeline to treat Google Drive as the Source of Truth, supporting orphan adoption (Shopify -> Drive) and secure uploads. - Implemented 'gallery_order' using Drive file properties (supporting both v2 and v3 APIs) for stable, drag-and-drop global ordering. - Added conditional file renaming using timestamps to enforce '_' naming convention without unnecessary renames. - Fixed runtime errors in 'MediaService' loops and updated 'ShopifyMediaService' GraphQL mutations to match correctly schema. - Rewrote 'MediaService.test.ts' with robust test cases for strict matching, adoption, sorting, and reordering.
This commit is contained in:
@ -889,6 +889,11 @@ export class Shop implements IShop {
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
||||
getShopDomain(): string {
|
||||
// Extract from https://{shop}.myshopify.com
|
||||
return this.shopifyApiURI.replace('https://', '').replace(/\/$/, '');
|
||||
}
|
||||
}
|
||||
|
||||
export class Order {
|
||||
|
||||
Reference in New Issue
Block a user