diff --git a/backend/endpoints/rom.py b/backend/endpoints/rom.py index 86455e681..0168bc730 100644 --- a/backend/endpoints/rom.py +++ b/backend/endpoints/rom.py @@ -290,6 +290,7 @@ async def update_rom( rename_as_source: bool = False, remove_cover: bool = False, artwork: UploadFile | None = None, + unmatch_metadata: bool = False, ) -> DetailedRomSchema: """Update rom endpoint @@ -298,6 +299,7 @@ async def update_rom( id (Rom): Rom internal id rename_as_source (bool, optional): Flag to rename rom file as matched IGDB game. Defaults to False. artwork (UploadFile, optional): Custom artork to set as cover. Defaults to File(None). + unmatch_metadata: Remove the metadata matches for this game. Defaults to False. Raises: HTTPException: If a rom already have that name when enabling the rename_as_source flag @@ -313,6 +315,31 @@ async def update_rom( if not rom: raise RomNotFoundInDatabaseException(id) + if unmatch_metadata: + db_rom_handler.update_rom( + id, + { + "igdb_id": None, + "sgdb_id": None, + "moby_id": None, + "name": rom.file_name, + "summary": "", + "url_screenshots": [], + "path_screenshots": [], + "path_cover_s": "", + "path_cover_l": "", + "url_cover": "", + "slug": "", + "igdb_metadata": {}, + "moby_metadata": {}, + "revision": "", + }, + ) + + return DetailedRomSchema.from_orm_with_request( + db_rom_handler.get_rom(id), request + ) + cleaned_data = { "igdb_id": data.get("igdb_id", None), "moby_id": data.get("moby_id", None), diff --git a/frontend/src/components/Details/Info/FileInfo.vue b/frontend/src/components/Details/Info/FileInfo.vue index a121249ac..aa6153b1a 100644 --- a/frontend/src/components/Details/Info/FileInfo.vue +++ b/frontend/src/components/Details/Info/FileInfo.vue @@ -23,7 +23,7 @@ const romUser = ref( note_raw_markdown: "", note_is_public: false, is_main_sibling: false, - } + }, ); // Functions @@ -53,7 +53,7 @@ watch( note_is_public: false, is_main_sibling: false, }; - } + }, ); diff --git a/frontend/src/components/common/Platform/Dialog/DeletePlatform.vue b/frontend/src/components/common/Platform/Dialog/DeletePlatform.vue index a012d9a5b..c34d661f1 100644 --- a/frontend/src/components/common/Platform/Dialog/DeletePlatform.vue +++ b/frontend/src/components/common/Platform/Dialog/DeletePlatform.vue @@ -79,13 +79,8 @@ function closeDialog() { @@ -223,7 +229,9 @@ async function finishWizard() { max-width: 300px; } #version { - text-shadow: 1px 1px 1px #000000, 0 0 1px #000000; + text-shadow: + 1px 1px 1px #000000, + 0 0 1px #000000; bottom: 0.3rem; right: 0.5rem; }