diff --git a/CHANGELOG.md b/CHANGELOG.md index f47589566..9c5d8a272 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# v1.6.4 (_12-04-2023_) + +## Added + - Now RomM allows to fix missmatched games by searching by IGDB id manually + - WonderSwan and WonderSwan Color support added + +
+ # v1.6.3 (_12-04-2023_) ## Added diff --git a/README.md b/README.md index cc340eac9..aa8f19e30 100644 --- a/README.md +++ b/README.md @@ -125,67 +125,69 @@ This will change over the time, adding games metadata for more platforms. Make s | slug | name | games metadata | |---------------|-------------------------------------| :----: | -| 3ds | Nintendo 3DS | ✅ | -| amiga | Amiga | ✅ | -| arcade | Arcade | ✅ | -| atari | atari | ❌ | -| coleco | coleco | ❌ | -| c64 | Commodore C64/128/MAX | ✅ | -| cpc | cpc | ❌ | -| cps1 | cps1 | ❌ | -| cps2 | cps2 | ❌ | -| cps3 | cps3 | ❌ | -| daphne | daphne | ❌ | -| dc | Dreamcast | ✅ | -| dos | DOS | ✅ | -| fairchild | fairchild | ❌ | -| fba2012 | fba2012 | ❌ | -| fbneo | fbneo | ❌ | -| fds | Family Computer Disk System | ✅ | -| gb | Game Boy | ✅ | -| gba | Game Boy Advance | ✅ | -| gbc | Game Boy Color | ✅ | -| gg | gg | ❌ | -| gw | gw | ❌ | -| intellivision | Intellivision | ✅ | -| jaguar | Atari Jaguar | ✅ | -| lynx | Atari Lynx | ✅ | -| md | md | ❌ | -| megaduck | megaduck | ❌ | -| ms | ms | ❌ | -| msx | MSX | ✅ | -| n64 | Nintendo 64 | ✅ | -| nds | Nintendo DS | ✅ | -| neocd | neocd | ❌ | -| neogeo | neogeo | ❌ | -| nes | Nintendo Entertainment System | ✅ | -| ngc | Nintendo GameCube | ✅ | -| ngp | ngp | ❌ | -| odyssey | odyssey | ❌ | -| pce | pce | ❌ | -| pcecd | pcecd | ❌ | -| pico | pico | ❌ | -| poke | poke | ❌ | -| ps | PlayStation | ✅ | -| ps2 | PlayStation 2 | ✅ | -| ps3 | PlayStation 3 | ✅ | -| ps4 | ps4 | ❌ | -| psp | PlayStation Portable | ✅ | -| psvita | PlayStation Vita | ✅ | -| scummvm | scummvm | ❌ | -| segacd | Sega CD | ✅ | -| segasgone | segasgone | ❌ | -| sgb | sgb | ❌ | -| sgfx | sgfx | ❌ | -| snes | Super Nintendo Entertainment System | ✅ | -| supervision | supervision | ❌ | -| switch | Nintendo Switch | ✅ | -| wii | Wii | ✅ | -| win | PC (Microsoft Windows) | ✅ | -| wiiu | Wii U | ✅ | -| xbox | Xbox | ✅ | -| xbox360 | Xbox 360 | ✅ | -| xboxone | Xbox One | ✅ | +| 3ds | Nintendo 3DS | ✅ | +| amiga | Amiga | ✅ | +| arcade | Arcade | ✅ | +| atari | atari | ❌ | +| coleco | coleco | ❌ | +| c64 | Commodore C64/128/MAX | ✅ | +| cpc | cpc | ❌ | +| cps1 | cps1 | ❌ | +| cps2 | cps2 | ❌ | +| cps3 | cps3 | ❌ | +| daphne | daphne | ❌ | +| dc | Dreamcast | ✅ | +| dos | DOS | ✅ | +| fairchild | fairchild | ❌ | +| fba2012 | fba2012 | ❌ | +| fbneo | fbneo | ❌ | +| fds | Family Computer Disk System | ✅ | +| gb | Game Boy | ✅ | +| gba | Game Boy Advance | ✅ | +| gbc | Game Boy Color | ✅ | +| gg | gg | ❌ | +| gw | gw | ❌ | +| intellivision | Intellivision | ✅ | +| jaguar | Atari Jaguar | ✅ | +| lynx | Atari Lynx | ✅ | +| md | md | ❌ | +| megaduck | megaduck | ❌ | +| ms | ms | ❌ | +| msx | MSX | ✅ | +| n64 | Nintendo 64 | ✅ | +| nds | Nintendo DS | ✅ | +| neocd | neocd | ❌ | +| neogeo | neogeo | ❌ | +| nes | Nintendo Entertainment System | ✅ | +| ngc | Nintendo GameCube | ✅ | +| ngp | ngp | ❌ | +| odyssey | odyssey | ❌ | +| pce | pce | ❌ | +| pcecd | pcecd | ❌ | +| pico | pico | ❌ | +| poke | poke | ❌ | +| ps | PlayStation | ✅ | +| ps2 | PlayStation 2 | ✅ | +| ps3 | PlayStation 3 | ✅ | +| ps4 | ps4 | ❌ | +| psp | PlayStation Portable | ✅ | +| psvita | PlayStation Vita | ✅ | +| scummvm | scummvm | ❌ | +| segacd | Sega CD | ✅ | +| segasgone | segasgone | ❌ | +| sgb | sgb | ❌ | +| sgfx | sgfx | ❌ | +| snes | Super Nintendo Entertainment System | ✅ | +| supervision | supervision | ❌ | +| switch | Nintendo Switch | ✅ | +| wii | Wii | ✅ | +| win | PC (Microsoft Windows) | ✅ | +| wiiu | Wii U | ✅ | +| wonderswan | WonderSwan | ✅ | +| wonderswan-color| WonderSwan Color | ✅ | +| xbox | Xbox | ✅ | +| xbox360 | Xbox 360 | ✅ | +| xboxone | Xbox One | ✅ | ## 📑 Tags support diff --git a/backend/src/handler/igdb_handler.py b/backend/src/handler/igdb_handler.py index 5447633a7..64e0125ae 100644 --- a/backend/src/handler/igdb_handler.py +++ b/backend/src/handler/igdb_handler.py @@ -123,7 +123,7 @@ class IGDBHandler(): for rom in matched_roms: try: res_details: dict = requests.post("https://api.igdb.com/v4/covers/", headers=self.headers, - data=f"fields url; where game={rom['id']};").json()[0] + data=f"fields url; where game={rom['id']};").json()[0] rom['url_cover'] = f"https:{res_details['url']}".replace('t_thumb', f't_cover_big') except IndexError: rom['url_cover'] = DEFAULT_URL_COVER_L @@ -132,6 +132,21 @@ class IGDBHandler(): else: log.warning(f"{p_slug} is not supported!") return matched_roms + + def get_matched_roms_by_id(self, igdb_id: str) -> list: + matched_roms: list[dict] = [] + matched_roms: list = requests.post("https://api.igdb.com/v4/games/", headers=self.headers, + data=f"fields name, id, slug, summary; where id={igdb_id};").json() + for rom in matched_roms: + try: + res_details: dict = requests.post("https://api.igdb.com/v4/covers/", headers=self.headers, + data=f"fields url; where game={rom['id']};").json()[0] + rom['url_cover'] = f"https:{res_details['url']}".replace('t_thumb', f't_cover_big') + except IndexError: + rom['url_cover'] = DEFAULT_URL_COVER_L + rom['r_igdb_id'] = rom.pop('id') + rom['r_slug'] = rom.pop('slug') + return matched_roms diff --git a/backend/src/main.py b/backend/src/main.py index 3d21f3c3c..27ac9d05d 100644 --- a/backend/src/main.py +++ b/backend/src/main.py @@ -21,14 +21,14 @@ def startup() -> None: @app.get("/scan") -def scan(platforms_to_scan: str, full_scan: bool=False) -> dict: +def scan(platforms: str, full_scan: bool=False) -> dict: """Scan platforms and roms and write them in database.""" log.info(emoji.emojize(":magnifying_glass_tilted_right: Scanning ")) fs.store_default_resources() fs_platforms: list[str] = fs.get_platforms() - platforms: list[str] = json.loads(platforms_to_scan) if len(json.loads(platforms_to_scan)) > 0 else fs_platforms - log.info(f"Platforms detected: {', '.join(platforms)}") + platforms: list[str] = json.loads(platforms) if len(json.loads(platforms)) > 0 else fs_platforms + log.info(f"Platforms to be scanned: {', '.join(platforms)}") for p_slug in platforms: log.info(emoji.emojize(f":video_game: {p_slug} {COLORS['reset']}")) platform: Platform = fastapi.scan_platform(p_slug) @@ -112,13 +112,17 @@ def remove_rom(p_slug: str, file_name: str, filesystem: bool=False) -> dict: @app.put("/search/roms/igdb") -async def search_rom_igdb(req: Request) -> dict: +async def search_rom_igdb(req: Request, igdb_id: str=None) -> dict: """Get all the roms matched from igdb.""" data: dict = await req.json() log.info(emoji.emojize(":magnifying_glass_tilted_right: IGDB Searching")) - log.info(emoji.emojize(f":video_game: {data['rom']['p_slug']}: {COLORS['orange']}{data['rom']['file_name']}{COLORS['reset']}")) - matched_roms = igdbh.get_matched_roms(data['rom']['file_name'], data['rom']['p_igdb_id'], data['rom']['p_slug']) + if igdb_id: + log.info(f"Searching by id: {igdb_id}") + matched_roms = igdbh.get_matched_roms_by_id(igdb_id) + else: + log.info(emoji.emojize(f":video_game: {data['rom']['p_slug']}: {COLORS['orange']}{data['rom']['file_name']}{COLORS['reset']}")) + matched_roms = igdbh.get_matched_roms(data['rom']['file_name'], data['rom']['p_igdb_id'], data['rom']['p_slug']) log.info("Results:") [log.info(f"\t - {COLORS['blue']}{rom['name']}{COLORS['reset']}") for rom in matched_roms] return {'data': matched_roms} diff --git a/frontend/.env b/frontend/.env index 4cd46d6be..009fc3a8e 100644 --- a/frontend/.env +++ b/frontend/.env @@ -1 +1 @@ -VITE_ROMM_VERSION=1.6.3 \ No newline at end of file +VITE_ROMM_VERSION=1.6.4 \ No newline at end of file diff --git a/frontend/assets/platforms/wonderswan-color.ico b/frontend/assets/platforms/wonderswan-color.ico new file mode 100644 index 000000000..d9b16cfb0 Binary files /dev/null and b/frontend/assets/platforms/wonderswan-color.ico differ diff --git a/frontend/assets/platforms/wonderswan.ico b/frontend/assets/platforms/wonderswan.ico new file mode 100644 index 000000000..8382e0341 Binary files /dev/null and b/frontend/assets/platforms/wonderswan.ico differ diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 40497026e..ea9a765d0 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "romm", - "version": "1.6.3", + "version": "1.6.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "romm", - "version": "1.6.3", + "version": "1.6.4", "dependencies": { "@mdi/font": "7.0.96", "axios": "^1.3.4", diff --git a/frontend/package.json b/frontend/package.json index ff5bf24f4..a29a7420a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "romm", - "version": "1.6.3", + "version": "1.6.4", "private": true, "scripts": { "dev": "vite --host", diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 311fc8da4..c38c41017 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,47 +1,36 @@ diff --git a/frontend/src/components/AppBar/Base.vue b/frontend/src/components/AppBar/Base.vue new file mode 100644 index 000000000..e87997fdc --- /dev/null +++ b/frontend/src/components/AppBar/Base.vue @@ -0,0 +1,42 @@ + + + diff --git a/frontend/src/components/AppBar/PlatformsBtn.vue b/frontend/src/components/AppBar/PlatformsBtn.vue new file mode 100644 index 000000000..8b6bb73d4 --- /dev/null +++ b/frontend/src/components/AppBar/PlatformsBtn.vue @@ -0,0 +1,22 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/AppBar/RomMIcon.vue b/frontend/src/components/AppBar/RomMIcon.vue new file mode 100644 index 000000000..2b7666968 --- /dev/null +++ b/frontend/src/components/AppBar/RomMIcon.vue @@ -0,0 +1,11 @@ + diff --git a/frontend/src/components/AppBar/SearchBar.vue b/frontend/src/components/AppBar/SearchBar.vue new file mode 100644 index 000000000..f16c45cc9 --- /dev/null +++ b/frontend/src/components/AppBar/SearchBar.vue @@ -0,0 +1,23 @@ + + + diff --git a/frontend/src/components/AppBar/SettingsBtn.vue b/frontend/src/components/AppBar/SettingsBtn.vue new file mode 100644 index 000000000..331d47d16 --- /dev/null +++ b/frontend/src/components/AppBar/SettingsBtn.vue @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/AppBar/UploadBtn.vue b/frontend/src/components/AppBar/UploadBtn.vue new file mode 100644 index 000000000..750e80fbc --- /dev/null +++ b/frontend/src/components/AppBar/UploadBtn.vue @@ -0,0 +1,19 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/GameCard/ActionBar.vue b/frontend/src/components/GameCard/ActionBar.vue new file mode 100644 index 000000000..0dbc206b6 --- /dev/null +++ b/frontend/src/components/GameCard/ActionBar.vue @@ -0,0 +1,37 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/GameCard/Base.vue b/frontend/src/components/GameCard/Base.vue new file mode 100644 index 000000000..bcc21d449 --- /dev/null +++ b/frontend/src/components/GameCard/Base.vue @@ -0,0 +1,42 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/GameCard/Cover.vue b/frontend/src/components/GameCard/Cover.vue new file mode 100644 index 000000000..f9d9e4595 --- /dev/null +++ b/frontend/src/components/GameCard/Cover.vue @@ -0,0 +1,56 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/Navigation.vue b/frontend/src/components/Navigation.vue deleted file mode 100644 index 55abd72e7..000000000 --- a/frontend/src/components/Navigation.vue +++ /dev/null @@ -1,198 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/src/components/Notification.vue b/frontend/src/components/Notification.vue new file mode 100644 index 000000000..50d19b310 --- /dev/null +++ b/frontend/src/components/Notification.vue @@ -0,0 +1,24 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/PlatformsDrawer/Base.vue b/frontend/src/components/PlatformsDrawer/Base.vue new file mode 100644 index 000000000..11411f4bb --- /dev/null +++ b/frontend/src/components/PlatformsDrawer/Base.vue @@ -0,0 +1,44 @@ + + + diff --git a/frontend/src/components/PlatformsDrawer/Platform.vue b/frontend/src/components/PlatformsDrawer/Platform.vue new file mode 100644 index 000000000..743a6d957 --- /dev/null +++ b/frontend/src/components/PlatformsDrawer/Platform.vue @@ -0,0 +1,42 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/PlatformsDrawer/RailBtn.vue b/frontend/src/components/PlatformsDrawer/RailBtn.vue new file mode 100644 index 000000000..713844969 --- /dev/null +++ b/frontend/src/components/PlatformsDrawer/RailBtn.vue @@ -0,0 +1,19 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/RomsGallery.vue b/frontend/src/components/RomsGallery.vue deleted file mode 100644 index 17e262700..000000000 --- a/frontend/src/components/RomsGallery.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/src/components/SettingsDrawer/Base.vue b/frontend/src/components/SettingsDrawer/Base.vue new file mode 100644 index 000000000..b7e114b01 --- /dev/null +++ b/frontend/src/components/SettingsDrawer/Base.vue @@ -0,0 +1,39 @@ + + + diff --git a/frontend/src/components/SettingsDrawer/Header.vue b/frontend/src/components/SettingsDrawer/Header.vue new file mode 100644 index 000000000..ba445efd5 --- /dev/null +++ b/frontend/src/components/SettingsDrawer/Header.vue @@ -0,0 +1,20 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/SettingsDrawer/Scan.vue b/frontend/src/components/SettingsDrawer/Scan.vue new file mode 100644 index 000000000..f7f6bd849 --- /dev/null +++ b/frontend/src/components/SettingsDrawer/Scan.vue @@ -0,0 +1,80 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/SettingsDrawer/ThemeToggle.vue b/frontend/src/components/SettingsDrawer/ThemeToggle.vue new file mode 100644 index 000000000..dbac4efe9 --- /dev/null +++ b/frontend/src/components/SettingsDrawer/ThemeToggle.vue @@ -0,0 +1,26 @@ + + + \ No newline at end of file diff --git a/frontend/src/components/SettingsDrawer/VersionLabel.vue b/frontend/src/components/SettingsDrawer/VersionLabel.vue new file mode 100644 index 000000000..34d6b1b1a --- /dev/null +++ b/frontend/src/components/SettingsDrawer/VersionLabel.vue @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 0f255f8d3..fae2377e8 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -4,11 +4,11 @@ import { createRouter, createWebHistory } from 'vue-router' const routes = [ { path: '/', - component: () => import('@/components/RomsGallery.vue') + component: () => import('@/views/Gallery.vue') }, { path: '/details', - component: () => import('@/components/RomDetails.vue') + component: () => import('@/views/Details.vue') } ] diff --git a/frontend/src/utils/utils.js b/frontend/src/utils/utils.js index 81a2a0c51..1e3e89a1c 100644 --- a/frontend/src/utils/utils.js +++ b/frontend/src/utils/utils.js @@ -4,28 +4,22 @@ import { saveAs } from 'file-saver' export async function downloadRom(rom, emitter, filesToDownload=[]) { - console.log("Downloading "+rom.file_name) emitter.emit('snackbarScan', {'msg': "Downloading "+rom.file_name+"...", 'icon': 'mdi-download', 'color': 'green'}) if(rom.multi){ + const zip = new JSZip() + var zipFilename = rom.file_name+".zip" var files = [] toRaw(filesToDownload).forEach(f => {files.push(toRaw(f))}) - var zipFilename = rom.file_name+".zip" - const zip = new JSZip() - var count = 0 if (files.length == 0){ files = rom.files } + var count = 0 files.forEach(async function (file_part) { var file_full_path = "/assets"+rom.file_path+"/"+rom.file_name+"/"+file_part - console.log("downloading part: "+file_full_path) var file = await fetch(file_full_path) var fileBlob = await file.blob() var f = zip.folder(rom.file_name); f.file(file_part, fileBlob, { binary: true }); count ++ - if (count == files.length) { - zip.generateAsync({ type: 'blob' }).then(function (content) { - saveAs(content, zipFilename); - }); - } + if (count == files.length) { zip.generateAsync({ type: 'blob' }).then(function (content) { saveAs(content, zipFilename); }); } }) } else{ @@ -36,6 +30,6 @@ export async function downloadRom(rom, emitter, filesToDownload=[]) { } } -export async function downloadSave(rom, emitter) { - console.log("Downloading "+rom.file_name+" save file") -} +export async function downloadSave(rom, emitter) { console.log("Downloading "+rom.file_name+" save file") } + +export function normalizeString(s) { return s.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g,"") } \ No newline at end of file diff --git a/frontend/src/components/RomDetails.vue b/frontend/src/views/Details.vue similarity index 92% rename from frontend/src/components/RomDetails.vue rename to frontend/src/views/Details.vue index 3353d49a2..719cbae4c 100644 --- a/frontend/src/components/RomDetails.vue +++ b/frontend/src/views/Details.vue @@ -8,6 +8,7 @@ import { downloadRom, downloadSave } from '@/utils/utils.js' const rom = ref(JSON.parse(localStorage.getItem('currentRom')) || '') const saveFiles = ref(false) const searching = ref(false) +const igdb_id = ref('') const matchedRoms = ref([]) const updating = ref(false) const editedRomName = ref(rom.value.file_name) @@ -27,11 +28,9 @@ emitter.on('currentRom', (currentRom) => { rom.value = currentRom }) async function searchRomIGDB() { searching.value = true dialogSearchRom.value = true - console.log("searching for rom... "+rom.value.file_name) - await axios.put('/api/search/roms/igdb', { + await axios.put('/api/search/roms/igdb?igdb_id='+igdb_id.value, { rom: rom.value }).then((response) => { - console.log(response.data.data) matchedRoms.value = response.data.data }).catch((error) => {console.log(error)}) searching.value = false @@ -48,12 +47,10 @@ async function updateRom(updatedRom=Object.assign({},rom.value), newName=rom.val else{ updatedRom.file_name = newName } - console.log(rom.value) await axios.patch('/api/platforms/'+rom.value.p_slug+'/roms', { rom: rom.value, updatedRom: updatedRom }).then((response) => { - console.log('updated rom: '+JSON.stringify(rom.value)) localStorage.setItem('currentRom', JSON.stringify(response.data.data)) emitter.emit('snackbarScan', {'msg': rom.value.file_name+" updated successfully!", 'icon': 'mdi-check-bold', 'color': 'green'}) rom.value = response.data.data @@ -66,10 +63,8 @@ async function updateRom(updatedRom=Object.assign({},rom.value), newName=rom.val } async function deleteRom() { - console.log('deleting rom '+ rom.value.file_name) await axios.delete('/api/platforms/'+rom.value.p_slug+'/roms/'+rom.value.file_name+'?filesystem='+deleteFromFs.value) .then((response) => { - console.log(response) emitter.emit('snackbarScan', {'msg': rom.value.file_name+" deleted successfully!", 'icon': 'mdi-check-bold', 'color': 'green'}) router.push(import.meta.env.BASE_URL) }).catch((error) => { @@ -100,7 +95,14 @@ async function deleteRom() { - + + + @@ -142,13 +144,10 @@ async function deleteRom() { Platform{{ rom.p_slug }} Size{{ rom.file_size }} MB - IGDB id{{ rom.r_igdb_id }} Region{{ rom.region }} Revision{{ rom.revision }} Tags{{ tag }} - - Summary{{ rom.summary }} @@ -157,14 +156,30 @@ async function deleteRom() { + Searching... mdi-close + Results found mdi-close + + +
diff --git a/frontend/src/views/Gallery.vue b/frontend/src/views/Gallery.vue new file mode 100644 index 000000000..fd66abbac --- /dev/null +++ b/frontend/src/views/Gallery.vue @@ -0,0 +1,63 @@ + + +