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

Add "Fuzzy" search #523

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Conversation

bagelbyheart
Copy link
Contributor

This branch adds fuzzy search to ludo via a few mechanisms.

  • FindByCRC now fails through to FindByROMName
  • FindByROMName is now tried again with increasingly stripped titles until failure
  • Match Status is now recorded to console

This branch also includes the same fixes as #521 and addresses #453

@bagelbyheart bagelbyheart mentioned this pull request Feb 19, 2024
@bagelbyheart
Copy link
Contributor Author

I'm not sure why it's complaining about apt on those two builds, they worked on the previous one and those commands haven't changed. Hopefully something temporary on the github side of the VMs.

mu sync.Mutex
found bool
}
game_found := SafeBool{found: false}
Copy link
Contributor

@igorcafe igorcafe Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't analyze it deeply, but do you really need a mutex or a atomic.Bool fits your needs?

game_found.mu.Unlock()
} else {
var gameName = strings.Split(romName, ".")[0]
var gameExt = strings.Split(romName, ".")[1]
Copy link
Contributor

@igorcafe igorcafe Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the file may contain multiple dots or even no dots.
I guess you could use filepath.Ext.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants