更新 core.py

1.处理元数据时无码的会加上 '无码' 标签(tag)及 风格类型(genre)
2.处理元数据时流出的会加上 '流出' 风格类型(genre)
3.处理元数据时加上 '系列'(series) 风格类型(genre)
4.将标签(tag)及 风格类型(genre)顺序对应
This commit is contained in:
SharpX2016
2021-04-27 13:29:17 +08:00
parent ca198ff8be
commit 07af676bd6

15
core.py
View File

@@ -435,7 +435,7 @@ def image_download(cover, number, leak_word, c_word, path, conf: config.Config,
shutil.copyfile(path + '/' + number + leak_word + c_word + '-fanart.jpg',path + '/' + number + leak_word + c_word + '-thumb.jpg')
def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, filepath, failed_folder, tag, actor_list, liuchu):
def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, filepath, failed_folder, tag, actor_list, liuchu, uncensored):
title, studio, year, outline, runtime, director, actor_photo, release, number, cover, trailer, website, series, label = get_info(json_data)
try:
@@ -469,19 +469,26 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f
print(" <tag>中文字幕</tag>", file=code)
if liuchu == '流出':
print(" <tag>流出</tag>", file=code)
if uncensored == 1:
print(" <tag>无码</tag>", file=code)
try:
for i in tag:
print(" <tag>" + i + "</tag>", file=code)
print(" <tag>" + series + "</tag>", file=code)
except:
aaaaa = ''
if cn_sub == '1':
print(" <genre>中文字幕</genre>", file=code)
if liuchu == '流出':
print(" <genre>流出</genre>", file=code)
if uncensored == 1:
print(" <genre>无码</genre>", file=code)
try:
for i in tag:
print(" <genre>" + i + "</genre>", file=code)
print(" <genre>" + series + "</genre>", file=code)
except:
aaaaaaaa = ''
if cn_sub == '1':
print(" <genre>中文字幕</genre>", file=code)
print(" <num>" + number + "</num>", file=code)
print(" <premiered>" + release + "</premiered>", file=code)
print(" <cover>" + cover + "</cover>", file=code)
@@ -764,7 +771,7 @@ def core_main(file_path, number_th, conf: config.Config):
cutImage(imagecut, path, number, leak_word, c_word)
# 打印文件
print_files(path, leak_word, c_word, json_data.get('naming_rule'), part, cn_sub, json_data, filepath, conf.failed_folder(), tag, json_data.get('actor_list'), liuchu)
print_files(path, leak_word, c_word, json_data.get('naming_rule'), part, cn_sub, json_data, filepath, conf.failed_folder(), tag, json_data.get('actor_list'), liuchu, uncensored)
# 移动文件
paste_file_to_folder(filepath, path, number, leak_word, c_word, conf)