bombsquad-community / plugin-manager

A Plugin Manager for Bombsquad 1.7+
https://bombsquad-community.web.app/pluginmanager
Other
40 stars 29 forks source link

Display new plugins details #128

Closed kingsamurai123 closed 1 year ago

kingsamurai123 commented 1 year ago

Whenever new plugins get added to the manager, the game displays the count and names of the plugins. #64

kingsamurai123 commented 1 year ago

Tried to find the details about the existing plugin details. But couldn't get them, therefore left the current_plugins at line 274 is left empty.

Can anyone help me achieve the local plugin details?

Loup-Garou911XD commented 1 year ago

https://github.com/bombsquad-community/plugin-manager/blob/97a4a6a244e3bf78366c5f14600c1f2ac4dd8340/plugin_manager.py#L220 Installed plugins are stored in config

kingsamurai123 commented 1 year ago

This does provide only installed ones. What about not installed plugins? We need to check with them as well right? To get the new plugins. If not this will popup each time if any plugin is not installed.

Loup-Garou911XD commented 1 year ago

Oh okay I thought current plugins meant like the installed ones

kingsamurai123 commented 1 year ago

Currently, only the number of plugins are stored and can get the info from ba.app.config["Community Plugin Manager"]["Existing Number of Plugins"]. But this does not save the details of the plugins.

Not sure if this requires change anywhere else. Will dug again into source code, but if anyone already has idea about it would be faster to implement. So, raised this PR.

rikkolovescats commented 1 year ago

I don't feel maintaining a list of not-installed plugins locally would be a good idea.

Another solution that should be good enough would be to check if the count doesn't match here: https://github.com/bombsquad-community/plugin-manager/blob/97a4a6a244e3bf78366c5f14600c1f2ac4dd8340/plugin_manager.py#L286

If it doesn't then can sort all downloadable plugins having only one release version by their released_on date in descending order: https://github.com/bombsquad-community/plugin-manager/blob/97a4a6a244e3bf78366c5f14600c1f2ac4dd8340/plugins/utilities.json#L25

We can then caclulate the difference between the new available count and the locally stored count and figure out newly available plugins from the previously sorted plugins list.

kingsamurai123 commented 1 year ago

Your point does give a new solution to the problem. Thank you Rikko.

kingsamurai123 commented 1 year ago

Changed the logic, but ended up adding a new property in Plugin class along with importing datetime method. If this is fine, will start 106 and can merge both at same time.

kingsamurai123 commented 1 year ago

Don't merge this, I made mistake in taking release_date as key for the dictionary and just now remembered that, the release dates can be same for different plugins and this would give a key error. Making the changes to take plugin name as key and also checking API version.

kingsamurai123 commented 1 year ago

Updated everything and most failure cases are checked along with #106 . But why md5 sum failed?

Edit: Is there any changes to be made or can I add the changelog and the version change?

kingsamurai123 commented 1 year ago

Thank you rikko!