mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-26 02:35:57 +02:00
fix api client context manager
This commit is contained in:
@@ -52,7 +52,7 @@ class Prowlarr(GenericIndexer):
|
|||||||
@contextmanager
|
@contextmanager
|
||||||
def __get_api(self):
|
def __get_api(self):
|
||||||
with prowlarr.ApiClient(self.config) as api_instance:
|
with prowlarr.ApiClient(self.config) as api_instance:
|
||||||
yield prowlarr.IndexerApi(api_instance)
|
yield api_instance
|
||||||
|
|
||||||
def __get_indexers(self) -> list[IndexerInfo]:
|
def __get_indexers(self) -> list[IndexerInfo]:
|
||||||
with self.__get_api() as client:
|
with self.__get_api() as client:
|
||||||
@@ -178,7 +178,8 @@ class Prowlarr(GenericIndexer):
|
|||||||
|
|
||||||
def __get_newznab_api(self, searches: list) -> list:
|
def __get_newznab_api(self, searches: list) -> list:
|
||||||
results = []
|
results = []
|
||||||
with prowlarr.NewznabApi(self.__get_api) as api:
|
with self.__get_api() as api_client:
|
||||||
|
api = prowlarr.NewznabApi(api_client)
|
||||||
futures = []
|
futures = []
|
||||||
with ThreadPoolExecutor() as executor:
|
with ThreadPoolExecutor() as executor:
|
||||||
for search in searches:
|
for search in searches:
|
||||||
|
|||||||
Reference in New Issue
Block a user