Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

[Bug]: Search does not work properly #390

Closed
1 task done
h0ckerman opened this issue Feb 8, 2022 · 1 comment
Closed
1 task done

[Bug]: Search does not work properly #390

h0ckerman opened this issue Feb 8, 2022 · 1 comment
Labels
bug Something isn't working renderer Issue or feature related to the renderer process of Cider.

Comments

@h0ckerman
Copy link
Contributor

h0ckerman commented Feb 8, 2022

Describe the Bug

Search does not work properly using russian keyboard layout.

search

Steps to Reproduce

  1. Open Recently Added/Songs/Albums/Artists tab
  2. Write something using Russian layout in the search

Environment Information

  • OS: Win 10 21H1 19043.1165
  • App Version: Latest as of now(main branch)
  • Commit ID: 424b22f

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@h0ckerman h0ckerman added bug Something isn't working needs-triage Awaiting triage. labels Feb 8, 2022
@coredev-uk coredev-uk added renderer Issue or feature related to the renderer process of Cider. and removed needs-triage Awaiting triage. labels Feb 11, 2022
@h0ckerman
Copy link
Contributor Author

h0ckerman commented Mar 2, 2022

It seems that the culprit for this is a regex that replaces every non-Latin character and number with nothing.
Commenting out this lines of code does help.

gif

But it still works kinda strange tbh

Lines of code:

For the songs page

Cider/src/renderer/index.js

Lines 2276 to 2280 in 9f81aa9

// remove any non-alphanumeric characters and spaces from search term and item name
searchTerm = searchTerm.replace(/[^a-z0-9 ]/gi, "")
itemName = itemName.replace(/[^a-z0-9 ]/gi, "")
artistName = artistName.replace(/[^a-z0-9 ]/gi, "")
albumName = albumName.replace(/[^a-z0-9 ]/gi, "")

Albums page

Cider/src/renderer/index.js

Lines 2345 to 2349 in 9f81aa9

// remove any non-alphanumeric characters and spaces from search term and item name
searchTerm = searchTerm.replace(/[^a-z0-9 ]/gi, "")
itemName = itemName.replace(/[^a-z0-9 ]/gi, "")
artistName = artistName.replace(/[^a-z0-9 ]/gi, "")
albumName = albumName.replace(/[^a-z0-9 ]/gi, "")

Artists page

Cider/src/renderer/index.js

Lines 2410 to 2412 in 9f81aa9

// remove any non-alphanumeric characters and spaces from search term and item name
searchTerm = searchTerm.replace(/[^a-z0-9 ]/gi, "")
itemName = itemName.replace(/[^a-z0-9 ]/gi, "")

PS: I'm not a professional and i do not know how to edit this regex expression but i hope that this will help to get rid of this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working renderer Issue or feature related to the renderer process of Cider.
Projects
Status: Completed 🚀
Development

No branches or pull requests

2 participants