Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Tweak "quicksearch for same" to ignore certain characters (Read 2664 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Tweak "quicksearch for same" to ignore certain characters

I am clumsy about formatting ... anyway, I would want "Quicksearch for same" to ignore (I) a certain set of characters, and (II) another certain set of characters and everything following those. Doable?

Tweak "quicksearch for same" to ignore certain characters

Reply #1
No.

Tweak "quicksearch for same" to ignore certain characters

Reply #2
Ignoring actual character sets would require the use of regular expressions which isn't possible, but that doesn't mean what you want to do is impossible, only that it might take some "creative" (to put it nicely) title formatting to achieve it.

Can you explain what you mean by "set of characters" or provide some examples?

Tweak "quicksearch for same" to ignore certain characters

Reply #3
Can you explain what you mean by "set of characters" or provide some examples?


* Example: "The " and ", The". So that
Beatles
Beatles, The
The Beatles
all show up when I quicksearch for same artist.

* Example: parentheses / brackets. So that
tracktitle remix
tracktitle (remix)
tracktitle [remix]
all show up when I quicksearch for same title

I could also want a filter that removes everything between parentheses, so that tracktitle [remix] matches tracktitle. But then I also need to get rid of the space, right?

Tweak "quicksearch for same" to ignore certain characters

Reply #4
I thought you were asking to ignore a character set such as a non-Latin alphabet, but your examples are strings, not sets.

"Quicksearch for same" uses an IS argument, meaning any matches must be exact. Stripping off your strings is fairly easy, but the component would have to use a HAS argument to achieve what you want.

I suggest that you standardize your artist tags or at least create a tag that can be used for returning all variants of the artist's name.

Personally, I use the SUBTITLE tag in MP3s and a VERSION tag in FLACs to store information like Remix, Live, etc. so that searching by title returns all versions of it.

Tweak "quicksearch for same" to ignore certain characters

Reply #5
"Quicksearch for same" uses an IS argument, meaning any matches must be exact.

Wildcard (e.g. *)can be used in arguments following IS.
To search for same artists ignoring leading The or trailing , The you can use the following string :
*$if($strstr(%artist%,',' The),$cut(%artist%,$sub($len(%artist%),5)),$stripprefix(%artist%))*

Tweak "quicksearch for same" to ignore certain characters

Reply #6
To search for same artists ignoring leading The or trailing , The you can use the following string :
*$if($strstr(%artist%,',' The),$cut(%artist%,$sub($len(%artist%),5)),$stripprefix(%artist%))*


Thank you. Now this works if I highlight a track with artist "Clash" - then it finds all tracks with artist "Clash" or "Clash, The". However, if I do highlight a track with "Clash, The" ...

Tweak "quicksearch for same" to ignore certain characters

Reply #7
Wildcard (e.g. *)can be used in arguments following IS.
To search for same artists ignoring leading The or trailing , The you can use the following string :
*$if($strstr(%artist%,',' The),$cut(%artist%,$sub($len(%artist%),5)),$stripprefix(%artist%))*

Sorry. I always forget about the wildcard. At least I'm consistent 

To search for same artists ignoring leading The or trailing , The you can use the following string :
*$if($strstr(%artist%,',' The),$cut(%artist%,$sub($len(%artist%),5)),$stripprefix(%artist%))*

Thank you. Now this works if I highlight a track with artist "Clash" - then it finds all tracks with artist "Clash" or "Clash, The". However, if I do highlight a track with "Clash, The" ...

Try this slight modification:
Code: [Select]
*$if($strstr(%artist%,', The'),$cut(%artist%,$sub($len(%artist%),5)),$stripprefix(%artist%))*

If that still fails with the trailing ", The", try this version. It's more specific with where it matches although it shouldn't make much of a difference:
Code: [Select]
*$if($stricmp($right(%artist%,5),', The'),$left(%artist%,$sub($len(%artist%),5)),$stripprefix(%artist%))*


Edited the content of the second code to remove an extra closing parenthesis which would cause it to fail. Apologies to anyone who tried to use it in the interim.