feat: Limit bio display height(#1158), Toggle for display of age gated instances(#1188), fix: (#1189)(#1192) (#1195)

This commit is contained in:
pa
2025-03-24 11:13:35 +09:00
committed by GitHub
parent 249dc7fc1e
commit 71d8cc22bf
12 changed files with 183 additions and 136 deletions

View File

@@ -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;
}
};