fix 文件多层路径识别
This commit is contained in:
@ -1022,4 +1022,19 @@ meta_cases = [{
|
||||
"video_codec": "H265",
|
||||
"audio_codec": "DDP 2.0"
|
||||
}
|
||||
}, {
|
||||
"path": "/volume1/电视剧/西部世界 第二季 (2016)/5.mkv",
|
||||
"target": {
|
||||
"type": "电视剧",
|
||||
"cn_name": "西部世界",
|
||||
"en_name": "",
|
||||
"year": "2016",
|
||||
"part": "",
|
||||
"season": "S02",
|
||||
"episode": "E05",
|
||||
"restype": "",
|
||||
"pix": "",
|
||||
"video_codec": "",
|
||||
"audio_codec": ""
|
||||
}
|
||||
}]
|
||||
|
@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from pathlib import Path
|
||||
from unittest import TestCase
|
||||
|
||||
from app.core.metainfo import MetaInfo
|
||||
from app.core.metainfo import MetaInfo, MetaInfoPath
|
||||
from tests.cases.meta import meta_cases
|
||||
|
||||
|
||||
@ -15,9 +15,10 @@ class MetaInfoTest(TestCase):
|
||||
|
||||
def test_metainfo(self):
|
||||
for info in meta_cases:
|
||||
if not info.get("title"):
|
||||
continue
|
||||
meta_info = MetaInfo(title=info.get("title"), subtitle=info.get("subtitle"))
|
||||
if info.get("path"):
|
||||
meta_info = MetaInfoPath(path=Path(info.get("path")))
|
||||
else:
|
||||
meta_info = MetaInfo(title=info.get("title"), subtitle=info.get("subtitle"))
|
||||
target = {
|
||||
"type": meta_info.type.value,
|
||||
"cn_name": meta_info.cn_name or "",
|
||||
|
Reference in New Issue
Block a user