Remove setting options and logo_url.
This commit is contained in:
parent
134c4a60e9
commit
3e8ee864b7
@ -16,9 +16,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from typing import Any, Callable
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
from typing import Callable
|
||||
|
||||
from comicapi.genericmetadata import GenericMetadata
|
||||
from comictalker.resulttypes import ComicIssue, ComicVolume
|
||||
@ -43,7 +41,6 @@ class SourceDetails:
|
||||
class SourceStaticOptions:
|
||||
def __init__(
|
||||
self,
|
||||
logo_url: str = "", # No longer required?
|
||||
website: str = "",
|
||||
has_issues: bool = False,
|
||||
has_alt_covers: bool = False,
|
||||
@ -51,7 +48,6 @@ class SourceStaticOptions:
|
||||
has_nsfw: bool = False,
|
||||
has_censored_covers: bool = False,
|
||||
) -> None:
|
||||
self.logo_url = logo_url
|
||||
self.website = website
|
||||
self.has_issues = has_issues
|
||||
self.has_alt_covers = has_alt_covers
|
||||
@ -60,16 +56,6 @@ class SourceStaticOptions:
|
||||
self.has_censored_covers = has_censored_covers
|
||||
|
||||
|
||||
class SourceSettingsOptions(TypedDict):
|
||||
# Source settings options and used to generate settings options in panel
|
||||
name: Required[str] # Internal name for setting i.e "remove_html_tables"
|
||||
text: Required[str] # Display text i.e "Remove HTML tables"
|
||||
help_text: str # Tooltip text i.e "Enabling this will remove HTML tables from the description."
|
||||
hidden: Required[bool] # To hide an option from the settings menu.
|
||||
type: Required[type[bool] | type[int] | type[str] | type[float]]
|
||||
value: Any
|
||||
|
||||
|
||||
class TalkerError(Exception):
|
||||
"""Base class exception for information sources.
|
||||
|
||||
|
@ -31,14 +31,7 @@ from comicapi.issuestring import IssueString
|
||||
from comictaggerlib import ctversion
|
||||
from comictalker.comiccacher import ComicCacher
|
||||
from comictalker.resulttypes import ComicIssue, ComicVolume, Credits
|
||||
from comictalker.talkerbase import (
|
||||
ComicTalker,
|
||||
SourceDetails,
|
||||
SourceSettingsOptions,
|
||||
SourceStaticOptions,
|
||||
TalkerDataError,
|
||||
TalkerNetworkError,
|
||||
)
|
||||
from comictalker.talkerbase import ComicTalker, SourceDetails, SourceStaticOptions, TalkerDataError, TalkerNetworkError
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -178,10 +171,8 @@ class ComicVineTalker(ComicTalker):
|
||||
self.source_details = SourceDetails(
|
||||
name="Comic Vine",
|
||||
ident="comicvine",
|
||||
logo="comictalker/talkers/logos/comicvine.png",
|
||||
)
|
||||
self.static_options = SourceStaticOptions(
|
||||
logo_url="https://comicvine.gamespot.com/a/bundles/comicvinesite/images/logo.png",
|
||||
website="https://comicvine.gamespot.com/",
|
||||
has_issues=True,
|
||||
has_alt_covers=True,
|
||||
@ -189,61 +180,6 @@ class ComicVineTalker(ComicTalker):
|
||||
has_nsfw=False,
|
||||
has_censored_covers=False,
|
||||
)
|
||||
# TODO Remove or leave in for future?
|
||||
self.settings_options = {
|
||||
"enabled": SourceSettingsOptions(
|
||||
name="enabled", text="Enabled", help_text="", hidden=True, type=bool, value=True
|
||||
),
|
||||
"order": SourceSettingsOptions(name="order", text="Order", help_text="", hidden=True, type=int, value=1),
|
||||
"remove_html_tables": SourceSettingsOptions(
|
||||
name="remove_html_tables",
|
||||
text="Remove HTML tables",
|
||||
help_text="Remove tables in description",
|
||||
hidden=False,
|
||||
type=bool,
|
||||
value=False,
|
||||
),
|
||||
"use_series_start_as_volume": SourceSettingsOptions(
|
||||
name="use_series_start_as_volume",
|
||||
text="Use series start year as volume number",
|
||||
help_text="Use the series start year as the volume number",
|
||||
hidden=False,
|
||||
type=bool,
|
||||
value=False,
|
||||
),
|
||||
"wait_on_ratelimit": SourceSettingsOptions(
|
||||
name="wait_on_ratelimit",
|
||||
text="Retry on API limit",
|
||||
help_text="If the Comic Vine API limit is reached, wait and retry",
|
||||
hidden=False,
|
||||
type=bool,
|
||||
value=False,
|
||||
),
|
||||
"ratelimit_waittime": SourceSettingsOptions(
|
||||
name="ratelimit_waittime",
|
||||
text="API maximum wait time (minutes)",
|
||||
help_text="Maximum time to wait before abandoning retries",
|
||||
hidden=False,
|
||||
type=int,
|
||||
value=20,
|
||||
),
|
||||
"url_root": SourceSettingsOptions(
|
||||
name="url_root",
|
||||
text="Comic Vine API address",
|
||||
help_text="Example: https://api.comicsource.net",
|
||||
hidden=False,
|
||||
type=str,
|
||||
value="https://comicvine.gamespot.com/api",
|
||||
),
|
||||
"api_key": SourceSettingsOptions(
|
||||
name="api_key",
|
||||
text="API key",
|
||||
help_text="Comic Vine API key",
|
||||
hidden=False,
|
||||
type=str,
|
||||
value="27431e6787042105bd3e47e169a624521f89f3a4",
|
||||
),
|
||||
}
|
||||
|
||||
# Identity name for the information source
|
||||
self.source_name = self.source_details.id
|
||||
|
Loading…
Reference in New Issue
Block a user