mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-11 10:40:18 +08:00
rename
This commit is contained in:
@@ -4,7 +4,7 @@ from pathlib import Path
|
||||
from threading import RLock
|
||||
from typing import Optional
|
||||
|
||||
from app.core.cache import get_cache_backend
|
||||
from app.core.cache import Cache
|
||||
from app.core.config import settings
|
||||
from app.core.meta import MetaBase
|
||||
from app.core.metainfo import MetaInfo
|
||||
@@ -34,7 +34,7 @@ class DoubanCache(metaclass=WeakSingleton):
|
||||
self.region = "__douban_cache__"
|
||||
self._meta_filepath = settings.TEMP_PATH / self.region
|
||||
# 初始化缓存
|
||||
self._cache = get_cache_backend(maxsize=self.maxsize, ttl=self.ttl)
|
||||
self._cache = Cache(maxsize=self.maxsize, ttl=self.ttl)
|
||||
# 非Redis加载本地缓存数据
|
||||
if not self._cache.is_redis():
|
||||
for key, value in self.__load(self._meta_filepath).items():
|
||||
|
||||
@@ -5,10 +5,10 @@ from qbittorrentapi import TorrentFilesList
|
||||
from torrentool.torrent import Torrent
|
||||
|
||||
from app import schemas
|
||||
from app.core.cache import get_file_cache_backend
|
||||
from app.core.cache import FileCache
|
||||
from app.core.config import settings
|
||||
from app.core.metainfo import MetaInfo
|
||||
from app.core.event import eventmanager, Event
|
||||
from app.core.metainfo import MetaInfo
|
||||
from app.log import logger
|
||||
from app.modules import _ModuleBase, _DownloaderBase
|
||||
from app.modules.qbittorrent.qbittorrent import Qbittorrent
|
||||
@@ -119,7 +119,7 @@ class QbittorrentModule(_ModuleBase, _DownloaderBase[Qbittorrent]):
|
||||
torrent_content = content.read_bytes()
|
||||
else:
|
||||
# 缓存处理器
|
||||
cache_backend = get_file_cache_backend()
|
||||
cache_backend = FileCache()
|
||||
# 读取缓存的种子文件
|
||||
torrent_content = cache_backend.get(content.as_posix(), region="torrents")
|
||||
else:
|
||||
@@ -137,7 +137,7 @@ class QbittorrentModule(_ModuleBase, _DownloaderBase[Qbittorrent]):
|
||||
return None, None, None, "下载内容为空"
|
||||
|
||||
# 读取种子的名称
|
||||
torrent, content = __get_torrent_info()
|
||||
torrent, content = __get_torrent_info()
|
||||
if not torrent:
|
||||
return None, None, None, f"添加种子任务失败:无法读取种子文件"
|
||||
|
||||
@@ -337,7 +337,7 @@ class QbittorrentModule(_ModuleBase, _DownloaderBase[Qbittorrent]):
|
||||
del torrents
|
||||
else:
|
||||
return None
|
||||
return ret_torrents # noqa
|
||||
return ret_torrents # noqa
|
||||
|
||||
def transfer_completed(self, hashs: str, downloader: Optional[str] = None) -> None:
|
||||
"""
|
||||
|
||||
@@ -3,7 +3,7 @@ import traceback
|
||||
from pathlib import Path
|
||||
from threading import RLock
|
||||
|
||||
from app.core.cache import get_cache_backend
|
||||
from app.core.cache import Cache
|
||||
from app.core.config import settings
|
||||
from app.core.meta import MetaBase
|
||||
from app.log import logger
|
||||
@@ -32,7 +32,7 @@ class TmdbCache(metaclass=WeakSingleton):
|
||||
self.region = "__tmdb_cache__"
|
||||
self._meta_filepath = settings.TEMP_PATH / self.region
|
||||
# 初始化缓存
|
||||
self._cache = get_cache_backend(maxsize=self.maxsize, ttl=self.ttl)
|
||||
self._cache = Cache(maxsize=self.maxsize, ttl=self.ttl)
|
||||
# 非Redis加载本地缓存数据
|
||||
if not self._cache.is_redis():
|
||||
for key, value in self.__load(self._meta_filepath).items():
|
||||
|
||||
@@ -5,10 +5,10 @@ from torrentool.torrent import Torrent
|
||||
from transmission_rpc import File
|
||||
|
||||
from app import schemas
|
||||
from app.core.cache import get_file_cache_backend
|
||||
from app.core.cache import FileCache
|
||||
from app.core.config import settings
|
||||
from app.core.metainfo import MetaInfo
|
||||
from app.core.event import eventmanager, Event
|
||||
from app.core.metainfo import MetaInfo
|
||||
from app.log import logger
|
||||
from app.modules import _ModuleBase, _DownloaderBase
|
||||
from app.modules.transmission.transmission import Transmission
|
||||
@@ -120,7 +120,7 @@ class TransmissionModule(_ModuleBase, _DownloaderBase[Transmission]):
|
||||
torrent_content = content.read_bytes()
|
||||
else:
|
||||
# 缓存处理器
|
||||
cache_backend = get_file_cache_backend()
|
||||
cache_backend = FileCache()
|
||||
# 读取缓存的种子文件
|
||||
torrent_content = cache_backend.get(content.as_posix(), region="torrents")
|
||||
else:
|
||||
@@ -325,7 +325,7 @@ class TransmissionModule(_ModuleBase, _DownloaderBase[Transmission]):
|
||||
del torrents
|
||||
else:
|
||||
return None
|
||||
return ret_torrents # noqa
|
||||
return ret_torrents # noqa
|
||||
|
||||
def transfer_completed(self, hashs: str, downloader: Optional[str] = None) -> None:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user