mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-22 08:43:37 +08:00
refactor backend module architecture
This commit is contained in:
@@ -4,15 +4,15 @@ from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from app.core.config import global_vars
|
||||
from app.core.event import eventmanager, Event
|
||||
from app.platform.config import global_vars
|
||||
from app.platform.events import eventmanager, Event
|
||||
from app.db.models import Workflow
|
||||
from app.db.workflow_oper import WorkflowOper
|
||||
from app.helper.module import ModuleHelper
|
||||
from app.log import logger
|
||||
from app.foundation.module import ModuleHelper
|
||||
from app.platform.log import logger
|
||||
from app.schemas import ActionContext, Action, ActionResult
|
||||
from app.schemas.types import EventType
|
||||
from app.utils.singleton import Singleton
|
||||
from app.foundation.singleton import Singleton
|
||||
|
||||
|
||||
class WorkFlowManager(metaclass=Singleton):
|
||||
|
||||
@@ -5,9 +5,9 @@ from pydantic import Field
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.chain.download import DownloadChain
|
||||
from app.chain.media import MediaChain
|
||||
from app.core.config import global_vars
|
||||
from app.core.metainfo import MetaInfo
|
||||
from app.log import logger
|
||||
from app.platform.config import global_vars
|
||||
from app.domain.metainfo import MetaInfo
|
||||
from app.platform.log import logger
|
||||
from app.schemas import ActionParams, ActionContext, DownloadTask, MediaType
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.chain.subscribe import SubscribeChain
|
||||
from app.core.config import settings, global_vars
|
||||
from app.core.context import MediaInfo
|
||||
from app.platform.config import settings, global_vars
|
||||
from app.domain.context import MediaInfo
|
||||
from app.db.subscribe_oper import SubscribeOper
|
||||
from app.log import logger
|
||||
from app.platform.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from app.workflow.actions import BaseAction, ActionChain
|
||||
from app.core.config import global_vars
|
||||
from app.platform.config import global_vars
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.log import logger
|
||||
from app.platform.log import logger
|
||||
|
||||
|
||||
class FetchDownloadsParams(ActionParams):
|
||||
|
||||
@@ -5,12 +5,12 @@ from pydantic import Field
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.chain.recommend import RecommendChain
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.core.config import settings, global_vars
|
||||
from app.core.event import eventmanager
|
||||
from app.log import logger
|
||||
from app.platform.config import settings, global_vars
|
||||
from app.platform.events import eventmanager
|
||||
from app.platform.log import logger
|
||||
from app.schemas import RecommendSourceEventData, MediaInfo
|
||||
from app.schemas.types import ChainEventType
|
||||
from app.utils.http import RequestUtils
|
||||
from app.foundation.http import RequestUtils
|
||||
|
||||
|
||||
class FetchMediasParams(ActionParams):
|
||||
|
||||
@@ -4,11 +4,11 @@ from pydantic import Field
|
||||
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.chain.media import MediaChain
|
||||
from app.core.config import settings, global_vars
|
||||
from app.core.context import Context, TorrentInfo
|
||||
from app.core.metainfo import MetaInfo
|
||||
from app.helper.rss import RssHelper
|
||||
from app.log import logger
|
||||
from app.platform.config import settings, global_vars
|
||||
from app.domain.context import Context, TorrentInfo
|
||||
from app.domain.metainfo import MetaInfo
|
||||
from app.infrastructure.rss import RssHelper
|
||||
from app.platform.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ from pydantic import Field
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.chain.media import MediaChain
|
||||
from app.chain.search import SearchChain
|
||||
from app.core.config import global_vars
|
||||
from app.log import logger
|
||||
from app.platform.config import global_vars
|
||||
from app.platform.log import logger
|
||||
from app.schemas import ActionParams, ActionContext, MediaType
|
||||
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ from typing import Optional
|
||||
from pydantic import Field
|
||||
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.core.config import global_vars
|
||||
from app.log import logger
|
||||
from app.platform.config import global_vars
|
||||
from app.platform.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ from typing import Optional, List
|
||||
from pydantic import Field
|
||||
|
||||
from app.workflow.actions import BaseAction, ActionChain
|
||||
from app.core.config import global_vars
|
||||
from app.helper.torrent import TorrentHelper
|
||||
from app.log import logger
|
||||
from app.platform.config import global_vars
|
||||
from app.services.torrent import TorrentHelper
|
||||
from app.platform.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from pydantic import Field
|
||||
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.core.plugin import PluginManager
|
||||
from app.log import logger
|
||||
from app.extensions.plugin_manager import PluginManager
|
||||
from app.platform.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ from pydantic import Field
|
||||
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.chain.storage import StorageChain
|
||||
from app.core.config import global_vars, settings
|
||||
from app.log import logger
|
||||
from app.platform.config import global_vars, settings
|
||||
from app.platform.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from app.chain.media import MediaChain
|
||||
from app.chain.scraping import ScrapingChain
|
||||
from app.chain.storage import StorageChain
|
||||
from app.core.config import global_vars
|
||||
from app.log import logger
|
||||
from app.platform.config import global_vars
|
||||
from app.platform.log import logger
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.workflow.actions import BaseAction
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.core.event import eventmanager
|
||||
from app.platform.events import eventmanager
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.schemas.types import ChainEventType
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ from pydantic import Field
|
||||
|
||||
from app.workflow.actions import BaseAction, ActionChain
|
||||
from app.schemas import ActionParams, ActionContext, Notification
|
||||
from app.core.config import settings
|
||||
from app.platform.config import settings
|
||||
|
||||
|
||||
class SendMessageParams(ActionParams):
|
||||
|
||||
@@ -5,12 +5,12 @@ from typing import Optional
|
||||
from pydantic import Field
|
||||
|
||||
from app.workflow.actions import BaseAction
|
||||
from app.core.config import global_vars
|
||||
from app.platform.config import global_vars
|
||||
from app.db.transferhistory_oper import TransferHistoryOper
|
||||
from app.schemas import ActionParams, ActionContext
|
||||
from app.chain.storage import StorageChain
|
||||
from app.chain.transfer import TransferChain
|
||||
from app.log import logger
|
||||
from app.platform.log import logger
|
||||
|
||||
|
||||
class TransferFileParams(ActionParams):
|
||||
|
||||
Reference in New Issue
Block a user