mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-06 20:42:43 +08:00
fix yield
This commit is contained in:
@@ -362,6 +362,7 @@ class CacheToolsBackend(CacheBackend):
|
|||||||
region_cache = self.__get_region_cache(region)
|
region_cache = self.__get_region_cache(region)
|
||||||
if region_cache is None:
|
if region_cache is None:
|
||||||
yield from ()
|
yield from ()
|
||||||
|
return
|
||||||
for item in region_cache.items():
|
for item in region_cache.items():
|
||||||
yield item
|
yield item
|
||||||
|
|
||||||
@@ -635,6 +636,7 @@ class FileBackend(CacheBackend):
|
|||||||
cache_path = self.base / region
|
cache_path = self.base / region
|
||||||
if not cache_path.exists():
|
if not cache_path.exists():
|
||||||
yield from ()
|
yield from ()
|
||||||
|
return
|
||||||
for item in cache_path.iterdir():
|
for item in cache_path.iterdir():
|
||||||
if item.is_file():
|
if item.is_file():
|
||||||
with open(item, 'r') as f:
|
with open(item, 'r') as f:
|
||||||
@@ -747,6 +749,7 @@ class AsyncFileBackend(AsyncCacheBackend):
|
|||||||
cache_path = AsyncPath(self.base) / region
|
cache_path = AsyncPath(self.base) / region
|
||||||
if not await cache_path.exists():
|
if not await cache_path.exists():
|
||||||
yield "", None
|
yield "", None
|
||||||
|
return
|
||||||
async for item in cache_path.iterdir():
|
async for item in cache_path.iterdir():
|
||||||
if await item.is_file():
|
if await item.is_file():
|
||||||
async with aiofiles.open(item, 'r') as f:
|
async with aiofiles.open(item, 'r') as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user