mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-24 09:13:50 +02:00
feat: Limit bio display height(#1158), Toggle for display of age gated instances(#1188), fix: (#1189)(#1192) (#1195)
This commit is contained in:
@@ -402,5 +402,24 @@ export default {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
convertFileUrlToImageUrl(url, resolution = 128) {
|
||||
/**
|
||||
* possible patterns?
|
||||
* /file/file_fileId/version
|
||||
* /file/file_fileId/version/
|
||||
* /file/file_fileId/version/file
|
||||
* /file/file_fileId/version/file/
|
||||
*/
|
||||
const pattern = /file\/file_([a-f0-9-]+)\/(\d+)(\/file)?\/?$/;
|
||||
const match = url.match(pattern);
|
||||
|
||||
if (match) {
|
||||
const fileId = match[1];
|
||||
const version = match[2];
|
||||
return `https://api.vrchat.cloud/api/1/image/file_${fileId}/${version}/${resolution}`;
|
||||
}
|
||||
// no match return origin url
|
||||
return url;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user