Playnite Forums
QuickSearch - Launch Games and Run Commands by Search - Printable Version

+- Playnite Forums (https://playnite.link/forum)
+-- Forum: Extension Database (https://playnite.link/forum/forum-3.html)
+--- Forum: Generic Extensions (https://playnite.link/forum/forum-6.html)
+--- Thread: QuickSearch - Launch Games and Run Commands by Search (/thread-677.html)

Pages: 1 2 3 4


QuickSearch - Launch Games and Run Commands by Search - felixkmh - 05-14-2021

[Image: clom1Dn.png]

[Image: XdVRcDf.png]

Extension that lets you open a search popup using a user-defined hotkey (Ctrl + F by default, overwriting the default behaviour of Playnite of focusing the search box).

Features:
  • Open via user-defined shortcut in Playnite or globally (optional)
  • Search and launch/install games by name
  • Search for emulated games by image/rom name
  • Search for games on IsThereAnyDeal.com either by just searching for a game that is not in your library, adding the user-defined override character (+ by default) at the end, or by searching for "itad" and activating the sub item source to only search on ITAD.
  • Search for games using CheapShark
  • Fuzzy search with configurable threshold
  • Run commands, e.g. opening settings, exit Playnite, open Fullscreen Mode and a few more. Type ">" to see built-in commands
  • Run commands added by other extensions, for example DuplicateHider.
  • Filtered Search: Type a source, installation status(installed/uninstalled), category, platfrom or company, select the filter and press enter. To add another filter, type "," or "&" (without quotation marks) and search for the next filter. At least one of the filters added with a "," or the first one has to be fulfilled by a game to be displayed. All filters added with "&" need to be fullfilled by game to be displayed. Search with applied filters as usual.
  • Type "Recently Played" or "Favorites" and activate the item to only show recently played games or favorites. Once acitvated, search as usual.
  • Details Preview for supported results
  • Support for ExtraMetadata logos in Game details view
  • Directly edit Settings of supported Extensions
  • Customizable appearance
  • Search and Install Extensions/Add-ons with the built-in Add-on Browser
  • Search games by acronyms. E.g. Counter-Strike Global Offensive -> csgo, Age of Empires II -> aoeii, Resident Evil 7 -> re7

Searching is fuzzy meaning that results are sorted by a score that represents how close a game name is to the search query instead of looking for an exact match.
You can set the minimal value (threshold) a result needs to be shown. 0 means every result is valid, 1 only accepts perfect matches. Default is 0.55. A higher threshold can also speed up the search. You can also choose to expand all items and show seperators between them in the in the plugin settings.
Results can be selected using the up and down arrow keys or by clicking them. A selected game can be launched/installed by pressing the Enter key or by double clicking.
To close the popup, click somewhere outside of it, press the Escape key or press the hotkey again.
The search score is a combination of different string difference metrics, let me know if there are cases that match poorly for you.

For extension developers:
Add Sources and Items:
The QuickSearchSDK can be used by adding a reference to "QuickSearchSDK.dll" to your extension's project. The namespace "QuickSearch" contains the static class "QuickSearchSDK" which provides some static methods to add game actions, single items and item sources. "QuickSearch.SearchItems" contains definitions for the used interfaces and a set of simple classes implementing each interface (Command*). The static class "QuickSearch.IconChars" contains some constants that can be used as the CharIcon of objects implementing the ISearchItem<string> interface. If you are using an IDE like Visual Studio you should also be able to see short descriptions for all classes, fields, functions and interfaces to see what they do.
Adding settings support:
The SDK also contains "QuickSearch.Attributes" which can simply be added to properties in the plugin's settings. This will allow the user to directly inspect/edit this setting using QuickSearch.

For guidelines and examples see the github wiki.

GitHub

Help by contributing translations: https://crowdin.com/project/quicksearch-for-playnite

[Image: localized.svg]

[Image: 61e11d430afb112ea33c3aa5_Button-1-p-500.png]

Releases:

For Playnite 9: Install, Latest Release

2.11.3
    - tweaked string matching algorithm
    - fixed error in score normalization
    - complete french translation by ClearStrelok

2.11.2
    - fixed acronym creation generating invalid unicode characters
    - partial french translation by ClearStrelok

2.11.1
    - words seperated by "-" are now considered to be two words (e.g. Counter-Strike: Global Offensive -> CSGO)

2.11.0
    - games can now be searched by acronyms made from the initials of each word in the game name
    - acronym feature can be disabled by setting the minimal acronym length to 0 in the options

2.10.2
    - only close details view if the selected item actually changes

2.10.1
    - fixed error in letter pair matching algorithm

2.10.0
    - tweaked string matching algorithm (might require to lower the threshold)
    - prioritize games over filter items
    - added changelogs to addon details view

2.9.0
    - Improved search performance
    - include addon tags in search when using the Addon-Browser
    - fixed matching algorithm not working correctly in some cases
    - fixed dropshadow on icons being cut off

2.8.2
    - fixed some layout issues

2.8.1
    - fixed search box height not being set correctly

2.8.0
    - prefer visible games if scores are equal
    - improved performance for the first filter layer
    - updated to PlayniteSDK 6.0.0
    - show extension icons for settings items
    - set fixed height for expanded items

2.7.0
    - screenshots in addon details can now be clicked to be enlarged or closed again
    - added links to addon details view

2.6.0
    - added addon browser

2.5.1
    - close logo files after loading them

2.5.0
    - added settings items for library and metadata plugins
    - added developers and publishers to details view

2.4.0
    - added options to change search window width and details view max width
    - fixed search results missing when returning from SubItemSource

2.3.3
    - fixed glass effect not working correctly if underlying view had transparent background

2.3.2
    - fixed crash if other plugins dont have their Properties property set

2.3.1
    - added details view option to settings view

2.3.0
    - added optional details view for games (supporting ExtraMetadata Logos) and itad results. Enabled by default

2.2.0
    - added action to open add-on menu
    - fixed resource name typo
    - fixed itad and cheapshark subitemsources names didnt use localization

2.1.1
    - fixed crash in some cases when opening the search window
    - fixed blurred background shifting when sidepanels open

2.0.0
    - Playnite 9 Betasupport, not compatible with Playnite 8!
    - Changed Id, so you need to uninstall before reinstalling!

For Playnite 8:
[attachment=1680]
  • show filter type and number of matching games on filter entries
[attachment=1668]
  • added option to search and apply multiple filters to the search, e.g. by installation status, source, company, category or platform (can impact loading times if enabled)
  • new entry for IsThereAnyDeal.com to only search online
  • some settings for plugins can be viewed/set from within the search window
  • support for ExtensionUpdater extension
  • bug fixes and performance improvements
[attachment=1669]
  • breaking changes
  • split into two assemblies
  • guidelines and examples in github wiki
  • added ISubItemSource and related interfaces
  • added static method to add plugin settings
  • added Attributes that can be attached to settings properties to display them in the search window (QuickSearchSDK.Attributes.dll)
[attachment=1663]
  • added option to set a global hotkey, that opens the search window even if the Playnite window is not in focus
[attachment=1662]
  • added Appearance tab in settings.
  • visual update, including a glass transparency effect and an adjustable border.
  • improved search for titles that contain special characters. For example "F.E.A.R." can be found by searching "fear".
[attachment=1657]
  • fixed shop list not updating in some cases
[attachment=1654]
  • search for games on IsThereAnyDeal.com. Only if the score of the best result is below a user-defined threshold. Can be disabled completely in new settings tab. Shop list will be populated the first time IsThereAnyDeal.com is queried.
[attachment=1655]
  • breaking changes
  • GetItemsTask() is called with the items that have been added in the synchronous stage of the search in addition to the query.
  • Should contain the last breaking changes for the near future
[attachment=1649]
  • added option to disambiguate by installation status before name if scores are equal
[attachment=1648]
  • hotfix: game icons not being used
[attachment=1646]
  • split plugin settings into tabs
  • added option to enable/disable items and game actions on a per extension basis
  • reworked auto scrolling for long text
  • added some shortcut commands. Type "> " to see available commands
[attachment=1645]
  • not backwards compatible, but should work as a drop-in replacement
  • made IconChars class public
  • changed the way commands are added
  • AddCommand now returns concrete type instead of interface, so its properties (like IconChar) can be quickly changed
[attachment=1644]
  • fixed text scrolling not resetting on deselection
[attachment=1642]
  • Visual improvements: search icon, bigger search box, loading indicator, scrolling of long texts in the bottom left corner, placeholder text, settings icon for settings command
  • option to set the delay before asynchronous items are requested, defaulted to 250 ms. This does not affect game search as that happens synchronously.
  • Added "Quote" commands as examples for asynchronous items.
  • Improved loading times when a lot of items need to be presented.
[attachment=1643]
  • allow asynchronously added search results, for example to present web search results of some kind.
  • ISearchItemSources can indicate to be dependent on the search query, which will defer the call to GetItems(query) and GetItemsTask(query) until the query can be passed, otherwise query might be null. This allows to only supply items if the query starts with a certain prefix, for example.
  • ISearchItems can set a Unicode character from the "icofont.ttf" font (included with Playnite) as their icon instead of an image by setting the IconChar property.
  • Added static class IconChars containing constants for some icon char unicodes.
  • Some improvements to the in-code documentation.
[attachment=1637]
  • Display action(s) in search box, can be cycled using Tab or Shift + Tab if multiple are available
  • Open settings via command
  • Search also considers rom names
  • Search Items and Commands can be added by other extensions using QuickSearchSDK assembly
  • Added options to enable items and commands from other extensions, disabled by default
[attachment=1638]
  • Just for extension development.
  • Can be added to other extension projects to supply Search Items, Commands and Game Actions. Use methods of static class "QuickSearch.QuickSearchSDK".
[attachment=1627]
  • adjusted score weights
  • added option to restrict maximum number of displayed results
  • check for empty strings
[attachment=1623]
  • fixed scrollbar not being hidden when appropriate
  • added option to lower the priority of adding results to the list (to improve responsiveness when search seems slow), disabled by default
[attachment=1620]
  • more responsive ui while loading results



RE: QuickSearch - Launch Games by Search - turtleship_ - 05-14-2021

(05-14-2021, 04:22 PM)felixkmh Wrote: [Image: grafik.png]

Extension that lets you open a search popup using a user-defined hotkey (Ctrl + F by default, overwriting the default behaviour of Playnite of focusing the search box).
Searching is fuzzy meaning that results are sorted by a score that represents how close a game name is to the search query instead of looking for an exact match.
You can set the minimal value (threshold) a result needs to be shown. 0 means every result is valid, 1 only accepts perfect matches. Default is 0.3.
Results can be selected using the up and down arrow keys or by clicking them. A selected game can be launched/installed by pressing the Enter key or by double clicking.
To close the popup, click somewhere outside of it or press the Escape key.

The search score is a combination of different string difference metrics, let me know if there are cases that match poorly for you.
Other than the ctrl+f behaviour, is any other default setting overwritten?


RE: QuickSearch - Launch Games by Search - felixkmh - 05-14-2021

Not intentionally, no. Only the default behaviour of the specified hotkey should be overwritten. Meaning that you get the default behaviour of Ctrl + F if you set the hotkey to something else (Ctrl + Shift + F for example) in the Plugin settings.


RE: QuickSearch - Launch Games by Search - darklinkpower - 05-15-2021

Nice, useful extension!

Some issues and suggestions:

- Pressing the keyboard combination when the search is open should close it
- Some games report incorrect time played. After investigating, it seems the time played resets every 24 hours (86,400 seconds) of time played :

[Image: 2nEM8Pc.png]
[Image: 4x1G5k0.png]

[Image: vWZ5Rgp.png]

[Image: fkoFDC2.png]

- Games with very long titles cause text to overlap:
[Image: P5wo40P.png]

Ideally I think there should be some system to determine the priority when games have the same name. For example, here it shows the xbox version first when it would make more sense to show the playable PC version instead. An idea for a priority system instead of a manually sortable list in settings, would be to sort by Play Count.
[Image: 0A3CqFw.png]

[Image: uFsR0iy.png]

Some general suggestions, related to how keyboard launchers work:
- I think the list would be better if it showed the games with icons all the time instead of just when selected, similar to a keyboard launcher. An image helps to quickly identify the item at a glance without needing to read the text and it also helps to improve the list visually.
- Having a lot of items in the list at once isn't always better, because the user more than likely only needs the first or first few items in the list that more match the search, but more items should be accessible by scrolling down. Personally I think 6 titles on view at a time should be enough
- Saving the previous search when opening can be useful. The search should be reset when typing again.

Example of a keyboard launcher:

[Image: o5cFNW5.png]


RE: QuickSearch - Launch Games by Search - felixkmh - 05-15-2021

Thanks for the feedback and suggestions Big Grin I made some changes according to your suggestions along with some other improvements and fixed the bugs you found in version 0.2.


RE: QuickSearch - Launch Games by Search - darklinkpower - 05-15-2021

Nice, that was fast. Some things I forgot to mention and that are related:

The game name should be aligned even if games don't have an icon, because it's difficult to read a list where some games have and some games don't have an icon. The fix would be to reserve the icon area for the icon even if the game doesn't have one. This is the current reading path:

[Image: lSxIA2F.png]

I think only having the selected item show more information is not a good idea, because it changes the positioning of all the elements. Open the two images in two tabs and switch back and forth to see what I mean:

[Image: mJkD3Ff.png]

[Image: ltI72lY.png]

Refer to "Battletoads" that is selected in the second image; The positioning of the game name has moved significantly higher than when in its previous, unselected positioning. This makes it difficult to read, because items and its elements will change position when selection changes. The solution is to always show all the data in all items, including platform and time played, never changing the elements based whether they are selected or not. The glypbrush should be more than enough for the selected element. Also having the extra info always showing means you don't have to select the item to know its info, you can do so just by a glance. This is exactly how keyboard launchers work, I suspect for this same very reason.

Lastly, the item hierarchy should be in the game name and having all the text use the same foreground can make it more difficult to read. Ideally the extra info of platform and time played should be slightly darker, perhaps using the dark or darker brush in themes, although the issue is if some custom theme removed those brushes. Maybe lowering the opacity just a little bit could help, but I'm not really sure. This point may not have a fix I think.


RE: QuickSearch - Launch Games by Search - felixkmh - 05-15-2021

Again, thanks for the feedback. I made some changes in Version 0.3. I didn't want an empty space to the left of the text so I set the icon to be the Playnite icon if none exists. And I changed text opacity and font weights such that the title pops out a little more than the rest.
Also, I added two options to the plugin settings so you can have all items be expanded and show seperators between them, but they are disabled by default.


RE: QuickSearch - Launch Games by Search - darklinkpower - 05-16-2021

Excellent, great work!


RE: QuickSearch - Launch Games and Run Commands by Search - felixkmh - 05-22-2021

Version 0.5 comes with the ability to add custom commands and game actions, also by other extensions if they add a reference to the QuickSearchSDK.dll assembly to their project. If anyone takes a shot at it, let me know how it is working out and if the API is easy enough to use just by having the in-code documentation and if there are features you feel are missing.


RE: QuickSearch - Launch Games and Run Commands by Search - felixkmh - 05-26-2021

Uploaded Version 1.1


RE: QuickSearch - Launch Games and Run Commands by Search - felixkmh - 06-04-2021

Uploaded Version 1.4
Changes:
- added Appearance tab in settings.
- visual update, including a glass transparency effect and an adjustable border.
- improved search for titles that contain special characters. For example "F.E.A.R." can be found by searching "fear".


RE: QuickSearch - Launch Games and Run Commands by Search - darklinkpower - 06-05-2021

That glass transparency effect looks great! I could probably use that in a theme, do you think you can share how you achieved that effect? From what I see you used an image for the window background?


RE: QuickSearch - Launch Games and Run Commands by Search - felixkmh - 06-05-2021

I actually use the entire Playnite window as VisualBrush that I set as the background for some Border of the size I need. I then use a BlurEffect on that border and overlay it with a noise texture and the PopupBackgroundBrush with low opacity. This is what I then use as the background for the search window by using another VisualBrush. Not sure how usable this approach would be for a theme, as I use some code-behind to make it work, in particular to get the Visual of the Playnite window and setting up some Viewports correctly. Also, I make use of the fact that the search popup is always centered in the main window, which makes aligning everything very simple.


RE: QuickSearch - Launch Games and Run Commands by Search - darklinkpower - 06-05-2021

Got it, thanks for the info. Turned out more complicated than I thought it would be. Such a shame that WPF doesn't have a good way to achieve this effect with ease, it would be great for some nice things.


RE: QuickSearch - Launch Games and Run Commands by Search - felixkmh - 06-13-2021

Uploaded version 1.5 and SDK 1.3


RE: QuickSearch - Launch Games and Run Commands by Search - felixkmh - 10-20-2021

Updated initial post with current features and changelogs since Playnite 9


RE: QuickSearch - Launch Games and Run Commands by Search - Xenor - 10-25-2021

Wowzee, I've just discovered the extension scrolling through the addon browser, great work Smile.


RE: QuickSearch - Launch Games and Run Commands by Search - SasquatchBurger - 11-17-2021

This is a great extension, I probably use this the most with the Global Search. I did notice in settings however that there is a typo.

Under the Common tab, for setting the Global Hotkey, it has been spelt 'Gloabl hotkey...'


RE: QuickSearch - Launch Games and Run Commands by Search - Giodude - 03-25-2022

Is there a way you can get this to work in full screen mode? I'm writing a script that uses this extension, though right now it doesn't work in full screen mode. Thanks!


RE: QuickSearch - Launch Games and Run Commands by Search - poetickatana - 03-25-2022

I know there's an "update all libraries" command (equivalent to F5), but is it possible to have commands to update specific libraries? e.g. "update steam"