Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config get_body_args #8737

Merged
merged 66 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
5cf05fb
edit dir dirty fix
BKSteve Mar 3, 2024
81dd622
Merge branch 'develop' into editshow-return
BKSteve Mar 6, 2024
772db48
get args
BKSteve Mar 6, 2024
079279e
Merge remote-tracking branch 'origin/develop' into editshow-return
BKSteve Mar 8, 2024
1f7b792
Merge branch 'develop' into editshow-return
BKSteve Mar 9, 2024
aba310b
making an Edit mass mess
BKSteve Mar 9, 2024
a35562a
e,d,k explicit
BKSteve Mar 9, 2024
093b838
massUpdate sticky headers
BKSteve Mar 9, 2024
0fd5e61
massUpdate sticky headers
BKSteve Mar 9, 2024
ce1c126
Merge remote-tracking branch 'origin/editshow-return' into editshow-r…
BKSteve Mar 9, 2024
d2b985f
init super ??
BKSteve Mar 9, 2024
a23cfed
Merge remote-tracking branch 'origin/develop' into editshow-return
BKSteve Mar 10, 2024
e0f2be8
sort the exceptions list
BKSteve Mar 10, 2024
7edd709
sort the exceptions list note
BKSteve Mar 10, 2024
672e1fa
Merge remote-tracking branch 'origin/develop' into editshow-return
BKSteve Mar 12, 2024
9be059e
Merge remote-tracking branch 'origin/develop' into editshow-return
BKSteve Mar 13, 2024
6e7f01f
kill off init
BKSteve Mar 13, 2024
5230e8e
saveGeneral get_arg
BKSteve Mar 13, 2024
e77988d
saveGeneral get_arg
BKSteve Mar 13, 2024
e2f2cd7
logging relocate
BKSteve Mar 14, 2024
6f061bd
search page
BKSteve Mar 14, 2024
9f6cb84
postprocessing page
BKSteve Mar 14, 2024
ccdd194
postprocessing page
BKSteve Mar 14, 2024
31c7b7d
subtitles page
BKSteve Mar 14, 2024
ed02104
notifications page
BKSteve Mar 14, 2024
8be8350
anime page
BKSteve Mar 14, 2024
ac7d762
Merge remote-tracking branch 'origin/develop' into config_args
BKSteve Mar 14, 2024
e32ed31
addshow arg
BKSteve Mar 15, 2024
8c8542c
addshow arg
BKSteve Mar 15, 2024
462829b
addshow arg
BKSteve Mar 15, 2024
76d93ad
Merge remote-tracking branch 'origin/config_args' into config_args
BKSteve Mar 16, 2024
d6261f6
post processing arg
BKSteve Mar 17, 2024
20ff20a
newShow arg
BKSteve Mar 17, 2024
6825e3d
Merge remote-tracking branch 'origin/develop' into config_args
BKSteve Mar 26, 2024
2a8864c
logging own tab
BKSteve Mar 26, 2024
b908790
logging tab location
BKSteve Mar 26, 2024
5ac8320
logging notify
BKSteve Mar 26, 2024
648ff95
Merge remote-tracking branch 'origin/develop' into config_args
BKSteve Mar 29, 2024
29d3b28
schedule show custom name
BKSteve Mar 29, 2024
7517e22
comment fix
BKSteve Apr 6, 2024
a02e23c
Merge remote-tracking branch 'refs/remotes/origin/develop' into confi…
BKSteve Apr 10, 2024
5d17fcc
Fix some calls
BKSteve Apr 10, 2024
53c43b6
deprication warning
BKSteve Apr 12, 2024
517103c
poe format
BKSteve Apr 12, 2024
17d23e1
pylint else timeout
BKSteve Apr 12, 2024
7db4013
pylint else elseif
BKSteve Apr 12, 2024
80f7928
rabbit logger
BKSteve Apr 12, 2024
8c6ed11
Merge branch 'refs/heads/develop' into config_args
BKSteve Apr 12, 2024
b91a100
cleaning
BKSteve Apr 12, 2024
8b05a01
validators
BKSteve Apr 12, 2024
e877fef
valid_url and validators to helper.common
BKSteve Apr 13, 2024
af70058
Pylint relative import beyond top-level package
BKSteve Apr 13, 2024
15c077e
Rabbit identified items for clarity
BKSteve Apr 14, 2024
4cf292d
absolute paths PEP 8
BKSteve Apr 14, 2024
4398821
Pylint Exception order
BKSteve Apr 14, 2024
cae867b
clean up
BKSteve Apr 14, 2024
d63ebe5
Merge remote-tracking branch 'origin/config_args' into config_args
BKSteve Apr 15, 2024
a293f54
mako indents
BKSteve Apr 17, 2024
1dc6c0d
Calendar tz calc display
BKSteve Apr 19, 2024
4dc1c2f
Merge branch 'refs/heads/develop' into config_args
BKSteve Apr 19, 2024
7bf8a33
calendar change revert
BKSteve Apr 22, 2024
9f49538
ruff cleanup
BKSteve Apr 27, 2024
8c56151
ruff setting
BKSteve Apr 27, 2024
aa9db9c
format
BKSteve Apr 27, 2024
877fc97
ruff builtin
BKSteve Apr 27, 2024
b769660
Merge branch 'develop' into config_args
miigotu Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions sickchill/adba/aniDBAbstracter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import string
from pathlib import Path

from . import aniDBfileInfo as fileInfo
from .aniDBerrors import AniDBIncorrectParameterError
from .aniDBfileInfo import read_anidb_xml
from .aniDBmapper import AniDBMapper
from .aniDBtvDBmaper import TvDBMap
from sickchill.adba import aniDBfileInfo as fileInfo
from sickchill.adba.aniDBerrors import AniDBIncorrectParameterError
from sickchill.adba.aniDBfileInfo import read_anidb_xml
from sickchill.adba.aniDBmapper import AniDBMapper
from sickchill.adba.aniDBtvDBmaper import TvDBMap


class AniDBabstractObject(object):
Expand Down
4 changes: 2 additions & 2 deletions sickchill/adba/aniDBfileInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def md4_hash(data):
hashes = [md4_hash(data).digest() for data in a]
if len(hashes) == 1:
return hashes[0].hex()
else:
return md4_hash(reduce(lambda b, c: b + c, hashes, b"")).hexdigest()

return md4_hash(reduce(lambda b, c: b + c, hashes, b"")).hexdigest()


def download_file(url, filename: Path):
Expand Down
4 changes: 2 additions & 2 deletions sickchill/adba/aniDBlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ def _cmd_queue(self, command):
def _cmd_dequeue(self, resp) -> Command:
if not resp.restag:
return None
else:
return self.cmd_queue.pop(resp.restag)

return self.cmd_queue.pop(resp.restag)

def _delay(self):
return self.delay < 2.1 and 2.1 or self.delay
Expand Down
4 changes: 2 additions & 2 deletions sickchill/adba/aniDBtvDBmaper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path

from . import aniDBfileInfo as fileInfo
from sickchill.adba import aniDBfileInfo as fileInfo


class TvDBMap(object):
Expand All @@ -20,7 +20,7 @@ def _get_x_for_y(self, xValue, x, y):
try:
if anime.get(x, False) == xValue:
return int(anime.get(y, 0))
except ValueError as error:
except ValueError:
continue
return 0

Expand Down
1 change: 1 addition & 0 deletions sickchill/gui/slick/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -3391,6 +3391,7 @@ const SICKCHILL = {
columnSelector_columns: { // eslint-disable-line camelcase
12: false,
},
stickyHeaders_offset: 50, // eslint-disable-line camelcase
filter_cssFilter: 'text-center text-capitalize', // eslint-disable-line camelcase
filter_hideFilters: false, // eslint-disable-line camelcase
filter_ignoreCase: true, // eslint-disable-line camelcase
Expand Down
2 changes: 1 addition & 1 deletion sickchill/gui/slick/js/core.min.js

Large diffs are not rendered by default.

203 changes: 117 additions & 86 deletions sickchill/gui/slick/views/config_general.mako

Large diffs are not rendered by default.

23 changes: 18 additions & 5 deletions sickchill/helper/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import appdirs
import rarfile
import validators

from sickchill import settings
from sickchill.init_helpers import get_current_version
Expand Down Expand Up @@ -344,9 +345,9 @@ def replace_extension(filename: Union[Path, PathLike, str], new_extension: str)
return filename
if not path.suffix:
return filename
else:
if new_extension and not new_extension.startswith("."):
new_extension = f".{new_extension}"

if new_extension and not new_extension.startswith("."):
new_extension = f".{new_extension}"

return type(filename)(path.with_suffix(new_extension))

Expand All @@ -372,7 +373,19 @@ def sanitize_filename(filename):
return ""


def try_int(candidate, default_value=0):
def valid_url(url):
try:
valid = validators.url(url)
except validators.utils.ValidationError:
valid = False # ValidationError isn't an exception so doesn't actually get here

if not valid:
valid = False # if ValidationError in response set to False

return valid


def try_int(candidate, default_value=0) -> int:
"""
Try to convert ``candidate`` to int, or return the ``default_value``.
:param candidate: The value to convert to int
Expand All @@ -386,7 +399,7 @@ def try_int(candidate, default_value=0):
return default_value


def try_float(candidate, default_value=0):
def try_float(candidate, default_value=0) -> float:
"""
Try to convert ``candidate`` to int, or return the ``default_value``.
:param candidate: The value to convert to int
Expand Down
5 changes: 4 additions & 1 deletion sickchill/helper/media_info.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import binascii
import warnings

from enzyme import MKV
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
from enzyme import MKV

from sickchill.helper.common import is_media_file

Expand Down
2 changes: 1 addition & 1 deletion sickchill/helper/rootdirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self, root_directories_string: str = "", root_directories_list: Uni
if self.default:
logger.debug(f"default root directory: {self[self.default]}")
else:
logger.debug(f"no default root directory set")
logger.debug("no default root directory set")

def parse(self, root_directories_string: str = "", root_directories_list: Union[list, None] = None) -> None:
split_setting = root_directories_list or root_directories_string.split("|")
Expand Down
6 changes: 3 additions & 3 deletions sickchill/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from sqlalchemy.orm import Session
from tmdbsimple import movies, search

from . import settings
from .oldbeard.databases import movie
from .oldbeard.db import db_cons, db_full_path, db_locks
from sickchill import settings
from sickchill.oldbeard.databases import movie
from sickchill.oldbeard.db import db_cons, db_full_path, db_locks

logger = logging.getLogger("sickchill.movie")

Expand Down
6 changes: 3 additions & 3 deletions sickchill/oldbeard/blackandwhitelist.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from sickchill import logger, settings
from sickchill.adba.aniDBerrors import AniDBCommandTimeoutError

from . import db, helpers
from sickchill.oldbeard import db, helpers


class BlackAndWhiteList(object):
Expand Down Expand Up @@ -129,9 +128,10 @@ def short_group_names(groups):
Find AniDB short group names for release groups

:param groups: list of groups to find short group names for
remove any leading and trailing commas
:return: list of shortened group names
"""
groups = groups.split(",")
groups = groups.strip(",").split(",")
short_group_list = []
if helpers.set_up_anidb_connection():
for groupName in groups:
Expand Down
3 changes: 1 addition & 2 deletions sickchill/oldbeard/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

import sickchill
from sickchill.helper.common import dateTimeFormat

from .common import Quality
from sickchill.oldbeard.common import Quality

if TYPE_CHECKING:
from ..providers.GenericProvider import GenericProvider
Expand Down
3 changes: 1 addition & 2 deletions sickchill/oldbeard/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@

from sickchill.helper import video_screen_size
from sickchill.init_helpers import setup_gettext
from sickchill.oldbeard.numdict import NumDict
from sickchill.recompiled import tags
from sickchill.tagger.episode import EpisodeTags

from .numdict import NumDict

setup_gettext()

cpu_presets = {"HIGH": 5, "NORMAL": 2, "LOW": 1}
Expand Down
3 changes: 1 addition & 2 deletions sickchill/oldbeard/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
import sickchill.start
from sickchill import logger, settings
from sickchill.helper.common import try_int

from . import db, helpers, naming
from sickchill.oldbeard import db, helpers, naming

# Address poor support for scgi over unix domain sockets
# this is not nicely handled by python currently
Expand Down
3 changes: 1 addition & 2 deletions sickchill/oldbeard/dailysearcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
import sickchill.oldbeard.search_queue
from sickchill import logger, settings
from sickchill.helper.exceptions import MultipleShowObjectsException
from sickchill.oldbeard import common, db, network_timezones
from sickchill.show.Show import Show

from . import common, db, network_timezones


class DailySearcher(object):
def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion sickchill/oldbeard/databases/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def execute(self):


class AddCustomNameToShow(AddPreferWords):
"""Adding column rls_prefer_words to tv_shows"""
"""Adding column custom_name to tv_shows"""

def test(self):
return self.has_column("tv_shows", "custom_name")
Expand Down
2 changes: 1 addition & 1 deletion sickchill/oldbeard/event_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import traceback
from queue import Empty, Queue

from .. import logger
from sickchill import logger


class Event(object):
Expand Down
5 changes: 2 additions & 3 deletions sickchill/oldbeard/failedProcessor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import logging

import validators

from sickchill import logger, settings
from sickchill.helper.common import valid_url
from sickchill.helper.exceptions import FailedPostProcessingFailedException
from sickchill.oldbeard import search_queue, show_name_helpers
from sickchill.oldbeard.db import DBConnection
Expand Down Expand Up @@ -30,7 +29,7 @@ def process(self):
"""
self._log(_("Failed download detected: ({release_name}, {directory})").format(release_name=self.release_name, directory=self.directory))

if self.release_name and validators.url(self.release_name) is True:
if self.release_name and valid_url(self.release_name) is True:
cache_db_con = DBConnection("cache.db")
cache_result = cache_db_con.select_one("SELECT name FROM results WHERE url = ?", [self.release_name])
if cache_result:
Expand Down
2 changes: 1 addition & 1 deletion sickchill/oldbeard/generic_queue.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime
import threading

from .. import logger
from sickchill import logger


class QueuePriorities(object):
Expand Down
7 changes: 3 additions & 4 deletions sickchill/oldbeard/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
from sickchill import adba, logger, settings
from sickchill.helper import episode_num, pretty_file_size, SUBTITLE_EXTENSIONS
from sickchill.helper.common import is_media_file, replace_extension, USER_AGENT
from sickchill.oldbeard import db
from sickchill.show.Show import Show

from . import db

# Add some missing languages
LOCALE_NAMES.update(
{
Expand Down Expand Up @@ -792,7 +791,7 @@ def check_url(url):
We only check the URL header.
"""
try:
requests.head(url, verify=False).raise_for_status()
requests.head(url, verify=False, timeout=10).raise_for_status()
except Exception as error:
# noinspection PyTypeChecker
handle_requests_exception(error)
Expand Down Expand Up @@ -1725,7 +1724,7 @@ def manage_torrents_url(reset=False):

def test_exists(url):
try:
h = requests.head(url)
h = requests.head(url, timeout=10)
return h.status_code != 404
except requests.exceptions.RequestException:
return False
Expand Down
5 changes: 2 additions & 3 deletions sickchill/oldbeard/image_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
import sickchill
from sickchill import logger, settings
from sickchill.helper.exceptions import ShowDirectoryNotFoundException
from sickchill.oldbeard import helpers
from sickchill.providers.metadata.generic import GenericMetadata
from sickchill.providers.metadata.helpers import getShowImage

from . import helpers


class ImageCache(object):
def __init__(self):
Expand Down Expand Up @@ -87,7 +86,7 @@ def has_poster(self, indexer_id):
Returns true if a cached poster exists for the given Indexer ID
"""
poster_path = self.poster_path(indexer_id)
logger.debug(f"Checking if file poster_path exists")
logger.debug(f"Checking if file poster_path exists; {poster_path}")
return os.path.isfile(poster_path)

def has_banner(self, indexer_id):
Expand Down
7 changes: 2 additions & 5 deletions sickchill/oldbeard/name_cache.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import threading

from sickchill import settings
from sickchill.oldbeard import helpers, scene_exceptions
from sickchill import logger, settings
from sickchill.oldbeard import db, helpers, scene_exceptions
from sickchill.show.Show import Show

from .. import logger
from . import db

name_cache = {}
name_cache_lock = threading.Lock()

Expand Down
7 changes: 3 additions & 4 deletions sickchill/oldbeard/naming.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
import os

from sickchill import logger, settings
from sickchill.oldbeard import common
from sickchill.oldbeard.common import DOWNLOADED, Quality
from sickchill.oldbeard.name_parser.parser import InvalidNameException, InvalidShowException, NameParser
from sickchill.tv import TVEpisode

from . import common
from .common import DOWNLOADED, Quality
from .name_parser.parser import InvalidNameException, InvalidShowException, NameParser

name_presets = ("%SN - %Sx%0E", "%SN - %Sx%0E - %EN", "%S.N.S%0SE%0E.%E.N", "%Sx%0E - %EN", "S%0SE%0E - %EN", "Season %0S/%S.N.S%0SE%0E.%Q.N-%RG")

name_anime_presets = name_presets
Expand Down
5 changes: 2 additions & 3 deletions sickchill/oldbeard/network_timezones.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

from dateutil import tz

from sickchill import logger
from sickchill.helper.common import try_int

from .. import logger
from . import db, helpers
from sickchill.oldbeard import db, helpers

# regex to parse time (12/24-hour format)
time_regex = re.compile(r"(?P<hour>\d{1,2})(?:[:.](?P<minute>\d{2})?)? ?(?P<meridiem>[PA]\.? ?M?)?\b", re.I)
Expand Down
3 changes: 1 addition & 2 deletions sickchill/oldbeard/notifications_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from requests.structures import CaseInsensitiveDict

from sickchill import logger, settings

from . import common, generic_queue
from sickchill.oldbeard import common, generic_queue

DISCORD = 600

Expand Down
6 changes: 3 additions & 3 deletions sickchill/oldbeard/nzbSplitter.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import re
from xml.etree import ElementTree

from .. import logger
from . import classes, helpers
from .name_parser.parser import InvalidNameException, InvalidShowException, NameParser
from sickchill import logger
from sickchill.oldbeard import classes, helpers
from sickchill.oldbeard.name_parser.parser import InvalidNameException, InvalidShowException, NameParser


def get_season_nzbs(name, url_data, season):
Expand Down
3 changes: 1 addition & 2 deletions sickchill/oldbeard/nzbget.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@

from sickchill import logger, settings
from sickchill.helper.common import try_int
from sickchill.oldbeard.common import Quality
from sickchill.oldbeard.helpers import make_context

from .common import Quality

if TYPE_CHECKING:
from .classes import SearchResult

Expand Down
Loading
Loading