Merge pull request #740 from lededev/minfix

Minfix
This commit is contained in:
Yoshiko2
2022-03-27 19:15:51 +08:00
committed by GitHub
6 changed files with 15 additions and 10 deletions

View File

@@ -4,7 +4,7 @@ import config
import importlib
from PIL import Image
import shutil
from ADC_function import file_not_exist_or_empty
def face_crop_width(filename, width, height):
# 新宽度是高度的2/3
@@ -57,6 +57,8 @@ def face_crop_height(filename, width, height):
def cutImage(imagecut, path, fanart_path, poster_path):
fullpath_fanart = os.path.join(path, fanart_path)
fullpath_poster = os.path.join(path, poster_path)
if config.getInstance().download_only_missing_images() and not file_not_exist_or_empty(fullpath_poster):
return
if imagecut == 1: # 剪裁大封面
try:
img = Image.open(fullpath_fanart)
@@ -92,4 +94,3 @@ def face_center(filename, model):
if __name__ == '__main__':
cutImage(1,'H:\\test\\','12.jpg','test.jpg')

View File

@@ -514,8 +514,8 @@ def main():
print(f"[+]Load Config file '{conf.ini_path}'.")
if conf.debug():
print('[+]Enable debug')
if conf.link_mode():
print('[!]Enable soft link')
if conf.link_mode() in (1, 2):
print('[!]Enable {} link'.format(('soft', 'hard')[conf.link_mode() - 1]))
if len(sys.argv) > 1:
print('[!]CmdLine:', " ".join(sys.argv[1:]))
print('[+]Main Working mode ## {}: {} ## {}{}{}'

View File

@@ -114,7 +114,7 @@ mode=1
vars=outline,series,studio,tag,title
[javdb]
sites=33,34
sites=37,38
; 人脸识别 hog:方向梯度直方图(不太准确,速度快) cnn:深度学习模型(准确需要GPU/CUDA,速度慢)
[face]

View File

@@ -129,7 +129,7 @@ class Config:
def actor_gender(self) -> str:
return self.conf.get("common", "actor_gender")
def link_mode(self) -> bool:
def link_mode(self) -> int:
return self.getint_override("common", "link_mode")
def scan_hardlink(self) -> bool:

10
core.py
View File

@@ -354,8 +354,13 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f
print(" <premiered>" + release + "</premiered>", file=code)
print(" <releasedate>" + release + "</releasedate>", file=code)
print(" <release>" + release + "</release>", file=code)
if 'userrating' in json_data:
print(" <userrating>" + json_data['userrating'] + "</userrating>", file=code)
try:
f_rating = float(json_data['userrating'])
print(f" <userrating>{round(f_rating * 2.0)}</userrating>", file=code)
print(f" <rating>{round(f_rating * 2.0, 1)}</rating>", file=code)
print(f" <criticrating>{round(f_rating * 20.0, 1)}</criticrating>", file=code)
except:
pass
print(" <cover>" + cover + "</cover>", file=code)
if config.getInstance().is_trailer():
print(" <trailer>" + trailer + "</trailer>", file=code)
@@ -692,7 +697,6 @@ def core_main(file_path, number_th, oCC):
pass
# 裁剪图
cutImage(imagecut, path , fanart_path, poster_path)

View File

@@ -2,7 +2,7 @@
main_mode=1
failed_output_folder=data/failure_output
success_output_folder=data/organized
soft_link=0
link_mode=0
[proxy]
proxy=