mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-12 15:50:01 -08:00
chore: ruff check
This commit is contained in:
@@ -575,7 +575,7 @@ def _get_available_episodes(provider, anime, config, feedback):
|
||||
)
|
||||
|
||||
if not provider_anime_data:
|
||||
feedback.warning(f"Failed to get anime details from provider")
|
||||
feedback.warning("Failed to get anime details from provider")
|
||||
return []
|
||||
|
||||
# Check all available translation types
|
||||
@@ -967,7 +967,7 @@ def _show_final_statistics(download_service, feedback):
|
||||
stats = download_service.get_download_statistics()
|
||||
|
||||
if stats:
|
||||
console.print(f"\n[bold blue]Overall Download Statistics:[/bold blue]")
|
||||
console.print("\n[bold blue]Overall Download Statistics:[/bold blue]")
|
||||
console.print(f"Total episodes tracked: {stats.get('total_episodes', 0)}")
|
||||
console.print(f"Successfully downloaded: {stats.get('downloaded', 0)}")
|
||||
console.print(f"Failed downloads: {stats.get('failed', 0)}")
|
||||
|
||||
@@ -16,7 +16,6 @@ def stats(config: "AppConfig"):
|
||||
from rich.markdown import Markdown
|
||||
from rich.panel import Panel
|
||||
|
||||
from .....core.exceptions import FastAnimeError
|
||||
from .....libs.media_api.api import create_api_client
|
||||
from ....service.auth import AuthService
|
||||
from ....service.feedback import FeedbackService
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
Registry backup command - create full backups of the registry
|
||||
"""
|
||||
|
||||
import shutil
|
||||
import tarfile
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
|
||||
@@ -346,8 +346,6 @@ def _import_data(registry_service, data: dict, merge: bool, dry_run: bool, feedb
|
||||
"""Import data into the registry."""
|
||||
from .....libs.media_api.types import (
|
||||
MediaFormat,
|
||||
MediaGenre,
|
||||
MediaStatus,
|
||||
MediaType,
|
||||
)
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ def update(
|
||||
else:
|
||||
latest_version = release_json.get("tag_name", "unknown")
|
||||
print(f"[yellow]Update available: {latest_version}[/]")
|
||||
print(f"[dim]Run 'fastanime update' to update[/]")
|
||||
print("[dim]Run 'fastanime update' to update[/]")
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("[cyan]Checking for updates and updating if necessary...[/]")
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import configparser
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Dict
|
||||
|
||||
|
||||
@@ -343,7 +343,6 @@ def _view_info(ctx: Context, state: State) -> MenuAction:
|
||||
|
||||
# Create next airing panel if available
|
||||
if media_item.next_airing:
|
||||
from datetime import datetime
|
||||
|
||||
airing_info_table = Table(show_header=False, box=box.SIMPLE)
|
||||
airing_info_table.add_column("Field", style="bold red")
|
||||
@@ -537,7 +536,6 @@ def _view_characters(ctx: Context, state: State) -> MenuAction:
|
||||
from rich.table import Table
|
||||
from rich.panel import Panel
|
||||
from rich.text import Text
|
||||
from datetime import datetime
|
||||
|
||||
console = Console()
|
||||
console.clear()
|
||||
|
||||
@@ -4,7 +4,7 @@ import logging
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from ....core.config.model import AppConfig, DownloadsConfig
|
||||
from ....core.config.model import AppConfig
|
||||
from ....core.downloader.base import BaseDownloader
|
||||
from ....core.downloader.downloader import create_downloader
|
||||
from ....core.downloader.params import DownloadParams
|
||||
|
||||
@@ -2,7 +2,7 @@ import json
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Dict, Generator, List, Optional, TypedDict
|
||||
from typing import Dict, Generator, List, Optional, TypedDict
|
||||
|
||||
from ....core.config.model import MediaRegistryConfig
|
||||
from ....core.exceptions import FastAnimeError
|
||||
@@ -12,7 +12,6 @@ from ....libs.media_api.types import (
|
||||
MediaItem,
|
||||
MediaSearchResult,
|
||||
PageInfo,
|
||||
UserListItem,
|
||||
UserMediaListStatus,
|
||||
)
|
||||
from .models import (
|
||||
@@ -586,7 +585,6 @@ class MediaRegistryService:
|
||||
) -> list[tuple[int, str]]:
|
||||
"""Get all episodes with a specific download status."""
|
||||
try:
|
||||
from .models import DownloadStatus
|
||||
|
||||
episodes = []
|
||||
for record in self.get_all_media_records():
|
||||
@@ -602,7 +600,6 @@ class MediaRegistryService:
|
||||
def get_download_statistics(self) -> dict:
|
||||
"""Get comprehensive download statistics."""
|
||||
try:
|
||||
from .models import DownloadStatus
|
||||
|
||||
stats = {
|
||||
"total_episodes": 0,
|
||||
|
||||
@@ -4,8 +4,7 @@ import subprocess
|
||||
import tempfile
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import Optional, Dict, Any, Callable, Union
|
||||
from urllib.parse import urlparse
|
||||
from typing import Optional, Dict, Any, Callable
|
||||
|
||||
from ..exceptions import FastAnimeError, DependencyNotFoundError
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ Usage:
|
||||
"""
|
||||
|
||||
import logging
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ Author: FastAnime Contributors
|
||||
|
||||
import json
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from typing import Dict, Optional
|
||||
|
||||
from ..constants import ASSETS_DIR
|
||||
|
||||
@@ -6,7 +6,7 @@ that was previously sourced from yt-dlp.
|
||||
"""
|
||||
|
||||
import string
|
||||
from typing import Union, Optional
|
||||
from typing import Optional
|
||||
|
||||
|
||||
def encode_base_n(num: int, n: int, table: Optional[str] = None) -> str:
|
||||
|
||||
@@ -5,9 +5,8 @@ Tests for the TorrentDownloader class.
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest.mock import Mock, patch, MagicMock
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from fastanime.core.downloader.torrents import (
|
||||
TorrentDownloader,
|
||||
|
||||
Reference in New Issue
Block a user