如果旧.nfo包含评分及投票,新的元数据中不包含,则搬运旧分数和投票
This commit is contained in:
17
core.py
17
core.py
@@ -382,7 +382,22 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f
|
||||
</rating>
|
||||
</ratings>""", file=code)
|
||||
except:
|
||||
pass
|
||||
if old_nfo:
|
||||
try:
|
||||
for rtag in ('rating', 'criticrating'):
|
||||
xur = old_nfo.xpath(f'//{rtag}/text()')[0]
|
||||
if isinstance(xur, str) and re.match('\d+\.\d+|\d+', xur.strip()):
|
||||
print(f" <{rtag}>{xur.strip()}</{rtag}>", file=code)
|
||||
f_rating = old_nfo.xpath(f"//ratings/rating[@name='javdb']/value/text()")[0]
|
||||
uc = old_nfo.xpath(f"//ratings/rating[@name='javdb']/votes/text()")[0]
|
||||
print(f""" <ratings>
|
||||
<rating name="javdb" max="5" default="true">
|
||||
<value>{f_rating}</value>
|
||||
<votes>{uc}</votes>
|
||||
</rating>
|
||||
</ratings>""", file=code)
|
||||
except:
|
||||
pass
|
||||
print(" <cover>" + cover + "</cover>", file=code)
|
||||
if config.getInstance().is_trailer():
|
||||
print(" <trailer>" + trailer + "</trailer>", file=code)
|
||||
|
||||
Reference in New Issue
Block a user