From 85ecff451c290b7749331618fc8fe88a7d996153 Mon Sep 17 00:00:00 2001 From: lededev Date: Sun, 27 Mar 2022 17:06:46 +0800 Subject: [PATCH 1/6] download_only_missing_images=1 do not cut exist image again --- ImageProcessing/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ImageProcessing/__init__.py b/ImageProcessing/__init__.py index f545e91..9fafc6e 100644 --- a/ImageProcessing/__init__.py +++ b/ImageProcessing/__init__.py @@ -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') - \ No newline at end of file From 12e8c88a07f7a6fb19f731896973658095ff0f1f Mon Sep 17 00:00:00 2001 From: lededev Date: Sun, 27 Mar 2022 17:07:37 +0800 Subject: [PATCH 2/6] javdb site 37,38 --- config.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.ini b/config.ini index 6195652..f0e4456 100755 --- a/config.ini +++ b/config.ini @@ -114,7 +114,7 @@ mode=1 vars=outline,series,studio,tag,title [javdb] -sites=33,34 +sites=37,38 ; 人脸识别 hog:方向梯度直方图(不太准确,速度快) cnn:深度学习模型(准确,需要GPU/CUDA,速度慢) [face] From 5af806017699dd20b33c096a649181dea9261d2a Mon Sep 17 00:00:00 2001 From: lededev Date: Sun, 27 Mar 2022 17:08:11 +0800 Subject: [PATCH 3/6] link_mode small fix --- Movie_Data_Capture.py | 4 ++-- config.py | 2 +- docker/config.ini | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Movie_Data_Capture.py b/Movie_Data_Capture.py index 2298bd0..b8bf9dd 100644 --- a/Movie_Data_Capture.py +++ b/Movie_Data_Capture.py @@ -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 ## {}: {} ## {}{}{}' diff --git a/config.py b/config.py index 637989a..63a12a8 100644 --- a/config.py +++ b/config.py @@ -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: diff --git a/docker/config.ini b/docker/config.ini index b14e195..83840cc 100644 --- a/docker/config.ini +++ b/docker/config.ini @@ -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= From 3c78069f88da1208b6245e1671f4a49033ebf4a9 Mon Sep 17 00:00:00 2001 From: lededev Date: Sun, 27 Mar 2022 17:38:53 +0800 Subject: [PATCH 4/6] User Rating for KODI Emby Jellyfin --- core.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core.py b/core.py index 7a6bfea..d3679f1 100644 --- a/core.py +++ b/core.py @@ -355,7 +355,15 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f print(" " + release + "", file=code) print(" " + release + "", file=code) if 'userrating' in json_data: - print(" " + json_data['userrating'] + "", file=code) + try: + strrating = json_data['userrating'] + userrating = round(float(strrating) * 2.0) + print(f" {userrating}", file=code) + print(f" {userrating}", file=code) + rating_score = round(float(strrating) * 20.0, 1) + print(f" {rating_score:.1f}", file=code) + except: + pass print(" " + cover + "", file=code) if config.getInstance().is_trailer(): print(" " + trailer + "", file=code) @@ -692,7 +700,6 @@ def core_main(file_path, number_th, oCC): pass - # 裁剪图 cutImage(imagecut, path , fanart_path, poster_path) From 063d58edc311594e888db688909a35d08464f617 Mon Sep 17 00:00:00 2001 From: lededev Date: Sun, 27 Mar 2022 18:57:11 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=84=E5=88=86?= =?UTF-8?q?=E7=B2=BE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/core.py b/core.py index d3679f1..f7cb5ba 100644 --- a/core.py +++ b/core.py @@ -354,16 +354,16 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f print(" " + release + "", file=code) print(" " + release + "", file=code) print(" " + release + "", file=code) - if 'userrating' in json_data: - try: - strrating = json_data['userrating'] - userrating = round(float(strrating) * 2.0) - print(f" {userrating}", file=code) - print(f" {userrating}", file=code) - rating_score = round(float(strrating) * 20.0, 1) - print(f" {rating_score:.1f}", file=code) - except: - pass + try: + strrating = json_data['userrating'] + userrating = round(float(strrating) * 2.0) + print(f" {userrating}", file=code) + rating = round(float(strrating) * 2.0, 1) + print(f" {rating}", file=code) + rating_score = round(float(strrating) * 20.0, 1) + print(f" {rating_score}", file=code) + except: + pass print(" " + cover + "", file=code) if config.getInstance().is_trailer(): print(" " + trailer + "", file=code) From 375c6822f1f53504bcbabe2edd1850f27cfcfd29 Mon Sep 17 00:00:00 2001 From: lededev Date: Sun, 27 Mar 2022 19:04:59 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E7=AE=80=E5=8C=96=E8=AF=84=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core.py b/core.py index f7cb5ba..befa3d5 100644 --- a/core.py +++ b/core.py @@ -355,13 +355,10 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f print(" " + release + "", file=code) print(" " + release + "", file=code) try: - strrating = json_data['userrating'] - userrating = round(float(strrating) * 2.0) - print(f" {userrating}", file=code) - rating = round(float(strrating) * 2.0, 1) - print(f" {rating}", file=code) - rating_score = round(float(strrating) * 20.0, 1) - print(f" {rating_score}", file=code) + f_rating = float(json_data['userrating']) + print(f" {round(f_rating * 2.0)}", file=code) + print(f" {round(f_rating * 2.0, 1)}", file=code) + print(f" {round(f_rating * 20.0, 1)}", file=code) except: pass print(" " + cover + "", file=code)