fix a bunch of shit

This commit is contained in:
Georges-Antoine Assi
2025-08-09 11:16:12 -04:00
parent afaef09c84
commit d005dba90b
24 changed files with 86 additions and 61 deletions

View File

@@ -20,7 +20,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
libmagic-dev \
p7zip-full \
7zip \
tzdata \
libbz2-dev \
libssl-dev \

View File

@@ -77,6 +77,7 @@ def extract_metadata_from_moby_rom(rom: MobyGame) -> MobyMetadata:
class MobyGamesHandler(MetadataHandler):
def __init__(self) -> None:
self.moby_service = MobyGamesService()
self.min_similarity_score = 0.6
async def _search_rom(
self, search_term: str, platform_moby_id: int
@@ -95,6 +96,7 @@ class MobyGamesHandler(MetadataHandler):
best_match, best_score = self.find_best_match(
search_term,
list(games_by_name.keys()),
self.min_similarity_score,
remove_punctuation=False,
)
if best_match:
@@ -195,7 +197,10 @@ class MobyGamesHandler(MetadataHandler):
": " in search_term or " - " in search_term or "/" in search_term
):
terms = re.split(SEARCH_TERM_SPLIT_PATTERN, search_term)
res = await self._search_rom(terms[-1], platform_moby_id)
for term in reversed(terms):
res = await self._search_rom(term.strip(), platform_moby_id)
if res:
break
if not res:
return fallback_rom

View File

@@ -31,7 +31,7 @@ class SGDBRom(TypedDict):
class SGDBBaseHandler(MetadataHandler):
def __init__(self) -> None:
self.sgdb_service = SteamGridDBService()
self.min_similarity_score: Final = 0.95
self.min_similarity_score: Final = 0.98
async def get_details(self, search_term: str) -> list[SGDBResult]:
if not STEAMGRIDDB_API_ENABLED:

View File

@@ -5,7 +5,7 @@ import tempfile
from collections.abc import Callable, Iterator
from pathlib import Path
SEVEN_ZIP_PATH = "/usr/bin/7z"
SEVEN_ZIP_PATH = "/usr/bin/7zz"
def process_file_7z(

View File

@@ -87,7 +87,7 @@ RUN git clone --recursive --branch "${RALIBRETRO_VERSION}" --depth 1 https://git
FROM alpine:${ALPINE_VERSION} AS emulator-stage
RUN apk add --no-cache \
p7zip \
7zip \
wget
ARG EMULATORJS_VERSION=4.2.3
@@ -140,7 +140,7 @@ RUN apk add --no-cache \
libmagic \
mariadb-connector-c \
libpq \
p7zip \
7zip \
tzdata \
valkey

View File

@@ -17,6 +17,7 @@ import {
import type { Emitter } from "mitt";
import { computed, inject, ref } from "vue";
import { storeToRefs } from "pinia";
import { useI18n } from "vue-i18n";
const props = defineProps<{ rom: DetailedRom }>();
const downloadStore = storeDownload();
@@ -27,6 +28,7 @@ const qrCodeIcon = ref("mdi-qrcode");
const configStore = storeConfig();
const { config } = storeToRefs(configStore);
const auth = storeAuth();
const { t } = useI18n();
const platformSlug = computed(() =>
props.rom.platform_slug in config.value.PLATFORMS_VERSIONS
@@ -84,7 +86,7 @@ async function copyDownloadLink(rom: DetailedRom) {
location="top"
transition="fade-transition"
open-delay="1000"
>Download game</v-tooltip
>{{ t("rom.download") }} {{ rom.name }}</v-tooltip
>
<v-icon icon="mdi-download" size="large" />
</v-btn>
@@ -99,7 +101,7 @@ async function copyDownloadLink(rom: DetailedRom) {
location="top"
transition="fade-transition"
open-delay="1000"
>Copy download link</v-tooltip
>{{ t("rom.copy-link") }}</v-tooltip
>
<v-icon icon="mdi-content-copy" />
</v-btn>

View File

@@ -14,6 +14,7 @@ import { storeToRefs } from "pinia";
import { inject, ref } from "vue";
import { useRoute } from "vue-router";
import { useDisplay } from "vuetify";
import { useI18n } from "vue-i18n";
const { smAndDown } = useDisplay();
const romsStore = storeRoms();
@@ -31,6 +32,7 @@ const collectionsStore = storeCollections();
const { favoriteCollection } = storeToRefs(collectionsStore);
const route = useRoute();
const heartbeat = storeHeartbeat();
const { t } = useI18n();
function scrollToTop() {
window.scrollTo({
@@ -187,7 +189,7 @@ async function onDownload() {
@click.stop="selectAllRoms"
/>
<v-btn
title="Add to favourites"
:title="t('rom.add-to-fav')"
key="3"
color="toplayer"
elevation="8"
@@ -198,7 +200,7 @@ async function onDownload() {
@click="addToFavourites"
/>
<v-btn
title="Remove from favourites"
:title="t('rom.remove-from-fav')"
key="4"
color="toplayer"
elevation="8"
@@ -209,7 +211,7 @@ async function onDownload() {
@click="removeFromFavourites"
/>
<v-btn
title="Add to collection"
:title="t('rom.add-to-collection')"
key="5"
color="toplayer"
elevation="8"
@@ -222,7 +224,7 @@ async function onDownload() {
"
/>
<v-btn
title="Remove from collection"
:title="t('rom.remove-from-collection')"
key="6"
color="toplayer"
elevation="8"
@@ -238,7 +240,7 @@ async function onDownload() {
"
/>
<v-btn
title="Download roms"
:title="t('rom.download')"
key="7"
color="toplayer"
elevation="8"
@@ -249,7 +251,7 @@ async function onDownload() {
@click="onDownload"
/>
<v-btn
title="Refresh metadata"
:title="t('rom.refresh-metadata')"
key="8"
v-if="auth.scopes.includes('roms.write')"
color="toplayer"
@@ -261,7 +263,7 @@ async function onDownload() {
@click="onScan"
/>
<v-btn
title="Delete roms"
:title="t('rom.delete')"
key="9"
v-if="auth.scopes.includes('roms.write')"
color="toplayer"

View File

@@ -161,7 +161,7 @@ async function onScan() {
@click="emitter?.emit('showEditRomDialog', { ...rom })"
>
<v-list-item-title class="d-flex">
<v-icon icon="mdi-pencil-box" class="mr-2" />{{ t("rom.edit-rom") }}
<v-icon icon="mdi-pencil-box" class="mr-2" />{{ t("rom.edit") }}
</v-list-item-title>
</v-list-item>
<v-list-item class="py-4 pr-5" @click="onScan">
@@ -232,7 +232,7 @@ async function onScan() {
@click="emitter?.emit('showDeleteRomDialog', [rom])"
>
<v-list-item-title class="d-flex">
<v-icon icon="mdi-delete" class="mr-2" />{{ t("rom.delete-rom") }}
<v-icon icon="mdi-delete" class="mr-2" />{{ t("rom.delete") }}
</v-list-item-title>
</v-list-item>
</template>

View File

@@ -16,6 +16,7 @@ import { ROUTES } from "@/plugins/router";
import type { Emitter } from "mitt";
import { computed, inject, ref, watch } from "vue";
import { storeToRefs } from "pinia";
import { useI18n } from "vue-i18n";
const props = defineProps<{ rom: SimpleRom; sizeActionBar: number }>();
const emit = defineEmits(["menu-open", "menu-close"]);
@@ -25,6 +26,7 @@ const emitter = inject<Emitter<Events>>("emitter");
const configStore = storeConfig();
const { config } = storeToRefs(configStore);
const auth = storeAuth();
const { t } = useI18n();
const computedSize = computed(() => {
return props.sizeActionBar === 1 ? "small" : "x-small";
@@ -66,7 +68,7 @@ watch(menuOpen, (val) => {
variant="text"
rounded="0"
@click.prevent="romApi.downloadRom({ rom })"
:aria-label="`Download ${rom.name}`"
:aria-label="`${t('rom.download')} ${rom.name}`"
/>
</v-col>
<v-col

View File

@@ -348,7 +348,7 @@ function closeDialog() {
variant="flat"
@click="unmatchRom"
>
{{ t("rom.unmatch-rom") }}
{{ t("rom.unmatch") }}
</v-btn>
</div>
</v-col>

View File

@@ -13,10 +13,11 @@
"completion": "Durchgespielt",
"copy-link": "Download-Link kopieren",
"default": "Standard",
"delete-rom": "Löschen",
"delete": "Löschen",
"details": "Details",
"difficulty": "Schwierigkeitsgrad",
"edit-rom": "Bearbeiten",
"download": "Herunterladen",
"edit": "Bearbeiten",
"file": "Datei",
"filename": "Dateiname",
"files": "Dateien",
@@ -58,5 +59,5 @@
"summary": "Zusammenfassung",
"switch-version": "Version wechseln",
"tags": "Tags",
"unmatch-rom": "Zuweisung aufheben"
"unmatch": "Zuweisung aufheben"
}

View File

@@ -13,10 +13,11 @@
"completion": "Completion",
"copy-link": "Copy download link",
"default": "Set default",
"delete-rom": "Delete",
"delete": "Delete",
"details": "Details",
"difficulty": "Difficulty",
"edit-rom": "Edit",
"download": "Download",
"edit": "Edit",
"file": "File",
"filename": "File name",
"files": "Files",
@@ -58,5 +59,5 @@
"summary": "Summary",
"switch-version": "Switch version",
"tags": "Tags",
"unmatch-rom": "Unmatch ROM"
"unmatch": "Unmatch ROM"
}

View File

@@ -13,10 +13,11 @@
"completion": "Completion",
"copy-link": "Copy download link",
"default": "Set default",
"delete-rom": "Delete",
"delete": "Delete",
"details": "Details",
"difficulty": "Difficulty",
"edit-rom": "Edit",
"download": "Download",
"edit": "Edit",
"file": "File",
"filename": "File name",
"files": "Files",
@@ -58,5 +59,5 @@
"summary": "Summary",
"switch-version": "Switch version",
"tags": "Tags",
"unmatch-rom": "Unmatch ROM"
"unmatch": "Unmatch ROM"
}

View File

@@ -13,10 +13,11 @@
"completion": "Completado",
"copy-link": "Copiar link de descarga",
"default": "Por defecto",
"delete-rom": "Eliminar",
"delete": "Eliminar",
"details": "Detalles",
"difficulty": "Dificultad",
"edit-rom": "Editar",
"download": "Descargar",
"edit": "Editar",
"file": "Archivo",
"filename": "Nombre del archivo",
"files": "Archivos",
@@ -58,5 +59,5 @@
"summary": "Resumen",
"switch-version": "Cambiar versión",
"tags": "Etiquetas",
"unmatch-rom": "Desvincular ROM"
"unmatch": "Desvincular ROM"
}

View File

@@ -13,10 +13,11 @@
"completion": "Achèvement",
"copy-link": "Copier le lien de téléchargement",
"default": "Par défaut",
"delete-rom": "Supprimer",
"delete": "Supprimer",
"details": "Détails",
"difficulty": "Difficulté",
"edit-rom": "Éditer",
"download": "Télécharger",
"edit": "Éditer",
"file": "Fichier",
"filename": "Nom du fichier",
"files": "Fichiers",
@@ -58,5 +59,5 @@
"summary": "Résumé",
"switch-version": "Changer de version",
"tags": "Tags",
"unmatch-rom": "Dissocier le ROM"
"unmatch": "Dissocier le ROM"
}

View File

@@ -13,10 +13,11 @@
"completion": "Completamento",
"copy-link": "Copia link per il download",
"default": "Predefinita",
"delete-rom": "Elimina",
"delete": "Elimina",
"details": "Dettagli",
"difficulty": "Difficoltà",
"edit-rom": "Modifica",
"download": "Scarica",
"edit": "Modifica",
"file": "File",
"filename": "Name file",
"files": "File",
@@ -58,6 +59,6 @@
"summary": "Riassunto",
"switch-version": "Cambia versione",
"tags": "Tag",
"unmatch-rom": "Rimuovi associazione rom",
"unmatch": "Rimuovi associazione rom",
"version": "Versione"
}

View File

@@ -13,10 +13,11 @@
"completion": "完了度",
"copy-link": "ダウンロードリンクをコピー",
"default": "デフォルト",
"delete-rom": "削除",
"delete": "削除",
"details": "詳細",
"difficulty": "難易度",
"edit-rom": "編集",
"download": "ダウンロード",
"edit": "編集",
"file": "ファイル",
"filename": "ファイル名",
"files": "ファイル",
@@ -58,5 +59,5 @@
"summary": "結果",
"switch-version": "バージョン切り替え",
"tags": "タグ",
"unmatch-rom": "検索結果無し"
"unmatch": "検索結果無し"
}

View File

@@ -13,10 +13,11 @@
"completion": "완료율",
"copy-link": "다운로드 링크 복사",
"default": "기본으로",
"delete-rom": "삭제",
"delete": "삭제",
"details": "자세히",
"difficulty": "난이도",
"edit-rom": "수정",
"download": "다운로드",
"edit": "수정",
"file": "파일",
"filename": "파일 이름",
"files": "파일",
@@ -58,5 +59,5 @@
"summary": "요약",
"switch-version": "버전 전환",
"tags": "태그",
"unmatch-rom": "DB 대응 해제"
"unmatch": "DB 대응 해제"
}

View File

@@ -13,10 +13,11 @@
"completion": "Ukończenie",
"copy-link": "Kopiuj link do pobrania",
"default": "Ustaw jako domyślne",
"delete-rom": "Usuń",
"delete": "Usuń",
"details": "Szczegóły",
"difficulty": "Poziom trudności",
"edit-rom": "Edytuj",
"download": "Pobierz",
"edit": "Edytuj",
"file": "Plik",
"filename": "Nazwa pliku",
"files": "Pliki",
@@ -58,5 +59,5 @@
"summary": "Podsumowanie",
"switch-version": "Zmień wersję",
"tags": "Tagi",
"unmatch-rom": "Odłącz ROM"
"unmatch": "Odłącz ROM"
}

View File

@@ -13,10 +13,11 @@
"completion": "Conclusão",
"copy-link": "Copiar link de download",
"default": "Padrão",
"delete-rom": "Excluir",
"delete": "Excluir",
"details": "Detalhes",
"difficulty": "Dificuldade",
"edit-rom": "Editar",
"download": "Baixar",
"edit": "Editar",
"file": "Arquivo",
"filename": "Nome do arquivo",
"files": "Arquivos",
@@ -58,5 +59,5 @@
"summary": "Resumo",
"switch-version": "Alternar versão",
"tags": "Tags",
"unmatch-rom": "Desvincular ROM"
"unmatch": "Desvincular ROM"
}

View File

@@ -13,10 +13,11 @@
"completion": "Finalizare",
"copy-link": "Copiază linkul de descărcare",
"default": "Implicit",
"delete-rom": "Șterge",
"delete": "Șterge",
"details": "Detalii",
"difficulty": "Dificultate",
"edit-rom": "Editează",
"download": "Descarcă",
"edit": "Editează",
"file": "Fișier",
"filename": "Nume fișier",
"files": "Fișiere",
@@ -58,6 +59,6 @@
"summary": "Rezumat",
"switch-version": "Schimbă versiunea",
"tags": "Etichete",
"unmatch-rom": "Dissociază ROM-ul",
"unmatch": "Dissociază ROM-ul",
"version": "Versiune"
}

View File

@@ -13,10 +13,11 @@
"completion": "Завершение",
"copy-link": "Скопировать ссылку для скачивания",
"default": "По умолчанию",
"delete-rom": "Удалить",
"delete": "Удалить",
"details": "Детали",
"difficulty": "Сложность",
"edit-rom": "Редактировать",
"download": "Скачать",
"edit": "Редактировать",
"file": "Файл",
"filename": "Имя файла",
"files": "Файлы",
@@ -58,5 +59,5 @@
"summary": "Резюме",
"switch-version": "Переключить версию",
"tags": "Теги",
"unmatch-rom": "Отменить совпадение"
"unmatch": "Отменить совпадение"
}

View File

@@ -13,10 +13,11 @@
"completion": "完成度",
"copy-link": "复制下载链接",
"default": "默认",
"delete-rom": "删除",
"delete": "删除",
"details": "详情",
"difficulty": "难度",
"edit-rom": "编辑",
"download": "下载",
"edit": "编辑",
"file": "文件",
"filename": "文件名称",
"files": "文件集",
@@ -59,5 +60,5 @@
"summary": "概要",
"switch-version": "切换版本",
"tags": "标签",
"unmatch-rom": "未匹配的 ROM"
"unmatch": "未匹配的 ROM"
}

View File

@@ -13,10 +13,11 @@
"completion": "完成度",
"copy-link": "複製下載鏈接",
"default": "預設",
"delete-rom": "刪除",
"delete": "刪除",
"details": "詳情",
"difficulty": "難度",
"edit-rom": "編輯",
"download": "下載",
"edit": "編輯",
"file": "檔案",
"filename": "檔案名稱",
"files": "檔案",
@@ -59,5 +60,5 @@
"summary": "概要",
"switch-version": "切换版本",
"tags": "標籤",
"unmatch-rom": "清除匹配資料"
"unmatch": "清除匹配資料"
}