diff --git a/backend/alembic/versions/0033_rom_file_and_hashes.py b/backend/alembic/versions/0033_rom_file_and_hashes.py index cb82ce262..936cda2a6 100644 --- a/backend/alembic/versions/0033_rom_file_and_hashes.py +++ b/backend/alembic/versions/0033_rom_file_and_hashes.py @@ -105,7 +105,9 @@ def upgrade() -> None: CASE WHEN NOT r.multi THEN r.md5_hash ELSE NULL END AS md5_hash, CASE WHEN NOT r.multi THEN r.sha1_hash ELSE NULL END AS sha1_hash FROM roms r - CROSS JOIN jsonb_array_elements(r.files) AS file_data; + CROSS JOIN jsonb_array_elements(r.files) AS file_data + WHERE file_data->>'filename' IS NOT NULL + AND file_data->>'filename' <> ''; """ ) else: @@ -124,7 +126,10 @@ def upgrade() -> None: SELECT r.id AS rom_id, JSON_UNQUOTE(JSON_EXTRACT(file_data, '$.filename')) AS file_name, - CASE WHEN r.multi = 0 THEN r.file_path ELSE CONCAT(TRIM(TRAILING '/' FROM r.file_path), '/', r.file_name) END AS file_path, + CASE + WHEN r.multi = 0 THEN r.file_path + ELSE CONCAT(TRIM(TRAILING '/' FROM r.file_path), '/', r.file_name) + END AS file_path, JSON_UNQUOTE(JSON_EXTRACT(file_data, '$.size')) AS file_size_bytes, JSON_UNQUOTE(JSON_EXTRACT(file_data, '$.last_modified')) AS last_modified, CASE WHEN r.multi = 0 THEN r.crc_hash ELSE NULL END AS crc_hash, @@ -135,7 +140,9 @@ def upgrade() -> None: COLUMNS ( file_data JSON PATH '$' ) - ) AS extracted_files; + ) AS extracted_files + WHERE JSON_UNQUOTE(JSON_EXTRACT(file_data, '$.filename')) IS NOT NULL + AND JSON_UNQUOTE(JSON_EXTRACT(file_data, '$.filename')) <> ''; """ ) diff --git a/backend/config/config_manager.py b/backend/config/config_manager.py index 1ba06d1f3..4e8fe3019 100644 --- a/backend/config/config_manager.py +++ b/backend/config/config_manager.py @@ -257,7 +257,10 @@ class ConfigManager: }, }, }, - "filesystem": {"roms_folder": self.config.ROMS_FOLDER_NAME}, + "filesystem": { + "roms_folder": self.config.ROMS_FOLDER_NAME, + "firmware_folder": self.config.FIRMWARE_FOLDER_NAME, + }, "system": { "platforms": self.config.PLATFORMS_BINDING, "versions": self.config.PLATFORMS_VERSIONS, diff --git a/backend/handler/database/collections_handler.py b/backend/handler/database/collections_handler.py index cfc83f6cd..1a40a1733 100644 --- a/backend/handler/database/collections_handler.py +++ b/backend/handler/database/collections_handler.py @@ -77,16 +77,20 @@ class DBCollectionsHandler(DBBaseHandler): .execution_options(synchronize_session="evaluate") ) - if rom_ids: + if rom_ids is not None: # Delete all existing CollectionRom entries for this collection session.execute( delete(CollectionRom).where(CollectionRom.collection_id == id) ) # Insert new CollectionRom entries for this collection - session.execute( - insert(CollectionRom), - [{"collection_id": id, "rom_id": rom_id} for rom_id in set(rom_ids)], - ) + if rom_ids: + session.execute( + insert(CollectionRom), + [ + {"collection_id": id, "rom_id": rom_id} + for rom_id in set(rom_ids) + ], + ) return session.query(Collection).filter_by(id=id).one() diff --git a/backend/handler/metadata/igdb_handler.py b/backend/handler/metadata/igdb_handler.py index d4112b084..8d9f9fafc 100644 --- a/backend/handler/metadata/igdb_handler.py +++ b/backend/handler/metadata/igdb_handler.py @@ -881,7 +881,6 @@ IGDB_PLATFORM_LIST = ( {"slug": "nuon", "name": "Nuon"}, {"slug": "ps", "name": "PlayStation"}, {"slug": "64dd", "name": "Nintendo 64DD"}, - {"slug": "64dd", "name": "Nintendo 64DD"}, {"slug": "neo-geo-pocket-color", "name": "Neo Geo Pocket Color"}, {"slug": "dvd-player", "name": "DVD Player"}, {"slug": "pocketstation", "name": "PocketStation"}, diff --git a/frontend/src/components/Details/Info/GameInfo.vue b/frontend/src/components/Details/Info/GameInfo.vue index 796d64303..011e2bbfd 100644 --- a/frontend/src/components/Details/Info/GameInfo.vue +++ b/frontend/src/components/Details/Info/GameInfo.vue @@ -1,5 +1,6 @@ @@ -28,7 +25,6 @@ const { xs, smAndDown } = useDisplay(); @@ -128,6 +198,18 @@ function resetFilters() { + + + r.id), - type: "partial", // Quick scan so we can filter by selected roms + type: "quick", // Quick scan so we can filter by selected roms apis: heartbeat.getMetadataOptions().map((s) => s.value), }); } @@ -105,13 +105,15 @@ async function removeFromFavourites() { } await collectionApi .updateCollection({ collection: favCollection.value as Collection }) - .then(() => { + .then(({ data }) => { emitter?.emit("snackbarShow", { msg: "Roms removed from favourites successfully!", icon: "mdi-check-bold", color: "green", timeout: 2000, }); + favCollection.value = data; + collectionsStore.update(data); }) .catch((error) => { console.log(error); diff --git a/frontend/src/components/Gallery/Skeleton.vue b/frontend/src/components/Gallery/Skeleton.vue index 67484f9f6..c346fcee0 100644 --- a/frontend/src/components/Gallery/Skeleton.vue +++ b/frontend/src/components/Gallery/Skeleton.vue @@ -11,8 +11,8 @@ const { currentView } = storeToRefs(galleryViewStore);