|
@@ -75,6 +75,18 @@ export class ImageUrlBuilderService {
|
|
|
return key;
|
|
return key;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ getBaseUrl(imgSource: 'LOCAL_ONLY' | 'S3_ONLY' | 'S3_AND_LOCAL'): string {
|
|
|
|
|
+ switch (imgSource) {
|
|
|
|
|
+ case 'S3_ONLY':
|
|
|
|
|
+ return this.s3BaseUrl;
|
|
|
|
|
+ case 'S3_AND_LOCAL':
|
|
|
|
|
+ return this.s3BaseUrl;
|
|
|
|
|
+ case 'LOCAL_ONLY':
|
|
|
|
|
+ default:
|
|
|
|
|
+ return this.localBaseUrl;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// helpers
|
|
// helpers
|
|
|
private normalizeBaseUrl(url: string, configKey: string): string {
|
|
private normalizeBaseUrl(url: string, configKey: string): string {
|
|
|
const trimmed = url.trim().replace(/\/+$/, '');
|
|
const trimmed = url.trim().replace(/\/+$/, '');
|