Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Program Plugin] Support .url file #1476

Merged
merged 20 commits into from
Nov 1, 2022
Merged

Conversation

LeLocTai
Copy link
Contributor

@LeLocTai LeLocTai commented Oct 16, 2022

Notably Steam use .url for games shortcut.


What's the PR

  • Add Function the program plug-in to search for shortcut that use the .url format, such as Steam or Epic.
  • Changed Label File Suffixes -> File Type
  • Changed File Type Window.
  • User can set up protocols other than Steam and Epic.
  • Default Setting
    • on : exe, lnk, ms-app / steam, epic

Test Cases

  • The icon in the url file should be displayed normally.
  • The default settings for the first installation should be as follows: on : exe, lnk, ms-app / steam, epic
  • It must behave according to the checkboxes.
  • The file format / protocol entered in the custom entry must work.
  • Even if a custom item is entered, it should not work if you uncheck the check box.
  • Items entered in custom items must be saved even if they are not used.
  • The custom text box should only be visible when you turn on the custom
  • When you focus on each textbox, the appropriate description should be displayed.
  • There should be no conflicts with users who have existing settings.

@VictoriousRaptor
Copy link
Contributor

What if the .url file is not a steam shortcut but a internet page? Obviously we don't want it in Program.

@LeLocTai
Copy link
Contributor Author

It is possible to filter by protocol. But to be honest I've been adding url to Program for months without this patch and never have a thought about it. My brain just filter them out.
I hope we can merge this as is, and maybe adding a customizable protocol later. There are already many useless results anyway, and fuzzy match have always do a good job of surfacing the relevant one quickly. Having thumbnail on steam shortcut is great and eliminate the need for extra plugin. Those who want less result can always remove .url from Program settings.

@onesounds
Copy link
Contributor

onesounds commented Oct 17, 2022

image

image

The above screen shot is not this pr, but only preview pr and suffix are set.

  • Currently, we are going to change the icon part in other PR (preview). If this pr is applied, the url file type icon will also be displayed appropriately.
  • How about adding only .url to the suffix default setting for this feature? When I test it, it seems to work the same way as this PR. This pr is focused on outputting the icon. If the preview(and icon) pr works properly, this function can be solved with suffix alone.

https://developer.valvesoftware.com/wiki/Steam_browser_protocol

It's my first time seeing this url file type, and I confirmed that usually use it on Steam. The other files were link files to websites that most would not use. (docs in web or Game services that require website login) Considering the high number of downloads of the Steam plug-in, it is certainly inconvenient that the Steam game cannot be searched in windows. Although the number of downloads of the Steam Plug-in will decrease, it seems to good to be provided as a default. (There may be overlapping results with existing Steam Plug-in users.)

@VictoriousRaptor
Copy link
Contributor

Personally I don't think this is a good idea. Not the idea of supporting indexing steam games itself, but the way you manage these.url files. You need to put these .url files in a folder and manually manage them. Steam only let you add shortcuts to desktop iirc. If you don't want all these shortcuts on your desktop you need to cut them to somewhere else.

@LeLocTai
Copy link
Contributor Author

Stream also create url files in the start menu. You don't have to manually do anything. Even windows builtin search can find these files, and this pr bring Flow to parity with it which is the bare minimum in term of capabilities.

My main issue with the steam plugin is it doesn't score the results, so you must use a trigger word which is very inconvenient.

@VictoriousRaptor
Copy link
Contributor

Stream also create url files in the start menu. You don't have to manually do anything

It's my problem then. I just found that I never check the "Add to start menu" checkbox.

My main issue with the steam plugin is it doesn't score the results, so you must use a trigger word which is very inconvenient.

Seems related to Garulf/Steam-Search#30.

@LeLocTai
Copy link
Contributor Author

I'm aware of the issue and have discussed with Garulf about it. While it is simple to give the results a score boost, it is not easy to give them a score that play well with other result since fuzzy match is not accessible in python. Scoring is also not well documented in general.

@Garulf
Copy link
Member

Garulf commented Oct 17, 2022

I'm aware of the issue and have discussed with Garulf about it. While it is simple to give the results a score boost, it is not easy to give them a score that play well with other result since fuzzy match is not accessible in python. Scoring is also not well documented in general.

I have a PR in the works that'll allow Python plugins to use Flow Launchers Fuzzy matching.

@taooceros
Copy link
Member

I'm aware of the issue and have discussed with Garulf about it. While it is simple to give the results a score boost, it is not easy to give them a score that play well with other result since fuzzy match is not accessible in python. Scoring is also not well documented in general.

I have a PR in the works that'll allow Python plugins to use Flow Launchers Fuzzy matching.

really??? how's that possible🤔

@Garulf
Copy link
Member

Garulf commented Oct 19, 2022

really??? how's that possible🤔

Actually not hard to implement. I just haven't decided on the design.

@VictoriousRaptor VictoriousRaptor added the enhancement New feature or request label Oct 23, 2022
@onesounds
Copy link
Contributor

@VictoriousRaptor Error.
image

Copy link
Member

@taooceros taooceros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but there's a few things to check.

if (ImageLoader.CacheContainImage(imagePath))
{
// will get here either when icoPath has value\icon delegate is null\when had exception in delegate
image = ImageLoader.Load(imagePath);
image = ImageLoader.Load(imagePath, loadFullImage);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loadFullImage will not do anything actually. We may want to change how cache work later. pending to be do in #1351.

}

var iconPath = urlSection?["IconFile"];
if (iconPath != null && Path.GetExtension(iconPath).Equals(".ico", StringComparison.OrdinalIgnoreCase))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to check the extension? What may be the extension? jpg or png? Though those two are both supported I believe?


[JsonIgnore]
public Dictionary<string, bool> BuiltinProtocolsStatus { get; set; } = new Dictionary<string, bool>{
{ $"steam://run/{SuffixSeparator}steam://rungameid/", true }, { "com.epicgames.launcher://apps/", true }, { $"http://{SuffixSeparator}https://", false}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I somehow feel that we don't use the functionality of Dictionary. Consider using List<(string,bool)> instead? Thoug this is fine.

@jjw24 jjw24 added the review in progress Indicates that a review is in progress for this PR label Oct 31, 2022
Copy link
Member

@jjw24 jjw24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing the testing 👍

@jjw24 jjw24 removed the review in progress Indicates that a review is in progress for this PR label Nov 1, 2022
@jjw24 jjw24 added this to the 1.10.0 milestone Nov 1, 2022
@VictoriousRaptor VictoriousRaptor merged commit e17ec6a into Flow-Launcher:dev Nov 1, 2022
@VictoriousRaptor VictoriousRaptor mentioned this pull request Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants