Skip to content

Commit

Permalink
update local
Browse files Browse the repository at this point in the history
  • Loading branch information
Xziy committed May 1, 2024
1 parent 16d9461 commit 685eab5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion adapters/mediafile/default/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ class LocalMediaFileAdapter extends MediaFileAdapter_1.default {
};
const cfg = { ...baseConfig, ...config };
const isFilePath = url.match(/\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/gim);
const mediafileExtension = isFilePath.length > 0 ? isFilePath[0].replace('.', '') : '';
let mediafileExtension = '';
if (isFilePath && isFilePath.length > 0) {
isFilePath[0].replace('.', '');
}
const origin = this.getNameByUrl(url, mediafileExtension);
const name = {
origin: origin,
Expand Down
7 changes: 6 additions & 1 deletion adapters/mediafile/default/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ export default class LocalMediaFileAdapter extends MediaFileAdapter {
const cfg = { ...baseConfig, ...config } as unknown as MediaFileConfigInner;

const isFilePath = url.match(/\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/gim)
const mediafileExtension = isFilePath.length > 0 ? isFilePath[0].replace('.', '') : '';
let mediafileExtension = ''

if(isFilePath && isFilePath.length > 0) {
isFilePath[0].replace('.', '')
}

const origin = this.getNameByUrl(url, mediafileExtension);

const name = {
Expand Down

0 comments on commit 685eab5

Please sign in to comment.