fix types

This commit is contained in:
Georges-Antoine Assi
2025-10-22 19:26:30 -04:00
parent 5aa344b3ce
commit 9344801ec6
24 changed files with 59 additions and 61 deletions

View File

@@ -1,7 +1,12 @@
import os
from datetime import datetime
from typing import Dict, List, Optional
from xml.etree.ElementTree import Element, SubElement, indent, tostring
from xml.etree.ElementTree import ( # trunk-ignore(bandit/B405)
Element,
SubElement,
indent,
tostring,
)
from config import YOUTUBE_BASE_URL
from handler.database import db_platform_handler, db_rom_handler

View File

@@ -2,7 +2,7 @@ import os
import uuid
from pathlib import Path
from typing import NotRequired, TypedDict
from xml.etree.ElementTree import Element
from xml.etree.ElementTree import Element # trunk-ignore(bandit/B405)
import pydash
from defusedxml import ElementTree as ET

View File

@@ -150,7 +150,7 @@ class SSMetadataMedia(TypedDict):
manual: str | None # manual
marquee: str | None # screenmarquee
miximage: str | None # mixrbv1 | mixrbv2
physical: str | None # support-texture | support-2D
physical: str | None # support-2D
screenshot: str | None # ss
steamgrid: str | None # steamgrid
title_screen: str | None # sstitle
@@ -216,13 +216,13 @@ def extract_media_from_ss_rom(game: SSGame) -> SSMetadataMedia:
elif media.get("type") == "screenmarquee" and not ss_media["marquee"]:
ss_media["marquee"] = media["url"]
elif (
media.get("type") == "miximage1" or media.get("type") == "miximage2"
media.get("type") == "miximage1"
or media.get("type") == "miximage2"
or media.get("type") == "mixrbv1"
or media.get("type") == "mixrbv2"
) and not ss_media["miximage"]:
ss_media["miximage"] = media["url"]
elif (
media.get("type") == "support-texture"
or media.get("type") == "support-2D"
) and not ss_media["physical"]:
elif media.get("type") == "support-2D" and not ss_media["physical"]:
ss_media["physical"] = media["url"]
elif media.get("type") == "ss" and not ss_media["screenshot"]:
ss_media["screenshot"] = media["url"]

View File

@@ -39,7 +39,6 @@ export type { EmulationDict } from './models/EmulationDict';
export type { FilesystemDict } from './models/FilesystemDict';
export type { FirmwareSchema } from './models/FirmwareSchema';
export type { FrontendDict } from './models/FrontendDict';
export type { GamelistMedia } from './models/GamelistMedia';
export type { GenericTaskMeta } from './models/GenericTaskMeta';
export type { GenericTaskStatusResponse } from './models/GenericTaskStatusResponse';
export type { HeartbeatResponse } from './models/HeartbeatResponse';
@@ -83,7 +82,6 @@ export type { SGDBResource } from './models/SGDBResource';
export type { SiblingRomSchema } from './models/SiblingRomSchema';
export type { SimpleRomSchema } from './models/SimpleRomSchema';
export type { SmartCollectionSchema } from './models/SmartCollectionSchema';
export type { SSMedia } from './models/SSMedia';
export type { StateSchema } from './models/StateSchema';
export type { StatsReturn } from './models/StatsReturn';
export type { SystemDict } from './models/SystemDict';

View File

@@ -1,20 +0,0 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type GamelistMedia = {
box2d: (string | null);
box2d_back: (string | null);
box3d: (string | null);
fanart: (string | null);
image: (string | null);
manual: (string | null);
marquee: (string | null);
miximage: (string | null);
physical: (string | null);
screenshot: (string | null);
thumbnail: (string | null);
title_screen: (string | null);
video: (string | null);
};

View File

@@ -2,8 +2,20 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { GamelistMedia } from './GamelistMedia';
export type RomGamelistMetadata = {
box2d?: (string | null);
box2d_back?: (string | null);
box3d?: (string | null);
fanart?: (string | null);
image?: (string | null);
manual?: (string | null);
marquee?: (string | null);
miximage?: (string | null);
physical?: (string | null);
screenshot?: (string | null);
thumbnail?: (string | null);
title_screen?: (string | null);
video?: (string | null);
rating?: (number | null);
first_release_date?: (string | null);
companies?: (Array<string> | null);
@@ -11,6 +23,5 @@ export type RomGamelistMetadata = {
genres?: (Array<string> | null);
player_count?: (string | null);
md5_hash?: (string | null);
media?: GamelistMedia;
};

View File

@@ -2,8 +2,24 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { SSMedia } from './SSMedia';
export type RomSSMetadata = {
bezel?: (string | null);
box2d?: (string | null);
box2d_side?: (string | null);
box2d_back?: (string | null);
box3d?: (string | null);
fanart?: (string | null);
fullbox?: (string | null);
logo?: (string | null);
manual?: (string | null);
marquee?: (string | null);
miximage?: (string | null);
physical?: (string | null);
screenshot?: (string | null);
steamgrid?: (string | null);
title_screen?: (string | null);
video?: (string | null);
video_normalized?: (string | null);
ss_score?: string;
first_release_date?: (number | null);
alternative_names?: Array<string>;
@@ -11,6 +27,5 @@ export type RomSSMetadata = {
franchises?: Array<string>;
game_modes?: Array<string>;
genres?: Array<string>;
media?: SSMedia;
};

View File

@@ -1,24 +0,0 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type SSMedia = {
bezel: (string | null);
box2d: (string | null);
box2d_side: (string | null);
box2d_back: (string | null);
box3d: (string | null);
fanart: (string | null);
fullbox: (string | null);
logo: (string | null);
manual: (string | null);
marquee: (string | null);
miximage: (string | null);
physical: (string | null);
screenshot: (string | null);
steamgrid: (string | null);
title_screen: (string | null);
video: (string | null);
video_normalized: (string | null);
};

View File

@@ -343,7 +343,7 @@ watch(
@click="exportGamelist"
>
<v-icon class="text-romm-blue mr-2"> mdi-download </v-icon>
{{ t("platform.export-gamelist") }}
{{ t("platform.export") }} gamelist.xml
</v-btn>
</div>
</div>

View File

@@ -8,6 +8,7 @@
"cover-style": "Cover-Stil",
"danger-zone": "Gefahrenzone",
"delete-platform": "Plattform löschen",
"export": "Exportieren",
"family": "Familie",
"filter-gallery": "Gallerie filtern",
"franchise": "Franchise",

View File

@@ -8,7 +8,7 @@
"cover-style": "Cover style",
"danger-zone": "Danger zone",
"delete-platform": "Delete platform",
"export-gamelist": "Export Gamelist",
"export": "Export",
"family": "Family",
"filter-gallery": "Filter gallery",
"franchise": "Franchise",

View File

@@ -8,7 +8,7 @@
"cover-style": "Cover style",
"danger-zone": "Danger zone",
"delete-platform": "Delete platform",
"export-gamelist": "Export Gamelist",
"export": "Export",
"family": "Family",
"filter-gallery": "Filter gallery",
"franchise": "Franchise",

View File

@@ -8,6 +8,7 @@
"cover-style": "Estilo de carátula",
"danger-zone": "Zona de peligro",
"delete-platform": "Eliminar platforma",
"export": "Exportar",
"family": "Familia",
"filter-gallery": "Filtrar galería",
"franchise": "Franquicia",

View File

@@ -8,6 +8,7 @@
"cover-style": "Style de couverture",
"danger-zone": "Zone de danger",
"delete-platform": "Supprimer la plateforme",
"export": "Exporter",
"family": "Famille",
"filter-gallery": "Filtrer la galerie",
"franchise": "Franchise",

View File

@@ -8,6 +8,7 @@
"cover-style": "Stile Copertina",
"danger-zone": "Zona pericolosa",
"delete-platform": "Elimina piattaforma",
"export": "Esporta",
"family": "Famiglia",
"filter-gallery": "Filtra galleria",
"franchise": "Franchise",

View File

@@ -8,6 +8,7 @@
"cover-style": "カバースタイル",
"danger-zone": "危険",
"delete-platform": "プラットフォームの削除",
"export": "エクスポート",
"family": "ファミリー",
"filter-gallery": "ギャラリーをフィルタ",
"franchise": "フランチャイズ",

View File

@@ -8,6 +8,7 @@
"cover-style": "커버 스타일",
"danger-zone": "위험 구역",
"delete-platform": "플랫폼 지우기",
"export": "내보내기",
"family": "계열",
"filter-gallery": "갤러리 필터",
"franchise": "프랜차이즈",

View File

@@ -8,6 +8,7 @@
"cover-style": "Styl okładki",
"danger-zone": "Strefa zagrożenia",
"delete-platform": "Usuń platformę",
"export": "Eksportuj",
"family": "Rodzina",
"filter-gallery": "Filtruj galerię",
"franchise": "Seria",

View File

@@ -8,6 +8,7 @@
"cover-style": "Estilo da capa",
"danger-zone": "Zona de perigo",
"delete-platform": "Excluir plataforma",
"export": "Exportar",
"family": "Família",
"filter-gallery": "Filtrar galeria",
"franchise": "Franquia",

View File

@@ -8,6 +8,7 @@
"cover-style": "Stil copertă",
"danger-zone": "Zonă periculoasă",
"delete-platform": "Șterge platforma",
"export": "Exportare",
"family": "Familie",
"filter-gallery": "Filtrare galerie",
"franchise": "Franciză",

View File

@@ -8,6 +8,7 @@
"cover-style": "Стиль обложки",
"danger-zone": "Опасная зона",
"delete-platform": "Удалить платформу",
"export": "Экспорт",
"family": "Семейство",
"filter-gallery": "Фильтр галереи",
"franchise": "Франшиза",

View File

@@ -8,6 +8,7 @@
"cover-style": "封面样式",
"danger-zone": "危险区域",
"delete-platform": "删除平台",
"export": "导出",
"family": "家族",
"filter-gallery": "筛选游戏库",
"franchise": "系列",

View File

@@ -8,6 +8,7 @@
"cover-style": "封面樣式",
"danger-zone": "危險操作",
"delete-platform": "删除平台",
"export": "導出",
"family": "家族",
"filter-gallery": "篩選遊戲庫",
"franchise": "系列",

View File

@@ -30,6 +30,7 @@ const defaultConfig = {
SCAN_ARTWORK_PRIORITY: [],
SCAN_REGION_PRIORITY: [],
SCAN_LANGUAGE_PRIORITY: [],
SCAN_ARTWORK_COVER_STYLE: "",
} as ConfigResponse;
export default defineStore("config", {