Remove support for Audio's Global API (#5143)

* Force-disable Audio's Global API functionality

* Remove owner message about global API

* Two more comments

* Update CODEOWNERS

* Bring back the owner notification, modified to not mention global DB

* Remove the global api group fully, remove the mentions of it
This commit is contained in:
jack1142
2021-06-17 19:27:56 +02:00
committed by GitHub
parent be04ec1c86
commit a99240f7c3
4 changed files with 3 additions and 56 deletions

View File

@@ -1085,15 +1085,11 @@ class AudioSetCommands(MixinMeta, metaclass=CompositeMetaClass):
+ _("Local Spotify cache: [{spotify_status}]\n")
+ _("Local Youtube cache: [{youtube_status}]\n")
+ _("Local Lavalink cache: [{lavalink_status}]\n")
+ _("Global cache status: [{global_cache}]\n")
+ _("Global timeout: [{num_seconds}]\n")
).format(
max_age=str(await self.config.cache_age()) + " " + _("days"),
spotify_status=_("Enabled") if has_spotify_cache else _("Disabled"),
youtube_status=_("Enabled") if has_youtube_cache else _("Disabled"),
lavalink_status=_("Enabled") if has_lavalink_cache else _("Disabled"),
global_cache=_("Enabled") if global_data["global_db_enabled"] else _("Disabled"),
num_seconds=self.get_time_string(global_data["global_db_get_timeout"]),
)
msg += (
"\n---"
@@ -1422,37 +1418,6 @@ class AudioSetCommands(MixinMeta, metaclass=CompositeMetaClass):
await self.config.cache_age.set(age)
await self.send_embed_msg(ctx, title=_("Setting Changed"), description=msg)
@commands.is_owner()
@command_audioset.group(name="globalapi")
async def command_audioset_audiodb(self, ctx: commands.Context):
"""Change globalapi settings."""
@command_audioset_audiodb.command(name="toggle")
async def command_audioset_audiodb_toggle(self, ctx: commands.Context):
"""Toggle the server settings.
Default is OFF
"""
state = await self.config.global_db_enabled()
await self.config.global_db_enabled.set(not state)
if not state: # Ensure a call is made if the API is enabled to update user perms
self.global_api_user = await self.api_interface.global_cache_api.get_perms()
await ctx.send(
_("Global DB is {status}").format(status=_("enabled") if not state else _("disabled"))
)
@command_audioset_audiodb.command(name="timeout")
async def command_audioset_audiodb_timeout(
self, ctx: commands.Context, timeout: Union[float, int]
):
"""Set GET request timeout.
Example: 0.1 = 100ms 1 = 1 second
"""
await self.config.global_db_get_timeout.set(timeout)
await ctx.send(_("Request timeout set to {time} second(s)").format(time=timeout))
@command_audioset.command(name="persistqueue")
@commands.admin()
async def command_audioset_persist_queue(self, ctx: commands.Context):