chore(lint): Lint the shit out of it
This commit is contained in:
@@ -3,16 +3,16 @@
|
|||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from alfred.domain.shared.value_objects import ImdbId
|
|
||||||
from alfred.domain.subtitles.entities import SubtitleScanResult
|
|
||||||
from alfred.domain.subtitles.services.identifier import SubtitleIdentifier
|
|
||||||
from alfred.domain.subtitles.services.matcher import SubtitleMatcher
|
|
||||||
from alfred.domain.subtitles.services.pattern_detector import PatternDetector
|
|
||||||
from alfred.application.subtitles.placer import (
|
from alfred.application.subtitles.placer import (
|
||||||
PlacedTrack,
|
PlacedTrack,
|
||||||
SubtitlePlacer,
|
SubtitlePlacer,
|
||||||
_build_dest_name,
|
_build_dest_name,
|
||||||
)
|
)
|
||||||
|
from alfred.domain.shared.value_objects import ImdbId
|
||||||
|
from alfred.domain.subtitles.entities import SubtitleScanResult
|
||||||
|
from alfred.domain.subtitles.services.identifier import SubtitleIdentifier
|
||||||
|
from alfred.domain.subtitles.services.matcher import SubtitleMatcher
|
||||||
|
from alfred.domain.subtitles.services.pattern_detector import PatternDetector
|
||||||
from alfred.domain.subtitles.services.utils import available_subtitles
|
from alfred.domain.subtitles.services.utils import available_subtitles
|
||||||
from alfred.domain.subtitles.value_objects import ScanStrategy
|
from alfred.domain.subtitles.value_objects import ScanStrategy
|
||||||
from alfred.infrastructure.filesystem.scanner import PathlibFilesystemScanner
|
from alfred.infrastructure.filesystem.scanner import PathlibFilesystemScanner
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ from alfred.domain.release.value_objects import (
|
|||||||
from alfred.domain.shared.media import MediaInfo
|
from alfred.domain.shared.media import MediaInfo
|
||||||
from alfred.domain.shared.ports import MediaProber
|
from alfred.domain.shared.ports import MediaProber
|
||||||
|
|
||||||
|
|
||||||
# Media types for which a probe carries no useful information.
|
# Media types for which a probe carries no useful information.
|
||||||
_NON_PROBABLE_MEDIA_TYPES = frozenset({"unknown", "other"})
|
_NON_PROBABLE_MEDIA_TYPES = frozenset({"unknown", "other"})
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ from ..value_objects import MediaTypeToken
|
|||||||
from .schema import GroupSchema
|
from .schema import GroupSchema
|
||||||
from .tokens import Token, TokenRole
|
from .tokens import Token, TokenRole
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Stage 1 — tokenize
|
# Stage 1 — tokenize
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -12,7 +12,12 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from typing import Protocol
|
from typing import Protocol
|
||||||
|
|
||||||
from ..value_objects import SubtitleFormat, SubtitleLanguage, SubtitlePattern, SubtitleType
|
from ..value_objects import (
|
||||||
|
SubtitleFormat,
|
||||||
|
SubtitleLanguage,
|
||||||
|
SubtitlePattern,
|
||||||
|
SubtitleType,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class SubtitleKnowledge(Protocol):
|
class SubtitleKnowledge(Protocol):
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import re
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from ...shared.ports import FilesystemScanner, MediaProber
|
from ...shared.ports import FilesystemScanner, MediaProber
|
||||||
from ..ports import SubtitleKnowledge
|
|
||||||
from ...shared.value_objects import ImdbId
|
from ...shared.value_objects import ImdbId
|
||||||
from ..entities import MediaSubtitleMetadata, SubtitleScanResult
|
from ..entities import MediaSubtitleMetadata, SubtitleScanResult
|
||||||
|
from ..ports import SubtitleKnowledge
|
||||||
from ..value_objects import ScanStrategy, SubtitlePattern, SubtitleType
|
from ..value_objects import ScanStrategy, SubtitlePattern, SubtitleType
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ from pathlib import Path
|
|||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
import alfred as _alfred_pkg
|
import alfred as _alfred_pkg
|
||||||
|
|
||||||
from alfred.domain.shared.value_objects import Language
|
from alfred.domain.shared.value_objects import Language
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ from datetime import UTC, datetime
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from alfred.domain.subtitles.entities import SubtitleScanResult
|
|
||||||
from alfred.application.subtitles.placer import PlacedTrack
|
from alfred.application.subtitles.placer import PlacedTrack
|
||||||
|
from alfred.domain.subtitles.entities import SubtitleScanResult
|
||||||
from alfred.infrastructure.metadata.store import MetadataStore
|
from alfred.infrastructure.metadata.store import MetadataStore
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ from alfred.application.filesystem.manage_subtitles import (
|
|||||||
_to_imdb_id,
|
_to_imdb_id,
|
||||||
_to_unresolved_dto,
|
_to_unresolved_dto,
|
||||||
)
|
)
|
||||||
from alfred.domain.subtitles.entities import MediaSubtitleMetadata, SubtitleScanResult
|
|
||||||
from alfred.application.subtitles.placer import PlacedTrack, PlaceResult
|
from alfred.application.subtitles.placer import PlacedTrack, PlaceResult
|
||||||
|
from alfred.domain.subtitles.entities import MediaSubtitleMetadata, SubtitleScanResult
|
||||||
from alfred.domain.subtitles.value_objects import (
|
from alfred.domain.subtitles.value_objects import (
|
||||||
ScanStrategy,
|
ScanStrategy,
|
||||||
SubtitleFormat,
|
SubtitleFormat,
|
||||||
|
|||||||
@@ -31,9 +31,17 @@ from alfred.application.filesystem.resolve_destination import (
|
|||||||
_Clarification,
|
_Clarification,
|
||||||
_find_existing_tvshow_folders,
|
_find_existing_tvshow_folders,
|
||||||
_resolve_series_folder,
|
_resolve_series_folder,
|
||||||
|
)
|
||||||
|
from alfred.application.filesystem.resolve_destination import (
|
||||||
resolve_episode_destination as _resolve_episode_destination,
|
resolve_episode_destination as _resolve_episode_destination,
|
||||||
|
)
|
||||||
|
from alfred.application.filesystem.resolve_destination import (
|
||||||
resolve_movie_destination as _resolve_movie_destination,
|
resolve_movie_destination as _resolve_movie_destination,
|
||||||
|
)
|
||||||
|
from alfred.application.filesystem.resolve_destination import (
|
||||||
resolve_season_destination as _resolve_season_destination,
|
resolve_season_destination as _resolve_season_destination,
|
||||||
|
)
|
||||||
|
from alfred.application.filesystem.resolve_destination import (
|
||||||
resolve_series_destination as _resolve_series_destination,
|
resolve_series_destination as _resolve_series_destination,
|
||||||
)
|
)
|
||||||
from alfred.infrastructure.knowledge.release_kb import YamlReleaseKnowledge
|
from alfred.infrastructure.knowledge.release_kb import YamlReleaseKnowledge
|
||||||
|
|||||||
@@ -21,13 +21,13 @@ from unittest.mock import patch
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from alfred.domain.subtitles.entities import SubtitleScanResult
|
|
||||||
from alfred.application.subtitles.placer import (
|
from alfred.application.subtitles.placer import (
|
||||||
PlacedTrack,
|
PlacedTrack,
|
||||||
PlaceResult,
|
PlaceResult,
|
||||||
SubtitlePlacer,
|
SubtitlePlacer,
|
||||||
_build_dest_name,
|
_build_dest_name,
|
||||||
)
|
)
|
||||||
|
from alfred.domain.subtitles.entities import SubtitleScanResult
|
||||||
from alfred.domain.subtitles.value_objects import (
|
from alfred.domain.subtitles.value_objects import (
|
||||||
SubtitleFormat,
|
SubtitleFormat,
|
||||||
SubtitleLanguage,
|
SubtitleLanguage,
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from alfred.application.release.supported_media import (
|
from alfred.application.release.supported_media import (
|
||||||
find_main_video,
|
find_main_video,
|
||||||
is_supported_video,
|
is_supported_video,
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from alfred.infrastructure.knowledge.subtitles import loader as loader_mod
|
|
||||||
from alfred.infrastructure.knowledge.subtitles.base import SubtitleKnowledgeBase
|
|
||||||
from alfred.infrastructure.knowledge.subtitles.loader import KnowledgeLoader, _merge
|
|
||||||
from alfred.domain.subtitles.value_objects import (
|
from alfred.domain.subtitles.value_objects import (
|
||||||
ScanStrategy,
|
ScanStrategy,
|
||||||
SubtitleType,
|
SubtitleType,
|
||||||
TypeDetectionMethod,
|
TypeDetectionMethod,
|
||||||
)
|
)
|
||||||
|
from alfred.infrastructure.knowledge.subtitles import loader as loader_mod
|
||||||
|
from alfred.infrastructure.knowledge.subtitles.base import SubtitleKnowledgeBase
|
||||||
|
from alfred.infrastructure.knowledge.subtitles.loader import KnowledgeLoader, _merge
|
||||||
|
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# _merge — pure dict merger #
|
# _merge — pure dict merger #
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from alfred.domain.subtitles.entities import SubtitleScanResult
|
|
||||||
from alfred.application.subtitles.placer import PlacedTrack
|
from alfred.application.subtitles.placer import PlacedTrack
|
||||||
|
from alfred.domain.subtitles.entities import SubtitleScanResult
|
||||||
from alfred.domain.subtitles.value_objects import (
|
from alfred.domain.subtitles.value_objects import (
|
||||||
SubtitleFormat,
|
SubtitleFormat,
|
||||||
SubtitleLanguage,
|
SubtitleLanguage,
|
||||||
|
|||||||
Reference in New Issue
Block a user