change where filters are set to preload

This commit is contained in:
cloudwithax 2022-10-25 21:20:35 -04:00
parent 4013bf94f3
commit b6516f2d09
2 changed files with 4 additions and 2 deletions

View File

@ -366,11 +366,10 @@ class Player(VoiceProtocol):
# Check if theres no global filters and if the track has any filters # Check if theres no global filters and if the track has any filters
# that need to be applied # that need to be applied
print(f"global filters: {self.filters.has_global}")
if not self.filters.has_global and track.filters: if not self.filters.has_global and track.filters:
# Now apply all filters # Now apply all filters
for filter in track.filters: for filter in track.filters:
# Set preload for filter
filter.set_preload()
await self.add_filter(filter=filter) await self.add_filter(filter=filter)
if end > 0: if end > 0:

View File

@ -305,6 +305,9 @@ class Node:
if not URL_REGEX.match(query) and not re.match(r"(?:ytm?|sc)search:.", query): if not URL_REGEX.match(query) and not re.match(r"(?:ytm?|sc)search:.", query):
query = f"{search_type}:{query}" query = f"{search_type}:{query}"
for filter in filters:
filter.set_preload()
if SPOTIFY_URL_REGEX.match(query): if SPOTIFY_URL_REGEX.match(query):
if not self._spotify_client_id and not self._spotify_client_secret: if not self._spotify_client_id and not self._spotify_client_secret:
raise InvalidSpotifyClientAuthorization( raise InvalidSpotifyClientAuthorization(