feat: config option for selecting manga viewer

This commit is contained in:
iMithrellas
2025-05-07 00:44:39 +02:00
parent 2e902fa4e7
commit 59e1a82646
2 changed files with 14 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ def search(config: "Config", anime_titles: str, episode_range: str):
from ...MangaProvider import MangaProvider
# from ..utils.feh import feh_manga_viewer
from ..utils.feh import feh_manga_viewer
from ..utils.icat import icat_manga_viewer
manga_title = anime_titles[0]
@@ -138,7 +138,12 @@ def search(config: "Config", anime_titles: str, episode_range: str):
print(
f"[purple bold]Now Reading: [/] {search_result_manga_title} [cyan bold]Chapter:[/] {chapter_info['title']}"
)
icat_manga_viewer(chapter_info["thumbnails"], str(chapter_info["title"]))
if config.manga_viewer == "feh":
feh_manga_viewer(chapter_info["thumbnails"], str(chapter_info["title"]))
elif config.manga_viewer == "icat":
icat_manga_viewer(
chapter_info["thumbnails"], str(chapter_info["title"])
)
if anilist_helper:
anilist_helper.update_anime_list(
{"mediaId": anilist_id, "progress": chapter_number}

View File

@@ -42,6 +42,7 @@ class Config(object):
default_config = {
"auto_next": "False",
"menu_order": "",
"manga_viewer": "feh",
"auto_select": "True",
"cache_requests": "true",
"check_for_updates": "True",
@@ -187,6 +188,7 @@ class Config(object):
self.skip = self.configparser.getboolean("stream", "skip")
self.sort_by = self.configparser.get("anilist", "sort_by")
self.menu_order = self.configparser.get("general", "menu_order")
self.manga_viewer = self.configparser.get("general", "manga_viewer")
self.sub_lang = self.configparser.get("general", "sub_lang")
self.translation_type = self.configparser.get("stream", "translation_type")
self.use_fzf = self.configparser.getboolean("general", "use_fzf")
@@ -476,6 +478,11 @@ mpv_args = {self.mpv_args}
# useful incase of wanting to run sth like: kitty mpv --vo=kitty <url>
mpv_pre_args = {self.mpv_pre_args}
# choose manga viewer [feh/icat]
# feh is the default and requires feh to be installed
# icat is for kitty terminal users only
manga_viewer = {self.manga_viewer}
[stream]
# the quality of the stream [1080,720,480,360]
# this option is usually only reliable when: