Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 2 additions & 19 deletions plugins/comicInfoExtractor/comicInfoExtractor.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import stashapi.log as log
from stashapi.stashapp import StashInterface
import stashapi.marker_parse as mp
import yaml
import json
import os
import sys
import xml.etree.ElementTree as ET
import zipfile
from config import ImportList as CONFIG_IMPORT_LIST

per_page = 100

Expand Down Expand Up @@ -122,23 +121,7 @@ def processAll():
FRAGMENT_SERVER = json_input["server_connection"]
stash = StashInterface(FRAGMENT_SERVER)

# Load Config
with open(
os.path.join(os.path.dirname(os.path.abspath(__file__)), "config.yml"), "r"
) as f:
try:
config = yaml.safe_load(f)
except yaml.YAMLError as exc:
log.error("Could not load config.yml: " + str(exc))
sys.exit(1)
try:
ImportList = config["ImportList"]
except KeyError as key:
log.error(
str(key)
+ " is not defined in config.yml, but is needed for this script to proceed"
)
sys.exit(1)
ImportList = CONFIG_IMPORT_LIST.copy()

if "mode" in json_input["args"]:
PLUGIN_ARGS = json_input["args"]["mode"]
Expand Down
2 changes: 1 addition & 1 deletion plugins/comicInfoExtractor/comicInfoExtractor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Comic Info Extractor
description: Extract the metadata from cbz with the Comicrack standard (ComicInfo.xml)
version: 0.1
version: 0.2
url: https://discourse.stashapp.cc/t/comic-info-extractor/1372
exec:
- python
Expand Down
11 changes: 11 additions & 0 deletions plugins/comicInfoExtractor/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ImportList maps ComicInfo.xml fields to Stash gallery fields.
# Fields that refer to different types of media are resolved by name and created if necessary.
# Fields that can contain multiple values are expected to be comma-separated strings.

ImportList = {
"Genre": "tags",
"Title": "title",
"Writer": "studio",
"Year": "date",
"Summary": "details",
}
12 changes: 0 additions & 12 deletions plugins/comicInfoExtractor/config.yml

This file was deleted.

Loading