diff --git a/nuxt.config.ts b/nuxt.config.ts index 8a0ebeb..7407667 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -175,6 +175,9 @@ export default defineNuxtConfig({ }, i18n: { + bundle: { + optimizeTranslationDirective: false, + }, defaultLocale: "en-us", strategy: "no_prefix", experimental: { diff --git a/server/internal/library/index.ts b/server/internal/library/index.ts index a0514e8..2f1ca4f 100644 --- a/server/internal/library/index.ts +++ b/server/internal/library/index.ts @@ -105,7 +105,7 @@ class LibraryManager { if (!game) return undefined; try { - const versions = await provider.listVersions(libraryPath); + const versions = await provider.listVersions(libraryPath, game.versions.map((v) => v.versionName)); const unimportedVersions = versions.filter( (e) => game.versions.findIndex((v) => v.versionName == e) == -1 && diff --git a/server/internal/library/provider.ts b/server/internal/library/provider.ts index 576cac9..53c415a 100644 --- a/server/internal/library/provider.ts +++ b/server/internal/library/provider.ts @@ -24,7 +24,7 @@ export abstract class LibraryProvider { * @param game folder name of the game to list versions for * @returns list of version folder names */ - abstract listVersions(game: string): Promise; + abstract listVersions(game: string, existingPaths?: string[]): Promise; /** * @param game folder name of the game diff --git a/server/internal/library/providers/filesystem.ts b/server/internal/library/providers/filesystem.ts index d2f2ac3..e3832a2 100644 --- a/server/internal/library/providers/filesystem.ts +++ b/server/internal/library/providers/filesystem.ts @@ -54,11 +54,12 @@ export class FilesystemProvider return folderDirs; } - async listVersions(game: string): Promise { + async listVersions(game: string, ignoredVersions?: string[]): Promise { const gameDir = path.join(this.config.baseDir, game); if (!fs.existsSync(gameDir)) throw new GameNotFoundError(); const versionDirs = fs.readdirSync(gameDir); const validVersionDirs = versionDirs.filter((e) => { + if(ignoredVersions && ignoredVersions.includes(e)) return false const fullDir = path.join(this.config.baseDir, game, e); return DROPLET_HANDLER.hasBackendForPath(fullDir); });