Skip to content

Commit

Permalink
fix: fallback to original url when transform failed (#255)
Browse files Browse the repository at this point in the history
* fix: fallback to original url when transform failed

* fix: lint
  • Loading branch information
MaikoTan authored Feb 15, 2025
1 parent 52b8331 commit e5b9779
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/core/src/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,9 @@ export function apply(ctx: Context, config: Config) {
}

if (config.asset && ctx.assets) {
url = await ctx.booru.imgUrlToAssetUrl(url)
if (!url) {
children.unshift(<i18n path='commands.booru.messages.no-image'></i18n>)
continue
}
url = (await ctx.booru.imgUrlToAssetUrl(url)) ?? url
} else if (config.base64) {
url = await ctx.booru.imgUrlToBase64(url)
if (!url) {
children.unshift(<i18n path='commands.booru.messages.no-image'></i18n>)
continue
}
url = (await ctx.booru.imgUrlToBase64(url)) ?? url
}
switch (config.output) {
case OutputType.All:
Expand Down

0 comments on commit e5b9779

Please sign in to comment.