Skip to content

Commit

Permalink
Add secondary base url for assets that Uploadcare recommends
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadxali committed Oct 9, 2024
1 parent 979a94e commit 04bf4cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/core/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const ASSETS_CDN_URL = 'https://cdn.uc.assets.prezly.com';
export const ASSETS_SECONDARY_CDN_URL = 'https://ucarecdn.com';
export const DEFAULT_PAGE_SIZE = 12;
export const DEFAULT_GALLERY_PAGE_SIZE = 6;
export const OG_IMAGE_API_URL = 'https://og.prezly.com/api/og';
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/galleries.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { NewsroomGallery, UploadedImage } from '@prezly/sdk';

import { ASSETS_CDN_URL } from './constants';
import { ASSETS_SECONDARY_CDN_URL } from './constants';

export function isEmpty(
gallery: Pick<NewsroomGallery, 'images_number' | 'videos_number'>,
Expand Down Expand Up @@ -36,5 +36,5 @@ export function getArchiveDownloadUrl(
// Uploadcare doesn't like slashes in filenames even in encoded form.
const filename = encodeURIComponent(title.replace(/\//g, '_'));

return `${ASSETS_CDN_URL}/${uuid}/archive/zip/${filename}.zip`;
return `${ASSETS_SECONDARY_CDN_URL}/${uuid}/archive/zip/${filename}.zip`;
}

0 comments on commit 04bf4cb

Please sign in to comment.