From 7cc105a77a57f8866a0dc04da1d0f31f7c241058 Mon Sep 17 00:00:00 2001 From: seria Date: Sun, 13 Oct 2024 10:28:59 +0800 Subject: [PATCH] Allow turning of cache for get_lineup_fields --- genshin/client/components/lineup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/genshin/client/components/lineup.py b/genshin/client/components/lineup.py index a9dc5f4e..f129959a 100644 --- a/genshin/client/components/lineup.py +++ b/genshin/client/components/lineup.py @@ -35,12 +35,14 @@ async def request_lineup( return await self.request(url, method=method, params=params, **kwargs) - async def get_lineup_fields(self, *, lang: typing.Optional[str] = None) -> models.LineupFields: + async def get_lineup_fields( + self, *, lang: typing.Optional[str] = None, use_cache: bool = True + ) -> models.LineupFields: """Get configuration lineup fields.""" data = await self.request_lineup( "config", lang=lang, - static_cache=cache.cache_key("lineup", endpoint="config", lang=lang or self.lang), + static_cache=cache.cache_key("lineup", endpoint="config", lang=lang or self.lang) if use_cache else None, ) return models.LineupFields(**data)