Playnite Forums
  • Playnite Web
  • Rules
  • Members
  • Team
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Playnite Forums Extension Database Generic Extensions QuickSearch - Launch Games and Run Commands by Search

QuickSearch - Launch Games and Run Commands by Search
felixkmh
Offline

#1
05-14-2021, 04:22 PM (This post was last modified: 05-02-2022, 10:22 PM by felixkmh.)
[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:

.pext   QuickSearch_1_5_1.pext (Size: 343.81 KB / Downloads: 395)
  • show filter type and number of matching games on filter entries

.pext   QuickSearch_1_5_0.pext (Size: 338.15 KB / Downloads: 184)
  • 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

.zip   QuickSearchSDK_1_3.zip (Size: 37.17 KB / Downloads: 161)
  • 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)

.pext   QuickSearch_1_4_1.pext (Size: 219.14 KB / Downloads: 198)
  • added option to set a global hotkey, that opens the search window even if the Playnite window is not in focus

.pext   QuickSearch_1_4_0.pext (Size: 214.31 KB / Downloads: 170)
  • 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".

.pext   QuickSearch_1_3_1.pext (Size: 195.1 KB / Downloads: 165)
  • fixed shop list not updating in some cases

.pext   QuickSearch_1_3_0.pext (Size: 195.04 KB / Downloads: 161)
  • 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.

.zip   QuickSearchSDK_1_2.zip (Size: 16.27 KB / Downloads: 170)
  • 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

.pext   QuickSearch_1_2_0.pext (Size: 115.62 KB / Downloads: 193)
  • added option to disambiguate by installation status before name if scores are equal

.pext   QuickSearch_1_1_1.pext (Size: 114.52 KB / Downloads: 156)
  • hotfix: game icons not being used

.pext   QuickSearch_1_1_0.pext (Size: 113.61 KB / Downloads: 167)
  • 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

.zip   QuickSearchSDK_1_1.zip (Size: 15.72 KB / Downloads: 160)
  • 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

.pext   QuickSearch_1_0_1.pext (Size: 101.24 KB / Downloads: 168)
  • fixed text scrolling not resetting on deselection

.pext   QuickSearch_1_0.pext (Size: 101.24 KB / Downloads: 159)
  • 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.

.zip   QuickSearchSDK_1_0.zip (Size: 13.47 KB / Downloads: 175)
  • 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.

.pext   QuickSearch_0_5.pext (Size: 91.57 KB / Downloads: 179)
  • 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

.zip   QuickSearchSDK_0_5.zip (Size: 11.38 KB / Downloads: 170)
  • 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".

.pext   QuickSearch_0_4_2.pext (Size: 58.59 KB / Downloads: 167)
  • adjusted score weights
  • added option to restrict maximum number of displayed results
  • check for empty strings

.pext   QuickSearch_0_4_1.pext (Size: 55.68 KB / Downloads: 166)
  • 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

.pext   QuickSearch_0_4.pext (Size: 55.35 KB / Downloads: 166)
  • more responsive ui while loading results



.pext   QuickSearch_0_1.pext (Size: 51.45 KB / Downloads: 178)
.pext   QuickSearch_0_2.pext (Size: 52.42 KB / Downloads: 189)
.pext   QuickSearch_0_3.pext (Size: 55.25 KB / Downloads: 180)
turtleship_
Offline

#2
05-14-2021, 05:09 PM
(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?
felixkmh
Offline

#3
05-14-2021, 05:14 PM
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.
darklinkpower
Offline

Super Moderator
#4
05-15-2021, 09:09 AM
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]
felixkmh
Offline

#5
05-15-2021, 01:47 PM
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.
darklinkpower
Offline

Super Moderator
#6
05-15-2021, 05:37 PM
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.
felixkmh
Offline

#7
05-15-2021, 09:26 PM (This post was last modified: 05-16-2021, 01:33 AM by felixkmh.)
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.
darklinkpower
Offline

Super Moderator
#8
05-16-2021, 03:16 AM
Excellent, great work!
felixkmh
Offline

#9
05-22-2021, 12:04 AM
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.
felixkmh
Offline

#10
05-26-2021, 03:10 PM
Uploaded Version 1.1
felixkmh
Offline

#11
06-04-2021, 08:06 PM
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".
darklinkpower
Offline

Super Moderator
#12
06-05-2021, 02:34 AM
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?
felixkmh
Offline

#13
06-05-2021, 05:58 AM (This post was last modified: 06-05-2021, 06:28 AM by felixkmh.)
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.
darklinkpower
Offline

Super Moderator
#14
06-05-2021, 10:37 AM
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.
felixkmh
Offline

#15
06-13-2021, 08:47 PM (This post was last modified: 06-13-2021, 08:54 PM by felixkmh.)
Uploaded version 1.5 and SDK 1.3
felixkmh
Offline

#16
10-20-2021, 03:06 PM
Updated initial post with current features and changelogs since Playnite 9
Xenor
Offline

#17
10-25-2021, 09:20 AM
Wowzee, I've just discovered the extension scrolling through the addon browser, great work Smile.
SasquatchBurger
Offline

#18
11-17-2021, 12:23 PM
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...'
Giodude
Offline

#19
03-25-2022, 01:00 PM (This post was last modified: 03-25-2022, 03:36 PM by Giodude.)
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!
poetickatana
Offline

#20
03-25-2022, 06:19 PM
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"
« Next Oldest | Next Newest »
Pages (4): 1 2 3 4 Next »



  • View a Printable Version
  • Subscribe to this thread

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode