Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Remove duplicates from favorites on-the-fly #994

Merged
merged 5 commits into from
Jul 13, 2023

Conversation

Aemiii91
Copy link
Member

@Aemiii91 Aemiii91 commented Jul 9, 2023

Problem

Favorites still gets corrupted sometimes. It happens when we share rom folders between Verified, Expert, or Search.

This:

{"label":"Earthworm Jim (U)","launch":"/mnt/SDCARD/Emu/GBA/launch.sh","type":5,"rompath":"/mnt/SDCARD/RApp/gpsp/../../Roms/GBA/Earthworm Jim (U).zip"}
{"label":"Earthworm Jim 2 (U)","launch":"/mnt/SDCARD/Emu/GBA/launch.sh","type":5,"rompath":"/mnt/SDCARD/RApp/gpsp/../../Roms/GBA/Earthworm Jim 2 (U).zip"}
{"label":"Ecks vs. Sever (U) (M5)","launch":"/mnt/SDCARD/Emu/GBA/launch.sh","type":5,"rompath":"/mnt/SDCARD/RApp/gpsp/../../Roms/GBA/Ecks vs. Sever (U) (M5).zip"}
{"label":"Earthworm Jim (U)","launch":"/mnt/SDCARD/Emu/GBA/launch.sh","type":5,"rompath":"/mnt/SDCARD/Emu/GBA/../../Roms/GBA/Earthworm Jim (U).zip"}
{"label":"Earthworm Jim 2 (U)","launch":"/mnt/SDCARD/Emu/GBA/launch.sh","type":5,"rompath":"/mnt/SDCARD/Emu/GBA/../../Roms/GBA/Earthworm Jim 2 (U).zip"}
{"label":"Ecks vs. Sever (U) (M5)","launch":"/mnt/SDCARD/Emu/GBA/launch.sh","type":5,"rompath":"/mnt/SDCARD/Emu/GBA/../../Roms/GBA/Ecks vs. Sever (U) (M5).zip"}

Will get mangled into this:

{"label":"Earthworm Jim (U)","launch":"/mnt/SDCARD/Emu/GBA/launch.sh","rompath":"/mnt/SDCARD/RApp/gpsp/../../Roms/GBA/Earthworm Jim (U).zip","imgpath":"","type":5}
{"label":"Earthworm Jim (U)","launch":"/mnt/SDCARD/Emu/GBA/launch.sh","rompath":"/mnt/SDCARD/RApp/gpsp/../../Roms/GBA/Earthworm Jim (U).zip","imgpath":"","type":5,"label":"Earthworm Jim 2 (U)","launch":"/mnt/SDCARD/Emu/GBA/launch.sh","rompath":"/mnt/SDCARD/RApp/gpsp/../../Roms/GBA/Earthworm Jim 2 (U).zip","imgpath":"","type":5}
{"label":"Earthworm Jim (U)","launch":"/mnt/SDCARD/Emu/GBA/launch.sh","rompath":"/mnt/SDCARD/RApp/gpsp/../../Roms/GBA/Earthworm Jim (U).zip","imgpath":"","type":5,"label":"Earthworm Jim 2 (U)","launch":"/mnt/SDCARD/Emu/GBA/launch.sh","rompath":"/mnt/SDCARD/RApp/gpsp/../../Roms/GBA/Earthworm Jim 2 (U).zip","imgpath":"","type":5,"label":"Ecks vs. Sever (U) (M5)","launch":"/mnt/SDCARD/Emu/GBA/launch.sh","rompath":"/mnt/SDCARD/RApp/gpsp/../../Roms/GBA/Ecks vs. Sever (U) (M5).zip","imgpath":"","type":5}

To reproduce:

  • have Games -> GBA and Expert -> gpSP installed
  • first I had MainUI scan the expert folder, then added 3 games to favorites
  • then I refreshed roms, and had the normal GBA emu scanned, and added the same 3 games

Miyoo's fix seems to be comparing the string value of the rom paths for restricting double-favoriting - when in reality they should be comparing the absolute paths:

/mnt/SDCARD/RApp/gpsp/../../Roms/GBA/Earthworm Jim (U).zip
<>
/mnt/SDCARD/Emu/GBA/../../Roms/GBA/Earthworm Jim (U).zip

Comparing absolute paths:
/mnt/SDCARD/Roms/GBA/Earthworm Jim (U).zip
<>
/mnt/SDCARD/Roms/GBA/Earthworm Jim (U).zip

Changes

  • Updated favfix tool to use absolute paths for duplicate detection
  • Added favorites change detection to keymon

@Aemiii91 Aemiii91 added this to the v4.2 milestone Jul 9, 2023
@Aemiii91 Aemiii91 self-assigned this Jul 9, 2023
@Aemiii91 Aemiii91 marked this pull request as ready for review July 9, 2023 21:15
@Aemiii91 Aemiii91 merged commit 1315dc7 into main Jul 13, 2023
3 checks passed
@Aemiii91 Aemiii91 deleted the fix-favorites-on-the-fly branch July 13, 2023 19:31
@Aemiii91 Aemiii91 added the bug in onion Something isn't working label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug in onion Something isn't working
Projects
Status: 💣 Test
Development

Successfully merging this pull request may close these issues.

1 participant