fix transfer message

This commit is contained in:
jxxghp
2023-06-11 11:47:03 +08:00
parent 81abd0ee49
commit 69c660df43
5 changed files with 18 additions and 25 deletions

View File

@ -41,6 +41,7 @@ RUN apt-get update \
&& echo "${WORKDIR}/" > /usr/local/lib/python${python_ver%.*}/site-packages/app.pth \
&& echo 'fs.inotify.max_user_watches=5242880' >> /etc/sysctl.conf \
&& echo 'fs.inotify.max_user_instances=5242880' >> /etc/sysctl.conf \
&& playwright install-deps chromium \
&& rm -rf /root/.cache/
EXPOSE 3001
VOLUME ["/config"]

View File

@ -79,29 +79,15 @@ class TransferChain(ChainBase):
transferinfo.get('target_path')
)
)
if mediainfo.type == MediaType.TV:
# 电影
msg_title = f"{mediainfo.get_title_string()} {meta.get_season_episode_string()} 已入库"
if mediainfo.vote_average:
msg_str = f"评分:{mediainfo.vote_average},类型:{mediainfo.type.value}"
else:
msg_str = f"类型:{mediainfo.type.value}"
if mediainfo.category:
msg_str = f"{msg_str},类别:{mediainfo.category}"
if meta.total_seasons <= 1 and meta.total_episodes == 1:
msg_str = f"{msg_str},大小:{file_size}"
else:
msg_str = f"{msg_str},共{meta.total_seasons}{meta.total_episodes}集,总大小:{file_size}"
msg_title = f"{mediainfo.get_title_string()} 已入库"
if mediainfo.vote_average:
msg_str = f"评分:{mediainfo.vote_average},类型:{mediainfo.type.value}"
else:
msg_title = f"{mediainfo.get_title_string()} 已入库"
if mediainfo.vote_average:
msg_str = f"评分{mediainfo.vote_average},类型:电影"
else:
msg_str = "类型:电影"
if mediainfo.category:
msg_str = f"{msg_str},类别:{mediainfo.category}"
if meta.get_resource_type_string():
msg_str = f"{msg_str},质量:{meta.get_resource_type_string()}"
msg_str = f"{msg_str} 大小:{file_size}"
msg_str = f"类型:{mediainfo.type.value}"
if mediainfo.category:
msg_str = f"{msg_str},类别{mediainfo.category}"
if meta.get_resource_type_string():
msg_str = f"{msg_str},质量:{meta.get_resource_type_string()}"
msg_str = f"{msg_str} 大小:{file_size}"
# 发送
self.post_message(title=msg_title, text=msg_str, image=mediainfo.get_message_image())

View File

@ -75,7 +75,7 @@ class Telegram(metaclass=Singleton):
try:
if text:
caption = f"*{title}*\n\n{text}"
caption = f"*{title}*\n{text}"
else:
caption = title

View File

@ -203,6 +203,8 @@ class TheMovieDb(_ModuleBase):
for attr_name, attr_value in vars(mediainfo).items():
if attr_value \
and attr_name.endswith("_path") \
and attr_value \
and isinstance(attr_value, str) \
and attr_value.startswith("http"):
image_name = attr_name.replace("_path", "") + Path(attr_value).suffix
self.__save_image(url=attr_value,
@ -221,6 +223,8 @@ class TheMovieDb(_ModuleBase):
if attr_value \
and attr_name.endswith("_path") \
and not attr_name.startswith("season") \
and attr_value \
and isinstance(attr_value, str) \
and attr_value.startswith("http"):
image_name = attr_name.replace("_path", "") + Path(attr_value).suffix
self.__save_image(url=attr_value,
@ -237,6 +241,8 @@ class TheMovieDb(_ModuleBase):
for attr_name, attr_value in vars(mediainfo).items():
if attr_value \
and attr_name.startswith("season") \
and attr_value \
and isinstance(attr_value, str) \
and attr_value.startswith("http"):
image_name = attr_name.replace("_path",
"").replace("season",

View File

@ -1,5 +1,5 @@
#!/bin/sh
umask ${UMASK}
playwright install --with-deps chromium
playwright install chromium
python3 app/main.py