feat: add osu status to rpc

This commit is contained in:
2025-07-08 14:56:44 +02:00
parent 9f62332334
commit d6623891bb
10 changed files with 256 additions and 15 deletions

View File

@@ -89,3 +89,14 @@ export const formatBytes = (bytes: number, decimals = 2) => {
export const openURL = async (url: string) => {
await invoke('open_url_in_browser', { url });
};
export const urlIsValidImage = async (url: string) => {
try {
const request = await fetch(url);
if (!request.ok) return false;
const contentType = request.headers.get('content-type');
return contentType?.startsWith('image/');
} catch {
return false;
}
};