Merge pull request #698 from song-zhou/main

修复通知emby时libraryId错误bug
This commit is contained in:
jxxghp 2023-09-28 22:09:32 +08:00 committed by GitHub
commit 83500128c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -488,14 +488,14 @@ class Emby(metaclass=Singleton):
# 匹配子目录
subfolder_path = Path(subfolder.get("Path"))
if item_path.is_relative_to(subfolder_path):
return subfolder.get("Id")
return folder.get("Id")
except Exception as err:
print(str(err))
# 如果找不到,只要路径中有分类目录名就命中
for subfolder in folder.get("SubFolders"):
if subfolder.get("Path") and re.search(r"[/\\]%s" % item.category,
subfolder.get("Path")):
return folder.get("Id")
# 如果找不到,只要路径中有分类目录名就命中
for subfolder in folder.get("SubFolders"):
if subfolder.get("Path") and re.search(r"[/\\]%s" % item.category,
subfolder.get("Path")):
return folder.get("Id")
# 刷新根目录
return "/"