feat 媒体库刷新移植为插件
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
from pathlib import Path
|
||||
from typing import Optional, Tuple, Union, Any, List, Generator
|
||||
|
||||
from app import schemas
|
||||
@ -88,24 +87,6 @@ class PlexModule(_ModuleBase):
|
||||
itemid=item_id
|
||||
)
|
||||
|
||||
def refresh_mediaserver(self, mediainfo: MediaInfo, file_path: Path) -> None:
|
||||
"""
|
||||
刷新媒体库
|
||||
:param mediainfo: 识别的媒体信息
|
||||
:param file_path: 文件路径
|
||||
:return: 成功或失败
|
||||
"""
|
||||
items = [
|
||||
schemas.RefreshMediaItem(
|
||||
title=mediainfo.title,
|
||||
year=mediainfo.year,
|
||||
type=mediainfo.type,
|
||||
category=mediainfo.category,
|
||||
target_path=file_path
|
||||
)
|
||||
]
|
||||
self.plex.refresh_library_by_items(items)
|
||||
|
||||
def media_statistic(self) -> List[schemas.Statistic]:
|
||||
"""
|
||||
媒体数量统计
|
||||
|
Reference in New Issue
Block a user