Merge pull request #23 from thsrite/main

fix jellyfin日志url
This commit is contained in:
jxxghp 2023-08-03 18:34:02 +08:00 committed by GitHub
commit acac42a7fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 7 deletions

View File

@ -58,6 +58,8 @@ docker pull jxxghp/moviepilot:latest
- **DOWNLOAD_CATEGORY** 下载二级分类开关,`true`/`false`,默认`false`,开启后会根据配置`category.yaml`自动在下载目录下建立二级目录分类 - **DOWNLOAD_CATEGORY** 下载二级分类开关,`true`/`false`,默认`false`,开启后会根据配置`category.yaml`自动在下载目录下建立二级目录分类
- **TORRENT_TAG** 种子标签,默认为`MOVIEPILOT`设置后只有MoviePilot添加的下载才会处理留空所有下载器中的任务均会处理 - **TORRENT_TAG** 种子标签,默认为`MOVIEPILOT`设置后只有MoviePilot添加的下载才会处理留空所有下载器中的任务均会处理
- **LIBRARY_PATH** 媒体库目录,多个目录使用`,`分隔 - **LIBRARY_PATH** 媒体库目录,多个目录使用`,`分隔
- **LIBRARY_MOVIE_NAME** 电影媒体库目录名,默认`电影`
- **LIBRARY_TV_NAME** 电视剧媒体库目录名,默认`电影剧`
- **LIBRARY_CATEGORY** 媒体库二级分类开关,`true`/`false`,默认`false`,开启后会根据配置`category.yaml`自动在媒体库目录下建立二级目录分类 - **LIBRARY_CATEGORY** 媒体库二级分类开关,`true`/`false`,默认`false`,开启后会根据配置`category.yaml`自动在媒体库目录下建立二级目录分类
- **TRANSFER_TYPE** 转移方式,支持`link`/`copy`/`move`/`softlink` - **TRANSFER_TYPE** 转移方式,支持`link`/`copy`/`move`/`softlink`
- **COOKIECLOUD_HOST** CookieCloud服务器地址格式`http://ip:port`,必须配置,否则无法添加站点 - **COOKIECLOUD_HOST** CookieCloud服务器地址格式`http://ip:port`,必须配置,否则无法添加站点

View File

@ -145,6 +145,10 @@ class Settings(BaseSettings):
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.57" USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.57"
# 媒体库目录 # 媒体库目录
LIBRARY_PATH: str = None LIBRARY_PATH: str = None
# 电影媒体库目录名,默认"电影"
LIBRARY_MOVIE_NAME: str = None
# 电视剧媒体库目录名,默认"电视剧"
LIBRARY_TV_NAME: str = None
# 二级分类 # 二级分类
LIBRARY_CATEGORY: bool = True LIBRARY_CATEGORY: bool = True
# 电影重命名格式 # 电影重命名格式

View File

@ -351,8 +351,19 @@ class FileTransferModule(_ModuleBase):
if not target_dir.exists(): if not target_dir.exists():
return f"{target_dir} 目标路径不存在" return f"{target_dir} 目标路径不存在"
# 目的目录加上类型和二级分类 if mediainfo.type == MediaType.MOVIE:
target_dir = target_dir / mediainfo.type.value / mediainfo.category if settings.LIBRARY_MOVIE_NAME:
target_dir = target_dir / settings.LIBRARY_MOVIE_NAME / mediainfo.category
else:
# 目的目录加上类型和二级分类
target_dir = target_dir / mediainfo.type.value / mediainfo.category
if mediainfo.type == MediaType.TV:
if settings.LIBRARY_TV_NAME:
target_dir = target_dir / settings.LIBRARY_TV_NAME / mediainfo.category
else:
# 目的目录加上类型和二级分类
target_dir = target_dir / mediainfo.type.value / mediainfo.category
# 重命名格式 # 重命名格式
rename_format = settings.TV_RENAME_FORMAT \ rename_format = settings.TV_RENAME_FORMAT \

View File

@ -1,7 +1,6 @@
from typing import List, Tuple, Dict, Any from typing import List, Tuple, Dict, Any
from python_hosts import Hosts, HostsEntry from python_hosts import Hosts, HostsEntry
from app.log import logger from app.log import logger
from app.plugins import _PluginBase from app.plugins import _PluginBase
from app.utils.ip import IpUtils from app.utils.ip import IpUtils
@ -57,7 +56,7 @@ class CustomHosts(_PluginBase):
self.update_config({ self.update_config({
"hosts": self._hosts, "hosts": self._hosts,
"err_hosts": error_hosts, "err_hosts": error_hosts,
"enable": self._enabled "enabled": self._enabled
}) })
def get_state(self) -> bool: def get_state(self) -> bool:
@ -71,6 +70,9 @@ class CustomHosts(_PluginBase):
pass pass
def get_form(self) -> Tuple[List[dict], Dict[str, Any]]: def get_form(self) -> Tuple[List[dict], Dict[str, Any]]:
"""
拼装插件配置页面需要返回两块数据1页面配置2数据结构
"""
return [ return [
{ {
'component': 'VForm', 'component': 'VForm',
@ -109,7 +111,9 @@ class CustomHosts(_PluginBase):
'component': 'VTextarea', 'component': 'VTextarea',
'props': { 'props': {
'model': 'hosts', 'model': 'hosts',
'label': '系统hosts' 'label': '自定义hosts',
'rows': 10,
'placeholder': '每行一个配置格式为ip host1 host2 ...'
} }
} }
] ]
@ -130,7 +134,9 @@ class CustomHosts(_PluginBase):
'props': { 'props': {
'model': 'err_hosts', 'model': 'err_hosts',
'readonly': True, 'readonly': True,
'label': '错误记录' 'label': '错误hosts',
'rows': 2,
'placeholder': '错误的hosts配置会展示在此处请修改上方hosts重新提交错误的hosts不会写入系统hosts文件'
} }
} }
] ]

View File

@ -562,7 +562,8 @@ class MediaSyncDel(_PluginBase):
jellyfin_host = "http://" + jellyfin_host jellyfin_host = "http://" + jellyfin_host
# jellyfin 日志url # jellyfin 日志url
log_url = "%sSystem/Logs/jellyfinserver.txt?api_key=%s" % (jellyfin_host, settings.JELLYFIN_API_KEY) log_url = "%sSystem/Logs/Log?name=log_%s.log&api_key=%s" % (
jellyfin_host, datetime.date.today().strftime("%Y%m%d"), settings.JELLYFIN_API_KEY)
log_res = RequestUtils().get_res(url=log_url) log_res = RequestUtils().get_res(url=log_url)
if not log_res or log_res.status_code != 200: if not log_res or log_res.status_code != 200: