diff --git a/comictaggerlib/settingswindow.py b/comictaggerlib/settingswindow.py index 05acdcc..1b7b356 100644 --- a/comictaggerlib/settingswindow.py +++ b/comictaggerlib/settingswindow.py @@ -28,6 +28,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets, uic import comictaggerlib.ui.talkeruigenerator from comicapi import utils from comicapi.genericmetadata import md_test +from comictaggerlib import ctsettings from comictaggerlib.ctversion import version from comictaggerlib.filerenamer import FileRenamer, Replacement, Replacements from comictaggerlib.imagefetcher import ImageFetcher @@ -466,9 +467,9 @@ class SettingsWindow(QtWidgets.QDialog): QtWidgets.QDialog.accept(self) def update_talkers_config(self) -> None: - cfg = settngs.normalize_config(self.config, True, True) - for talker, talker_obj in self.talkers.items(): - talker_obj.parse_settings(cfg[0][f"talker_{talker}"]) + ctsettings.talkers = self.talkers + self.config = ctsettings.plugin.validate_talker_settings(self.config) + del ctsettings.talkers def select_rar(self) -> None: self.select_file(self.leRarExePath, "RAR") diff --git a/comictalker/comictalker.py b/comictalker/comictalker.py index e5c5d04..aac83ae 100644 --- a/comictalker/comictalker.py +++ b/comictalker/comictalker.py @@ -135,6 +135,8 @@ class ComicTalker: if settings[f"{self.id}_url"]: self.api_url = fix_url(settings[f"{self.id}_url"]) + settings[f"{self.id}_url"] = self.api_url + if self.api_key == "": self.api_key = self.default_api_key if self.api_url == "": diff --git a/comictalker/talker_utils.py b/comictalker/talker_utils.py index 8f8f329..c397d79 100644 --- a/comictalker/talker_utils.py +++ b/comictalker/talker_utils.py @@ -14,6 +14,7 @@ from __future__ import annotations import logging +import posixpath import re from urllib.parse import urlsplit @@ -30,8 +31,7 @@ logger = logging.getLogger(__name__) def fix_url(url: str) -> str: tmp_url = urlsplit(url) # joinurl only works properly if there is a trailing slash - if tmp_url.path and tmp_url.path[-1] != "/": - tmp_url = tmp_url._replace(path=tmp_url.path + "/") + tmp_url = tmp_url._replace(path=posixpath.normpath(tmp_url.path) + "/") return tmp_url.geturl()