-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: filter models #261
feat: filter models #261
Conversation
Suggestion: I feel that this feature will be very error prone by the end user. Maybe we should use a string similarity algorithm like levenshtein distance (I have a Java implementation hat I can probably dig up...) or another lib to prevent something breaking because of something like the user entering rogstrix instead of rog strix? |
I see what you're saying, but I wouldn't want to over-complicate it either. With string comparisons it's common to compare lower/upper case user input to a matching lower/upper case value to eliminate case mismatching issues. Maybe in this case (for filtering models) we should remove all whitepsace when comparing the model name in the store config to what the user typed into their .env config |
Sounds like a plan; just giving my 2c. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I like it. Nicely done with the regex.
One comment I will make is that doing regex over and over again like this isn't the best thing to do.
One thing we should do next is do the filtering all before the program starts to parse through the pages, that way we've done all the setup we need to do. That's outside of this, but just a comment.
Thanks!
@@ -0,0 +1,62 @@ | |||
import {Config} from '../config'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was on my todo list to refactor this out. Love it!
Description
** Logging info on selected filters during startup
Testing
Test 1 - no filtering on models
Result:
Test 2 - filter on models
Results:
New dependencies
N/A