@bytebrand/export-cars 1.26.3 → 1.26.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -85,6 +85,8 @@ export class ImagesService {
|
|
|
85
85
|
'https://images.auto.de/carimage/noimage/pFyfBsqBHEso/large-cached.jpeg',
|
|
86
86
|
];
|
|
87
87
|
|
|
88
|
+
private hasLoggedMarketingImageDebug = false;
|
|
89
|
+
|
|
88
90
|
constructor(private readonly configService: ConfigService, private readonly userService: UserService) { }
|
|
89
91
|
|
|
90
92
|
async getImages(car: DataSchemes.Car, images: ImboImageResponseInterface[], imageType: ImageType, ignoreDefImages: boolean): Promise<Array<string>> {
|
|
@@ -176,8 +178,6 @@ export class ImagesService {
|
|
|
176
178
|
}
|
|
177
179
|
|
|
178
180
|
async getMarketingImages(carId: string, images: ImboImageResponseInterface[], ignoreDefImages: boolean): Promise<string[]> {
|
|
179
|
-
const imageUrl = this.configService.config.marketingImageUrl;
|
|
180
|
-
|
|
181
181
|
const transformedImages = this.transformImagesArrayIntoObject(images);
|
|
182
182
|
// fbMarketingImageId is a hardcoded per-environment id in config.ts and has drifted from
|
|
183
183
|
// the real meta_aia config at least once (dev's id pointed at a stale, never-populated "fb"
|
|
@@ -191,8 +191,27 @@ export class ImagesService {
|
|
|
191
191
|
return ignoreDefImages ? [] : [...this.DEFAULT_IMAGES];
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
+
// marketingImageUrl (config.ts environmentConfig[env].imageUrl) points at /cache_test on
|
|
195
|
+
// dev — a leftover from the old "fb" channel, not where image-generator publishes meta_aia
|
|
196
|
+
// composites (always under /generated_images on both dev and prod). Build the meta_aia base
|
|
197
|
+
// from the plain image host instead of trusting that per-env path.
|
|
198
|
+
const imageUrl = config.channelCode === 'meta_aia'
|
|
199
|
+
? `${this.configService.config.imageUrl}/generated_images`
|
|
200
|
+
: this.configService.config.marketingImageUrl;
|
|
201
|
+
|
|
194
202
|
const marketingImageConfigs = config.marketingImages.map(i => ({ marketingImageCodes: i.imageCodes }));
|
|
195
203
|
|
|
204
|
+
if (this.configService.config.exportType === ExportType.FB && !this.hasLoggedMarketingImageDebug) {
|
|
205
|
+
this.hasLoggedMarketingImageDebug = true;
|
|
206
|
+
console.log(
|
|
207
|
+
'getMarketingImages debug —',
|
|
208
|
+
'config.id:', config.id,
|
|
209
|
+
'config.channelCode:', config.channelCode,
|
|
210
|
+
'requested imageCodes per slot:', JSON.stringify(marketingImageConfigs.map(c => c.marketingImageCodes)),
|
|
211
|
+
'photo codes available on this car:', JSON.stringify(Object.keys(transformedImages)),
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
196
215
|
const imageWithUrls: Partial<ImboImageResponseInterface & { url: string }>[] = [];
|
|
197
216
|
for (let i = 0; i < marketingImageConfigs.length; i++) {
|
|
198
217
|
const marketingImage = marketingImageConfigs[i];
|