mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 15:13:24 +02:00
format files
This commit is contained in:
@@ -23,11 +23,15 @@ def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
op.add_column(
|
||||
"movie",
|
||||
sa.Column("library", sa.String(), nullable=False, server_default=sa.text("'Default'")),
|
||||
sa.Column(
|
||||
"library", sa.String(), nullable=False, server_default=sa.text("'Default'")
|
||||
),
|
||||
)
|
||||
op.add_column(
|
||||
"show",
|
||||
sa.Column("library", sa.String(), nullable=False, server_default=sa.text("'Default'")),
|
||||
sa.Column(
|
||||
"library", sa.String(), nullable=False, server_default=sa.text("'Default'")
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -13,25 +13,30 @@ class JackettConfig(BaseSettings):
|
||||
url: str = "http://localhost:9696"
|
||||
indexers: list[str] = ["all"]
|
||||
|
||||
|
||||
class ScoringRule(BaseSettings):
|
||||
name: str
|
||||
score_modifier: int = 0
|
||||
negate: bool = False
|
||||
|
||||
|
||||
class TitleScoringRule(ScoringRule):
|
||||
keywords: list[str]
|
||||
|
||||
|
||||
class IndexerFlagScoringRule(ScoringRule):
|
||||
flags: list[str]
|
||||
|
||||
|
||||
class ScoringRuleSet(BaseSettings):
|
||||
name: str
|
||||
libraries: list[str] = []
|
||||
rule_names: list[str] = []
|
||||
|
||||
|
||||
class IndexerConfig(BaseSettings):
|
||||
prowlarr: ProwlarrConfig
|
||||
jackett: JackettConfig
|
||||
title_scoring_rules: list[TitleScoringRule] = []
|
||||
indexer_flag_scoring_rules: list[IndexerFlagScoringRule] = []
|
||||
scoring_rule_sets: list[ScoringRuleSet] = []
|
||||
scoring_rule_sets: list[ScoringRuleSet] = []
|
||||
|
||||
@@ -56,7 +56,7 @@ class Jackett(GenericIndexer):
|
||||
if attribute.attrib["name"] == "seeders":
|
||||
seeders = int(attribute.attrib["value"])
|
||||
if attribute.attrib["name"] == "downloadvolumefactor":
|
||||
download_volume_factor = float(attribute.attrib["value"])
|
||||
download_volume_factor = float(attribute.attrib["value"])
|
||||
if attribute.attrib["name"] == "uploadvolumefactor":
|
||||
upload_volume_factor = int(attribute.attrib["value"])
|
||||
flags = []
|
||||
|
||||
@@ -101,4 +101,3 @@ class PublicIndexerQueryResult(BaseModel):
|
||||
age: int
|
||||
|
||||
score: int
|
||||
|
||||
|
||||
@@ -279,7 +279,9 @@ def get_movie_files_by_movie_id(movie_service: movie_service_dep, movie_id: Movi
|
||||
def set_library(
|
||||
movie_id: MovieId,
|
||||
movie_service: movie_service_dep,
|
||||
library: Literal[*[x.name for x in AllEncompassingConfig().misc.movie_libraries], "Default"],
|
||||
library: Literal[
|
||||
*[x.name for x in AllEncompassingConfig().misc.movie_libraries], "Default"
|
||||
],
|
||||
) -> None:
|
||||
"""
|
||||
Sets the library of a movie.
|
||||
|
||||
@@ -197,7 +197,9 @@ class MovieService:
|
||||
):
|
||||
result.append(torrent)
|
||||
|
||||
return evaluate_indexer_query_results(is_tv=False, query_results=result, media=movie)
|
||||
return evaluate_indexer_query_results(
|
||||
is_tv=False, query_results=result, media=movie
|
||||
)
|
||||
|
||||
def get_all_movies(self) -> list[Movie]:
|
||||
"""
|
||||
|
||||
@@ -176,7 +176,9 @@ def get_a_shows_torrents(show: show_dep, tv_service: tv_service_dep):
|
||||
def set_library(
|
||||
show: show_dep,
|
||||
tv_service: tv_service_dep,
|
||||
library: Literal[*[x.name for x in AllEncompassingConfig().misc.tv_libraries], "Default"],
|
||||
library: Literal[
|
||||
*[x.name for x in AllEncompassingConfig().misc.tv_libraries], "Default"
|
||||
],
|
||||
) -> None:
|
||||
"""
|
||||
Sets the library of a Show.
|
||||
|
||||
Reference in New Issue
Block a user