From be04ec1c86199920017eba2e590a6ded8cbc2a20 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Thu, 17 Jun 2021 05:04:31 +0200 Subject: [PATCH] Change default local cache level (#5140) * Change default local cache level * Update the owner message as well --- redbot/cogs/audio/apis/interface.py | 4 ++-- redbot/cogs/audio/core/__init__.py | 4 ++-- redbot/cogs/audio/core/tasks/startup.py | 5 +---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/redbot/cogs/audio/apis/interface.py b/redbot/cogs/audio/apis/interface.py index bed4a8c36..7ec55ecec 100644 --- a/redbot/cogs/audio/apis/interface.py +++ b/redbot/cogs/audio/apis/interface.py @@ -198,7 +198,7 @@ class AudioAPIInterface: uri: str, notifier: Optional[Notifier], skip_youtube: bool = False, - current_cache_level: CacheLevel = CacheLevel.none(), + current_cache_level: CacheLevel = CacheLevel.all(), ) -> List[str]: """Return youtube URLS for the spotify URL provided.""" youtube_urls = [] @@ -718,7 +718,7 @@ class AudioAPIInterface: self, ctx: commands.Context, track_info: str, - current_cache_level: CacheLevel = CacheLevel.none(), + current_cache_level: CacheLevel = CacheLevel.all(), ) -> Optional[str]: """Call the Youtube API and returns the youtube URL that the query matched.""" track_url = await self.youtube_api.get_call(track_info) diff --git a/redbot/cogs/audio/core/__init__.py b/redbot/cogs/audio/core/__init__.py index 184cddb26..463550af7 100644 --- a/redbot/cogs/audio/core/__init__.py +++ b/redbot/cogs/audio/core/__init__.py @@ -15,7 +15,7 @@ from redbot.core.commands import Cog from redbot.core.data_manager import cog_data_path from redbot.core.i18n import Translator, cog_i18n -from ..utils import PlaylistScope +from ..utils import CacheLevel, PlaylistScope from . import abc, cog_utils, commands, events, tasks, utilities from .cog_utils import CompositeMetaClass @@ -95,7 +95,7 @@ class Audio( schema_version=1, bundled_playlist_version=0, owner_notification=0, - cache_level=0, + cache_level=CacheLevel.all().value, cache_age=365, daily_playlists=False, global_db_enabled=False, diff --git a/redbot/cogs/audio/core/tasks/startup.py b/redbot/cogs/audio/core/tasks/startup.py index a4af1727b..454ebecb9 100644 --- a/redbot/cogs/audio/core/tasks/startup.py +++ b/redbot/cogs/audio/core/tasks/startup.py @@ -260,10 +260,7 @@ See `[p]help audioset globalapi` for more information. Access to this service is disabled by default and **requires you to explicitly opt-in** to start using it. An access token is **required** to use this API. To obtain this token you may join and run `?audioapi register` in the #testing channel. -Note: by using this service you accept that your bot's IP address will be disclosed to the Cog-Creators organization and used only for the purpose of providing the Global API service. - -On a related note, it is highly recommended that you enable your local cache if you haven't yet. -To do so, run `[p]audioset cache 5`. This cache, which stores only metadata, will make repeated audio requests faster and further reduce the likelihood of YouTube rate-limiting your bot. Since it's only metadata the required disk space for this cache is expected to be negligible.""" +Note: by using this service you accept that your bot's IP address will be disclosed to the Cog-Creators organization and used only for the purpose of providing the Global API service.""" ) await send_to_owners_with_prefix_replaced(self.bot, msg) await self.config.owner_notification.set(1)