Skip to content

Conversation

@taooceros
Copy link
Member

@taooceros taooceros commented Dec 27, 2020

  1. Don't create PluginsManager instance every time query, which is really slow due to internet issue. Instead, update plugin manifest every 12 hours, triggered by query.
  2. Don't display potential plugins when typing "pm", but instead display hotkeys. (Just personal idea, since I don't think people will know it can be used to update or uninstall if displaying plugin list on "pm")

@taooceros taooceros force-pushed the PluginManagerImprove branch from eb5b3e1 to 5a03587 Compare December 28, 2020 15:23
@taooceros taooceros requested a review from jjw24 December 28, 2020 15:27
@taooceros taooceros self-assigned this Dec 29, 2020
public class Main : ISettingProvider, IPlugin, ISavable, IContextMenu, IPluginI18n
{
internal PluginInitContext Context { get; set; }
internal static PluginInitContext Context { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

does this need to be static, since we are passing it through constructors already

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh we shouldn't make it static, though I think it is singleton. That has been changed to because I want to pass Context.API to the delegate to the default hotkey list.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me check if there is a better way of passing variable.

@jjw24
Copy link
Member

jjw24 commented Dec 29, 2020

thanks for making this change, really appreciate it.

I might make a couple tweaks just more around formatting and push to this PR if ok

using var _ = File.CreateText(Path.Combine(plugin.PluginDirectory, "NeedDelete.txt"));
}


Copy link
Member

Choose a reason for hiding this comment

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

how come some times your changes contain extra space?

Copy link
Member Author

Choose a reason for hiding this comment

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

hmmm, I don't know…… Maybe due to auto formatting?

@taooceros
Copy link
Member Author

thanks for making this change, really appreciate it.

I might make a couple tweaks just more around formatting and push to this PR if ok

Sure!

@taooceros
Copy link
Member Author

A quick question, do we want the hotkeys here to be able to be modified? If not, why not make the strings to be const? @jjw24

….Json since our plugins.json can be large, so no need to create an extra string to store it.
Remove extra whitespace
add await using for stream
add async await to download manifest task
remove unused encoding name for new GetStreamAsync in Http
fix unintened text error
@jjw24
Copy link
Member

jjw24 commented Dec 29, 2020

A quick question, do we want the hotkeys here to be able to be modified? If not, why not make the strings to be const? @jjw24

yeah that is something i thought would be nice later down the track to allow it to be modifiable by users, although it just wasnt a priority to impment for now

@taooceros taooceros requested a review from jjw24 December 29, 2020 05:50
from existingPlugin in Context.API.GetAllPlugins()
join pluginFromManifest in pluginsManifest.UserPlugins
on existingPlugin.Metadata.ID equals pluginFromManifest.ID
where existingPlugin.Metadata.Version.CompareTo(pluginFromManifest.Version) > 0
Copy link
Member

Choose a reason for hiding this comment

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

just going to make a change here, dont use compareto, use equals or ==

use compareto for sorting

Copy link
Member Author

Choose a reason for hiding this comment

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

Shouldn't we only update plugin if the version is higher on manifest instead of they are not equal?
Sorry, the comparison should be less than 0.😖

Copy link
Member

Choose a reason for hiding this comment

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

my apologies, you are right actually. I was coming from the perception that we dont bother actually compare the version strings, since new updates should have version greater than the previous, but using compareto is better code.

I have changed it to less than 0

Copy link
Member Author

Choose a reason for hiding this comment

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

Haha thank you. I found that due to my computer has an unpublished window walker, which has version higher than the one in our manifest. 😝

@jjw24 jjw24 added the bug Something isn't working label Dec 29, 2020
@jjw24
Copy link
Member

jjw24 commented Dec 29, 2020

looks good. Will merge and lets get the release rolling 👍

@jjw24 jjw24 merged commit 181d871 into Flow-Launcher:dev Dec 29, 2020
@taooceros taooceros deleted the PluginManagerImprove branch January 9, 2021 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants