Add UI for already converted outfit URLs
When the outfit image URL is already converted, we show a happy no-change message!
This commit is contained in:
parent
1865d62945
commit
9191a5a65a
1 changed files with 9 additions and 0 deletions
|
@ -401,6 +401,7 @@ function BulkImageConverter() {
|
||||||
const S3_OUTFIT_URL_EXACT_PATTERN = /^https?:\/\/openneo-uploads\.s3\.amazonaws\.com\/outfits\/([0-9]{3})\/([0-9]{3})\/([0-9]{3})\/(preview|medium_preview|small_preview)\.png$/;
|
const S3_OUTFIT_URL_EXACT_PATTERN = /^https?:\/\/openneo-uploads\.s3\.amazonaws\.com\/outfits\/([0-9]{3})\/([0-9]{3})\/([0-9]{3})\/(preview|medium_preview|small_preview)\.png$/;
|
||||||
const S3_OUTFIT_URL_GLOBAL_PATTERN = /https?:\/\/openneo-uploads\.s3\.amazonaws\.com\/outfits\/([0-9]{3})\/([0-9]{3})\/([0-9]{3})\/(preview|medium_preview|small_preview)\.png/g;
|
const S3_OUTFIT_URL_GLOBAL_PATTERN = /https?:\/\/openneo-uploads\.s3\.amazonaws\.com\/outfits\/([0-9]{3})\/([0-9]{3})\/([0-9]{3})\/(preview|medium_preview|small_preview)\.png/g;
|
||||||
const OUTFIT_PAGE_URL_EXACT_PATTERN = /^https?:\/\/impress(-2020)?\.openneo\.net\/outfits\/([0-9]+)(\?.*)?$/;
|
const OUTFIT_PAGE_URL_EXACT_PATTERN = /^https?:\/\/impress(-2020)?\.openneo\.net\/outfits\/([0-9]+)(\?.*)?$/;
|
||||||
|
const CONVERTED_OUTFIT_URL_EXACT_PATTERN = /^https?:\/\/impress-outfit-images\.openneo\.net\/outfits\/([0-9]+)\/(150|300|600)\.png$/;
|
||||||
const S3_FILENAMES_TO_SIZES = {
|
const S3_FILENAMES_TO_SIZES = {
|
||||||
preview: 600,
|
preview: 600,
|
||||||
medium_preview: 300,
|
medium_preview: 300,
|
||||||
|
@ -420,6 +421,14 @@ function parseS3OutfitUrl(url) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const convertedImageMatch = url.match(CONVERTED_OUTFIT_URL_EXACT_PATTERN);
|
||||||
|
if (convertedImageMatch) {
|
||||||
|
throw new UrlAlreadyConvertedError(
|
||||||
|
`This URL is already in the new format!`,
|
||||||
|
convertedImageMatch[1]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const match = url.match(S3_OUTFIT_URL_EXACT_PATTERN);
|
const match = url.match(S3_OUTFIT_URL_EXACT_PATTERN);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|
Loading…
Reference in a new issue