Skip to content

Commit

Permalink
210905-2 avop特征逻辑纠正 特征对照表增加
Browse files Browse the repository at this point in the history
  • Loading branch information
JustMachiavelli committed Sep 5, 2021
1 parent 07018d5 commit abc0ca9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
14 changes: 10 additions & 4 deletions src/Class/MyHandler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding:utf-8 -*-
import os
import re
import time
from os import sep # 系统路径分隔符
from configparser import RawConfigParser # 读取ini
from configparser import NoOptionError # ini文件不存在或不存在指定node的错误
Expand Down Expand Up @@ -477,6 +478,7 @@ def prefect_jav_model(self, jav_model):
jav_model.Title = jav_model.Title[:-len(str_actors)].strip()
# 翻译出中文标题和简介
jav_model.TitleZh = translate(self.tran_id, self.tran_sk, jav_model.Title, self.to_language)
time.sleep(0.9)
jav_model.PlotZh = translate(self.tran_id, self.tran_sk, jav_model.Plot, self.to_language)

# 功能: 用jav_file、jav_model中的原始数据完善dict_for_standard
Expand Down Expand Up @@ -810,10 +812,14 @@ def download_fanart(self, jav_file, jav_model):
path_poster = path_poster.replace(jav_file.Cd, '')
# emby需要多份,现在不是第一集,直接复制第一集的图片
elif jav_file.Episode != 1:
copyfile(path_fanart.replace(jav_file.Cd, '-cd1'), path_fanart)
print(' >fanart.jpg复制成功')
copyfile(path_poster.replace(jav_file.Cd, '-cd1'), path_poster)
print(' >poster.jpg复制成功')
# 如果用户不重名视频,并且用户的原视频是第二集,没有带cd2,例如abc-123.mkv和abc-123.mp4,
# 会导致fanart路径和cd1相同,引发报错raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
# 所以这里判断下path_fanart有没有
if not os.path.exists(path_fanart):
copyfile(path_fanart.replace(jav_file.Cd, '-cd1'), path_fanart)
print(' >fanart.jpg复制成功')
copyfile(path_poster.replace(jav_file.Cd, '-cd1'), path_poster)
print(' >poster.jpg复制成功')
# kodi或者emby需要的第一份图片
if check_picture(path_fanart):
# 这里有个遗留问题,如果已有的图片文件名是小写,比如abc-123 xx.jpg,现在path_fanart是大写ABC-123,无法改变,poster同理
Expand Down
9 changes: 6 additions & 3 deletions src/Youma.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@
elif status == ScrapeStatusEnum.library_multiple_search_results:
logger.record_warn(f'javlibrary搜索到同车牌的不同视频: {jav_file.Car},')
# 优化genres_library
genres_library = [dict_library_genres[i] for i in genres_library if dict_library_genres[i] != '删除']
genres_library = [dict_library_genres[i] for i in genres_library
if not i.startswith('AV OP')
and not i.startswith('AVOP')
and dict_library_genres[i] != '删除']
# endregion

if not jav_model.Javdb and not jav_model.Javlibrary:
Expand All @@ -135,8 +138,8 @@
# 优化genres_bus
genres_bus = [dict_bus_genres[i] for i in genres_bus
if not i.startswith('AV OP')
or not i.startswith('AVOP')
or dict_bus_genres[i] != '删除']
and not i.startswith('AVOP')
and dict_bus_genres[i] != '删除']
# endregion

# region(3.2.2.5)arzon找简介
Expand Down
Binary file modified src/【特征对照表】.xlsx
Binary file not shown.

0 comments on commit abc0ca9

Please sign in to comment.