Remove legacy rar settings
This commit is contained in:
parent
46899255c8
commit
2c5d419ee9
@ -82,7 +82,6 @@ class ComicArchive:
|
||||
def __init__(
|
||||
self,
|
||||
path: pathlib.Path | str,
|
||||
rar_exe_path: str = "rar",
|
||||
default_image_path: pathlib.Path | str | None = None,
|
||||
) -> None:
|
||||
self.cbi_md: GenericMetadata | None = None
|
||||
@ -96,7 +95,6 @@ class ComicArchive:
|
||||
self.page_count: int | None = None
|
||||
self.page_list: list[str] = []
|
||||
|
||||
self.rar_exe_path = shutil.which(rar_exe_path or "rar") or ""
|
||||
self.ci_xml_filename = "ComicInfo.xml"
|
||||
self.comet_default_filename = "CoMet.xml"
|
||||
self.reset_cache()
|
||||
|
@ -560,7 +560,7 @@ class CLI:
|
||||
logger.error("Cannot find %s", filename)
|
||||
return
|
||||
|
||||
ca = ComicArchive(filename, self.options.general_rar_exe_path, str(graphics_path / "nocover.png"))
|
||||
ca = ComicArchive(filename, str(graphics_path / "nocover.png"))
|
||||
|
||||
if not ca.seems_to_be_a_comic_archive():
|
||||
logger.error("Sorry, but %s is not a comic archive!", filename)
|
||||
|
@ -18,7 +18,6 @@ from __future__ import annotations
|
||||
import argparse
|
||||
import logging
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
|
||||
import settngs
|
||||
@ -326,13 +325,6 @@ def validate_commandline_options(options: settngs.Config[settngs.Values], parser
|
||||
else:
|
||||
options[0].runtime_file_list = options[0].runtime_files
|
||||
|
||||
rar_path = pathlib.Path(options[0].general_rar_exe_path)
|
||||
if rar_path.is_absolute() and rar_path.exists():
|
||||
if rar_path.is_dir():
|
||||
utils.add_to_path(str(rar_path))
|
||||
else:
|
||||
utils.add_to_path(str(rar_path.parent))
|
||||
|
||||
# take a crack at finding rar exe if it's not in the path
|
||||
if not utils.which("rar"):
|
||||
if platform.system() == "Windows":
|
||||
|
@ -12,13 +12,6 @@ from comictaggerlib.defaults import DEFAULT_REPLACEMENTS, Replacement, Replaceme
|
||||
|
||||
def general(parser: settngs.Manager) -> None:
|
||||
# General Settings
|
||||
parser.add_setting("--rar-exe-path", default="rar", help="The path to the rar program")
|
||||
parser.add_setting(
|
||||
"--allow-cbi-in-rar",
|
||||
default=True,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Allows ComicBookLover tags in RAR/CBR files",
|
||||
)
|
||||
parser.add_setting("check_for_new_version", default=False, cmdline=False)
|
||||
parser.add_setting("send_usage_stats", default=False, cmdline=False)
|
||||
|
||||
@ -59,7 +52,6 @@ def identifier(parser: settngs.Manager) -> None:
|
||||
|
||||
def dialog(parser: settngs.Manager) -> None:
|
||||
# Show/ask dialog flags
|
||||
parser.add_setting("ask_about_cbi_in_rar", default=True, cmdline=False)
|
||||
parser.add_setting("show_disclaimer", default=True, cmdline=False)
|
||||
parser.add_setting("dont_notify_about_this_version", default="", cmdline=False)
|
||||
parser.add_setting("ask_about_usage_stats", default=True, cmdline=False)
|
||||
|
@ -23,6 +23,8 @@ def archiver(manager: settngs.Manager) -> None:
|
||||
|
||||
|
||||
def validate_plugin_settings(options: settngs.Config) -> settngs.Config:
|
||||
if "archiver" not in options[1]:
|
||||
return options
|
||||
cfg = settngs.normalize_config(options, file=True, cmdline=True, defaults=False)
|
||||
for archiver in comicapi.comicarchive.archivers:
|
||||
exe_name = archiver.exe.replace(" ", "-").replace("_", "-").strip().strip("-").replace("-", "_")
|
||||
|
@ -277,7 +277,7 @@ class FileSelectionList(QtWidgets.QWidget):
|
||||
if self.is_list_dupe(path):
|
||||
return self.get_current_list_row(path)
|
||||
|
||||
ca = ComicArchive(path, self.options.general_rar_exe_path, str(graphics_path / "nocover.png"))
|
||||
ca = ComicArchive(path, str(graphics_path / "nocover.png"))
|
||||
|
||||
if ca.seems_to_be_a_comic_archive():
|
||||
row: int = self.twList.rowCount()
|
||||
|
@ -269,7 +269,10 @@ class SettingsWindow(QtWidgets.QDialog):
|
||||
|
||||
def settings_to_form(self) -> None:
|
||||
# Copy values from settings to form
|
||||
self.leRarExePath.setText(self.options[0].general_rar_exe_path)
|
||||
if "archiver" in self.options[1] and "rar" in self.options[1]["archiver"]:
|
||||
self.leRarExePath.setText(getattr(self.options[0], self.options[1]["archiver"]["rar"].internal_name))
|
||||
else:
|
||||
self.leRarExePath.setEnabled(False)
|
||||
self.sbNameMatchIdentifyThresh.setValue(self.options[0].identifier_series_match_identify_thresh)
|
||||
self.sbNameMatchSearchThresh.setValue(self.options[0].comicvine_series_match_search_thresh)
|
||||
self.tePublisherFilter.setPlainText("\n".join(self.options[0].identifier_publisher_filter))
|
||||
@ -374,11 +377,12 @@ class SettingsWindow(QtWidgets.QDialog):
|
||||
)
|
||||
|
||||
# Copy values from form to settings and save
|
||||
self.options[0].general_rar_exe_path = str(self.leRarExePath.text())
|
||||
if "archiver" in self.options[1] and "rar" in self.options[1]["archiver"]:
|
||||
setattr(self.options[0], self.options[1]["archiver"]["rar"].internal_name, str(self.leRarExePath.text()))
|
||||
|
||||
# make sure rar program is now in the path for the rar class
|
||||
if self.options[0].general_rar_exe_path:
|
||||
utils.add_to_path(os.path.dirname(self.options[0].general_rar_exe_path))
|
||||
# make sure rar program is now in the path for the rar class
|
||||
if self.options[0].archivers_rar:
|
||||
utils.add_to_path(os.path.dirname(str(self.leRarExePath.text())))
|
||||
|
||||
if not str(self.leIssueNumPadding.text()).isdigit():
|
||||
self.leIssueNumPadding.setText("0")
|
||||
|
Loading…
Reference in New Issue
Block a user