Closed kingsamurai123 closed 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?
https://github.com/bombsquad-community/plugin-manager/blob/97a4a6a244e3bf78366c5f14600c1f2ac4dd8340/plugin_manager.py#L220 Installed plugins are stored in config
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.
Oh okay I thought current plugins meant like the installed ones
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.
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.
Your point does give a new solution to the problem. Thank you Rikko.
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.
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.
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?
Thank you rikko!
Whenever new plugins get added to the manager, the game displays the count and names of the plugins. #64