fix: skins count display when no skins are in the skins directory
This commit is contained in:
12
bun.lock
12
bun.lock
@@ -32,7 +32,7 @@
|
|||||||
"@lucide/svelte": "^0.525.0",
|
"@lucide/svelte": "^0.525.0",
|
||||||
"@sveltejs/adapter-static": "3.0.8",
|
"@sveltejs/adapter-static": "3.0.8",
|
||||||
"@sveltejs/kit": "2.22.2",
|
"@sveltejs/kit": "2.22.2",
|
||||||
"@sveltejs/vite-plugin-svelte": "5.1.0",
|
"@sveltejs/vite-plugin-svelte": "^6.1.0",
|
||||||
"@tauri-apps/cli": "2.6.1",
|
"@tauri-apps/cli": "2.6.1",
|
||||||
"@types/bun": "^1.2.18",
|
"@types/bun": "^1.2.18",
|
||||||
"@types/crypto-js": "^4.2.2",
|
"@types/crypto-js": "^4.2.2",
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
"typescript": "5.8.3",
|
"typescript": "5.8.3",
|
||||||
"typescript-eslint": "^8.20.0",
|
"typescript-eslint": "^8.20.0",
|
||||||
"vite": "7.0.0",
|
"vite": "7.0.0",
|
||||||
"vite-plugin-devtools-json": "^0.2.0",
|
"vite-plugin-devtools-json": "^0.3.0",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -232,9 +232,9 @@
|
|||||||
|
|
||||||
"@sveltejs/kit": ["@sveltejs/kit@2.22.2", "", { "dependencies": { "@sveltejs/acorn-typescript": "^1.0.5", "@types/cookie": "^0.6.0", "acorn": "^8.14.1", "cookie": "^0.6.0", "devalue": "^5.1.0", "esm-env": "^1.2.2", "kleur": "^4.1.5", "magic-string": "^0.30.5", "mrmime": "^2.0.0", "sade": "^1.8.1", "set-cookie-parser": "^2.6.0", "sirv": "^3.0.0", "vitefu": "^1.0.6" }, "peerDependencies": { "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0", "svelte": "^4.0.0 || ^5.0.0-next.0", "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0" }, "bin": { "svelte-kit": "svelte-kit.js" } }, "sha512-2MvEpSYabUrsJAoq5qCOBGAlkICjfjunrnLcx3YAk2XV7TvAIhomlKsAgR4H/4uns5rAfYmj7Wet5KRtc8dPIg=="],
|
"@sveltejs/kit": ["@sveltejs/kit@2.22.2", "", { "dependencies": { "@sveltejs/acorn-typescript": "^1.0.5", "@types/cookie": "^0.6.0", "acorn": "^8.14.1", "cookie": "^0.6.0", "devalue": "^5.1.0", "esm-env": "^1.2.2", "kleur": "^4.1.5", "magic-string": "^0.30.5", "mrmime": "^2.0.0", "sade": "^1.8.1", "set-cookie-parser": "^2.6.0", "sirv": "^3.0.0", "vitefu": "^1.0.6" }, "peerDependencies": { "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0", "svelte": "^4.0.0 || ^5.0.0-next.0", "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0" }, "bin": { "svelte-kit": "svelte-kit.js" } }, "sha512-2MvEpSYabUrsJAoq5qCOBGAlkICjfjunrnLcx3YAk2XV7TvAIhomlKsAgR4H/4uns5rAfYmj7Wet5KRtc8dPIg=="],
|
||||||
|
|
||||||
"@sveltejs/vite-plugin-svelte": ["@sveltejs/vite-plugin-svelte@5.1.0", "", { "dependencies": { "@sveltejs/vite-plugin-svelte-inspector": "^4.0.1", "debug": "^4.4.1", "deepmerge": "^4.3.1", "kleur": "^4.1.5", "magic-string": "^0.30.17", "vitefu": "^1.0.6" }, "peerDependencies": { "svelte": "^5.0.0", "vite": "^6.0.0" } }, "sha512-wojIS/7GYnJDYIg1higWj2ROA6sSRWvcR1PO/bqEyFr/5UZah26c8Cz4u0NaqjPeVltzsVpt2Tm8d2io0V+4Tw=="],
|
"@sveltejs/vite-plugin-svelte": ["@sveltejs/vite-plugin-svelte@6.1.0", "", { "dependencies": { "@sveltejs/vite-plugin-svelte-inspector": "^5.0.0-next.1", "debug": "^4.4.1", "deepmerge": "^4.3.1", "kleur": "^4.1.5", "magic-string": "^0.30.17", "vitefu": "^1.1.1" }, "peerDependencies": { "svelte": "^5.0.0", "vite": "^6.3.0 || ^7.0.0" } }, "sha512-+U6lz1wvGEG/BvQyL4z/flyNdQ9xDNv5vrh+vWBWTHaebqT0c9RNggpZTo/XSPoHsSCWBlYaTlRX8pZ9GATXCw=="],
|
||||||
|
|
||||||
"@sveltejs/vite-plugin-svelte-inspector": ["@sveltejs/vite-plugin-svelte-inspector@4.0.1", "", { "dependencies": { "debug": "^4.3.7" }, "peerDependencies": { "@sveltejs/vite-plugin-svelte": "^5.0.0", "svelte": "^5.0.0", "vite": "^6.0.0" } }, "sha512-J/Nmb2Q2y7mck2hyCX4ckVHcR5tu2J+MtBEQqpDrrgELZ2uvraQcK/ioCV61AqkdXFgriksOKIceDcQmqnGhVw=="],
|
"@sveltejs/vite-plugin-svelte-inspector": ["@sveltejs/vite-plugin-svelte-inspector@5.0.0", "", { "dependencies": { "debug": "^4.4.1" }, "peerDependencies": { "@sveltejs/vite-plugin-svelte": "^6.0.0-next.0", "svelte": "^5.0.0", "vite": "^6.3.0 || ^7.0.0" } }, "sha512-iwQ8Z4ET6ZFSt/gC+tVfcsSBHwsqc6RumSaiLUkAurW3BCpJam65cmHw0oOlDMTO0u+PZi9hilBRYN+LZNHTUQ=="],
|
||||||
|
|
||||||
"@swc/helpers": ["@swc/helpers@0.5.17", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A=="],
|
"@swc/helpers": ["@swc/helpers@0.5.17", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A=="],
|
||||||
|
|
||||||
@@ -768,7 +768,7 @@
|
|||||||
|
|
||||||
"vite": ["vite@7.0.0", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.6", "picomatch": "^4.0.2", "postcss": "^8.5.6", "rollup": "^4.40.0", "tinyglobby": "^0.2.14" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-ixXJB1YRgDIw2OszKQS9WxGHKwLdCsbQNkpJN171udl6szi/rIySHL6/Os3s2+oE4P/FLD4dxg4mD7Wust+u5g=="],
|
"vite": ["vite@7.0.0", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.6", "picomatch": "^4.0.2", "postcss": "^8.5.6", "rollup": "^4.40.0", "tinyglobby": "^0.2.14" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-ixXJB1YRgDIw2OszKQS9WxGHKwLdCsbQNkpJN171udl6szi/rIySHL6/Os3s2+oE4P/FLD4dxg4mD7Wust+u5g=="],
|
||||||
|
|
||||||
"vite-plugin-devtools-json": ["vite-plugin-devtools-json@0.2.0", "", { "dependencies": { "uuid": "^11.1.0" }, "peerDependencies": { "vite": "^2.7.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" } }, "sha512-K7PoaWOEJECZ1n3VbhJXsUAX2PsO0xY7KFMM/Leh7tUev0M5zi+lz+vnVVdCK17IOK9Jp9rdzHXc08cnQirGbg=="],
|
"vite-plugin-devtools-json": ["vite-plugin-devtools-json@0.3.0", "", { "dependencies": { "uuid": "^11.1.0" }, "peerDependencies": { "vite": "^2.7.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "sha512-y8QdN/uZNV0Jj96H9R3s7G9jtcSuyssk8EwSfWaY+NUAdy7976d7rjtXJzqmeCcgp4CZywcTyUc+k6zpPFHdeg=="],
|
||||||
|
|
||||||
"vitefu": ["vitefu@1.0.7", "", { "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0" }, "optionalPeers": ["vite"] }, "sha512-eRWXLBbJjW3X5z5P5IHcSm2yYbYRPb2kQuc+oqsbAl99WB5kVsPbiiox+cymo8twTzifA6itvhr2CmjnaZZp0Q=="],
|
"vitefu": ["vitefu@1.0.7", "", { "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0" }, "optionalPeers": ["vite"] }, "sha512-eRWXLBbJjW3X5z5P5IHcSm2yYbYRPb2kQuc+oqsbAl99WB5kVsPbiiox+cymo8twTzifA6itvhr2CmjnaZZp0Q=="],
|
||||||
|
|
||||||
@@ -792,6 +792,8 @@
|
|||||||
|
|
||||||
"@humanfs/node/@humanwhocodes/retry": ["@humanwhocodes/retry@0.3.1", "", {}, "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA=="],
|
"@humanfs/node/@humanwhocodes/retry": ["@humanwhocodes/retry@0.3.1", "", {}, "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA=="],
|
||||||
|
|
||||||
|
"@sveltejs/vite-plugin-svelte/vitefu": ["vitefu@1.1.1", "", { "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0" }, "optionalPeers": ["vite"] }, "sha512-B/Fegf3i8zh0yFbpzZ21amWzHmuNlLlmJT6n7bu5e+pCHUKQIfXSYokrqOBGEMMe9UG2sostKQF9mml/vYaWJQ=="],
|
||||||
|
|
||||||
"@tailwindcss/node/jiti": ["jiti@2.4.2", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A=="],
|
"@tailwindcss/node/jiti": ["jiti@2.4.2", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A=="],
|
||||||
|
|
||||||
"@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.4.3", "", { "dependencies": { "@emnapi/wasi-threads": "1.0.2", "tslib": "^2.4.0" }, "bundled": true }, "sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g=="],
|
"@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.4.3", "", { "dependencies": { "@emnapi/wasi-threads": "1.0.2", "tslib": "^2.4.0" }, "bundled": true }, "sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g=="],
|
||||||
|
@@ -720,7 +720,6 @@ pub async fn has_net8() -> bool {
|
|||||||
is_net8_installed().await
|
is_net8_installed().await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn encrypt_string(string: String, entropy: String) -> String {
|
pub fn encrypt_string(string: String, entropy: String) -> String {
|
||||||
let encrypted = encrypt_password(&string, &entropy);
|
let encrypted = encrypt_password(&string, &entropy);
|
||||||
@@ -730,10 +729,3 @@ pub fn encrypt_string(string: String, entropy: String) -> String {
|
|||||||
Err(_) => string,
|
Err(_) => string,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: should not be called by tauri on non windows systems, return the string nonthenless
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
#[tauri::command]
|
|
||||||
pub fn encrypt_string(string: String, _entropy: String) -> String {
|
|
||||||
string
|
|
||||||
}
|
|
||||||
|
@@ -308,6 +308,11 @@ pub async fn is_net8_installed() -> bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
pub fn encrypt_password(password: &str, _entropy: &str) -> Result<String, String> {
|
||||||
|
Ok(password.to_string())
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub fn encrypt_password(password: &str, entropy: &str) -> Result<String, String> {
|
pub fn encrypt_password(password: &str, entropy: &str) -> Result<String, String> {
|
||||||
use base64::{Engine as _, engine::general_purpose};
|
use base64::{Engine as _, engine::general_purpose};
|
||||||
|
@@ -149,14 +149,11 @@
|
|||||||
toast.success('osu! installation path set successfully.');
|
toast.success('osu! installation path set successfully.');
|
||||||
|
|
||||||
const beatmapSetCount: number | null = await getBeatmapSetsCount(selectedPath);
|
const beatmapSetCount: number | null = await getBeatmapSetsCount(selectedPath);
|
||||||
if (beatmapSetCount) {
|
if (beatmapSetCount) beatmapSets.set(beatmapSetCount);
|
||||||
beatmapSets.set(beatmapSetCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
const skinsCount: number | null = await getSkinsCount(selectedPath);
|
const skinsCount: number | null = await getSkinsCount(selectedPath);
|
||||||
if (skinsCount) {
|
if (skinsCount !== null) skins.set(skinsCount);
|
||||||
skins.set(skinsCount);
|
|
||||||
}
|
|
||||||
const skin: string = await getSkin(selectedPath);
|
const skin: string = await getSkin(selectedPath);
|
||||||
currentSkin.set(skin);
|
currentSkin.set(skin);
|
||||||
}
|
}
|
||||||
@@ -481,7 +478,7 @@
|
|||||||
if (beatmapSetCount) beatmapSets.set(beatmapSetCount);
|
if (beatmapSetCount) beatmapSets.set(beatmapSetCount);
|
||||||
|
|
||||||
const skinCount = await getSkinsCount(osuPath);
|
const skinCount = await getSkinsCount(osuPath);
|
||||||
if (skinCount) skins.set(skinCount);
|
if (skinCount !== null) skins.set(skinCount);
|
||||||
|
|
||||||
const skin = await getSkin(osuPath);
|
const skin = await getSkin(osuPath);
|
||||||
currentSkin.set(skin);
|
currentSkin.set(skin);
|
||||||
@@ -900,13 +897,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="relative font-bold text-xl text-yellow-400">
|
<div class="relative font-bold text-xl text-yellow-400">
|
||||||
<div
|
<div
|
||||||
class="absolute top-1 left-1/2 -translate-x-1/2 {!$skins
|
class="absolute top-1 left-1/2 -translate-x-1/2 {$skins === null
|
||||||
? 'opacity-100'
|
? 'opacity-100'
|
||||||
: 'opacity-0'} transition-opacity duration-1000"
|
: 'opacity-0'} transition-opacity duration-1000"
|
||||||
>
|
>
|
||||||
<LoaderCircle class="animate-spin" />
|
<LoaderCircle class="animate-spin" />
|
||||||
</div>
|
</div>
|
||||||
<div class="{!$skins ? 'opacity-0' : 'opacity-100'} transition-opacity duration-1000">
|
<div
|
||||||
|
class="{$skins === null
|
||||||
|
? 'opacity-0'
|
||||||
|
: 'opacity-100'} transition-opacity duration-1000"
|
||||||
|
>
|
||||||
{#if $reduceAnimations}
|
{#if $reduceAnimations}
|
||||||
<span>{numberHumanReadable($skins ?? 0)}</span>
|
<span>{numberHumanReadable($skins ?? 0)}</span>
|
||||||
{:else}
|
{:else}
|
||||||
|
@@ -135,11 +135,11 @@
|
|||||||
|
|
||||||
currentLoadingInfo.set('Counting beatmapsets...');
|
currentLoadingInfo.set('Counting beatmapsets...');
|
||||||
const beatmapSetCount = await getBeatmapSetsCount($osuInstallationPath);
|
const beatmapSetCount = await getBeatmapSetsCount($osuInstallationPath);
|
||||||
if (beatmapSetCount) beatmapSets.set(beatmapSetCount);
|
if (beatmapSetCount !== null) beatmapSets.set(beatmapSetCount);
|
||||||
|
|
||||||
currentLoadingInfo.set('Counting skins...');
|
currentLoadingInfo.set('Counting skins...');
|
||||||
const skinCount = await getSkinsCount($osuInstallationPath);
|
const skinCount = await getSkinsCount($osuInstallationPath);
|
||||||
if (skinCount) skins.set(skinCount);
|
if (skinCount !== null) skins.set(skinCount);
|
||||||
const skin: string = await getSkin($osuInstallationPath);
|
const skin: string = await getSkin($osuInstallationPath);
|
||||||
currentSkin.set(skin);
|
currentSkin.set(skin);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user