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: WSH/JSP/SMP Properties example with "fuzzy" filter value interpretation on click (Read 317 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

WSH/JSP/SMP Properties example with "fuzzy" filter value interpretation on click

As the title says, we currently brainstom here about and I would like to share the question here if it is possible to extend the wonderful and very useful Properties sample in WSH/SJP/SMP panel example script with the possibility to match also with slidely alternating but almost similar or slang varations of a clicked name or title? In the moment it must fit exactly to be listed in the filtered value view autoplaylist created after clicking on the field value in the properties window. But it woud be great if it would be more "open" to alternations of that string like Google does. Or maybe optional with common settings like "as is (exact phrase)" or "words in random order" "slang" "error prone" ...

Example: The title says "Feel like making love", clicking on it will show items with same field value now but items with an accidently added whitespace more in between the words or if the title says "Feel like makin' love" instead will be ignored. Since such variations are very common even on cover versions it would be useful to extend the string functionality with such algroythms.

In the moment we collect examples from other scripting languages, etc. regarding more relaxed or more intelligent string comparision for language strings and try to compare them with the code in Properties and what would be the best way to do it. It will certainly become a more complex issue than maybe expected. Complex regex and a list of common widely used alternations in all langues. A 100% solution will not be possible of course...

Here an example script called Fuse showing a possible way to implement a fuzzy search: https://fusejs.io/

Another issue (rather for typed search) but for completeness sake since there are other interesting links in it: https://hydrogenaud.io/index.php?topic=97427.0

Re: WSH/JSP/SMP Properties example with "fuzzy" filter value interpretation on click

Reply #1
IMHO it's never a good idea to edit the sample scripts, especially the ones in the "complete" folder because you'll eventually end up messing with the common scripts in the "JS" folder.  I believe these scripts are meant as case studies. for learning (and if they are not, I think they should be).
So, for instance, to achieve what you are asking for, you will likely have to edit the query pattern that is executed after clicking, but you won't find it in the" properties.js" script. Instead it is defined in the "list.js" script, which might affect other complete samples (such as "autoplaylists.js", "musicbrainz.js", "queue viewer,js", etc.) and even other callbacks in the "properties.js" script itself, which you are not planning to modify.
My advise is to write your own, perhaps along the line of the sample, once you understand its logic. It might seem the long way, but it will save you many headaches if you plan to mess with it. At least that's my experience (as a non-developer javascript noob) with complex script systems, such as these complete samples actually are.
I'm late

 
SimplePortal 1.0.0 RC1 © 2008-2021