[Downloader] Actually use disabled key in updates (#3203)

* fix(downloader): actually use disabled key in updates

* chore(changelog): add towncrier entry
This commit is contained in:
jack1142 2020-01-02 14:49:31 +01:00 committed by Michael H
parent 62b679b1b9
commit bc90f5186a
2 changed files with 4 additions and 2 deletions

View File

@ -0,0 +1 @@
Downloader will no longer show update for a cog if the latest version is disabled through ``info.json`` file.

View File

@ -252,7 +252,7 @@ class Downloader(commands.Cog):
continue continue
# marking cog for update if there's no commit data saved (back-compat, see GH-2571) # marking cog for update if there's no commit data saved (back-compat, see GH-2571)
last_cog_occurrence = await cog.repo.get_last_module_occurrence(cog.name) last_cog_occurrence = await cog.repo.get_last_module_occurrence(cog.name)
if last_cog_occurrence is not None: if last_cog_occurrence is not None and not last_cog_occurrence.disabled:
cogs_to_update.add(last_cog_occurrence) cogs_to_update.add(last_cog_occurrence)
# Reduces diff requests to a single dict with no repeats # Reduces diff requests to a single dict with no repeats
@ -277,7 +277,8 @@ class Downloader(commands.Cog):
else: else:
modified_module = modified[index] modified_module = modified[index]
if modified_module.type == InstallableType.COG: if modified_module.type == InstallableType.COG:
cogs_to_update.add(modified_module) if not modified_module.disabled:
cogs_to_update.add(modified_module)
elif modified_module.type == InstallableType.SHARED_LIBRARY: elif modified_module.type == InstallableType.SHARED_LIBRARY:
libraries_to_update.add(modified_module) libraries_to_update.add(modified_module)