From 18262f98f7025a0c7dca7fcccf3a3010fce29ec8 Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 25 Oct 2023 10:52:33 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix=20=E5=90=8C=E6=AD=A5=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/mediasyncdel/__init__.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/app/plugins/mediasyncdel/__init__.py b/app/plugins/mediasyncdel/__init__.py index 87452194..4039b9a4 100644 --- a/app/plugins/mediasyncdel/__init__.py +++ b/app/plugins/mediasyncdel/__init__.py @@ -20,7 +20,7 @@ from app.modules.qbittorrent import Qbittorrent from app.modules.themoviedb.tmdbv3api import Episode from app.modules.transmission import Transmission from app.plugins import _PluginBase -from app.schemas.types import NotificationType, EventType, MediaType +from app.schemas.types import NotificationType, EventType, MediaType, MediaImageType class MediaSyncDel(_PluginBase): @@ -565,7 +565,7 @@ class MediaSyncDel(_PluginBase): return # 开始删除 - image = 'https://emby.media/notificationicon.png' + image = None year = None del_torrent_hashs = [] stop_torrent_hashs = [] @@ -576,7 +576,7 @@ class MediaSyncDel(_PluginBase): logger.warn( f"当前转移记录 {transferhis.id} {title} {transferhis.tmdbid} 与删除媒体{media_name}不符,防误删,暂不自动删除") continue - image = transferhis.image + image = transferhis.image or image year = transferhis.year # 0、删除转移记录 @@ -615,6 +615,20 @@ class MediaSyncDel(_PluginBase): if images: image = self.get_tmdbimage_url(images[-1].get("file_path"), prefix="original") + if not image: + specific_image = self.chain.obtain_specific_image( + mediaid=tmdb_id, + mtype=MediaType.MOVIE if media_type in ["Movie", "MOV"] else MediaType.TV, + image_type=MediaImageType.Backdrop, + season=season_num, + episode=episode_num + ) + if specific_image: + image = specific_image + + if not image: + image = 'https://emby.media/notificationicon.png' + torrent_cnt_msg = "" if del_torrent_hashs: torrent_cnt_msg += f"删除种子{len(set(del_torrent_hashs))}个\n" @@ -838,7 +852,7 @@ class MediaSyncDel(_PluginBase): f"当前转移记录 {transferhis.id} {title} {transferhis.tmdbid} 与删除媒体{media_name}不符,防误删,暂不自动删除") self.save_data("last_time", last_del_time or datetime.datetime.now()) continue - image = transferhis.image + image = transferhis.image or image # 0、删除转移记录 self._transferhis.delete(transferhis.id) From 882fe6cd00f771f9b22f4928d2558eeb4713ffd0 Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 25 Oct 2023 16:33:09 +0800 Subject: [PATCH 2/8] =?UTF-8?q?fix=20=E5=85=B3=E4=BA=8E=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E6=8F=8F=E8=BF=B0=E2=80=A6=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/mediasyncdel/__init__.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/app/plugins/mediasyncdel/__init__.py b/app/plugins/mediasyncdel/__init__.py index 4039b9a4..2be15763 100644 --- a/app/plugins/mediasyncdel/__init__.py +++ b/app/plugins/mediasyncdel/__init__.py @@ -276,6 +276,28 @@ class MediaSyncDel(_PluginBase): ] } ] + }, + { + 'component': 'VRow', + 'content': [ + { + 'component': 'VCol', + 'props': { + 'cols': 12, + }, + 'content': [ + { + 'component': 'VAlert', + 'props': { + 'text': '关于路径映射:' + 'emby:/data/series/A.mp4,' + 'moviepilot:/mnt/link/series/A.mp4。' + '路径映射填/data:/mnt/link' + } + } + ] + } + ] } ] } @@ -561,7 +583,7 @@ class MediaSyncDel(_PluginBase): logger.info(f"正在同步删除{msg}") if not transfer_history: - logger.warn(f"{media_type} {media_name} 未获取到可删除数据,可使用媒体库刮削插件覆盖所有元数据") + logger.warn(f"{media_type} {media_name} 未获取到可删除数据,请检查路径映射是否配置错误,请检查tmdbid获取是否正确") return # 开始删除 From 8f8f3af7cd1b04e0a8e1f03a3bbd483f2cd80c78 Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 25 Oct 2023 16:37:02 +0800 Subject: [PATCH 3/8] =?UTF-8?q?fix=20=E8=8D=AF=E4=B8=B8=E7=AD=BE=E5=88=B0?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/invitessignin/__init__.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/plugins/invitessignin/__init__.py b/app/plugins/invitessignin/__init__.py index 3512d79b..3569e0e0 100644 --- a/app/plugins/invitessignin/__init__.py +++ b/app/plugins/invitessignin/__init__.py @@ -264,7 +264,26 @@ class InvitesSignin(_PluginBase): ] } ] - } + }, + { + 'component': 'VRow', + 'content': [ + { + 'component': 'VCol', + 'props': { + 'cols': 12, + }, + 'content': [ + { + 'component': 'VAlert', + 'props': { + 'text': '整点定时签到失败?不妨换个时间试试' + } + } + ] + } + ] + } ] } ], { From 124817b733b9aa8371f9bc72339ebe5b6659ed9d Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 25 Oct 2023 16:52:19 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix=20=E8=87=AA=E5=AE=9A=E4=B9=89hosts?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=8F=8F=E8=BF=B0=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/customhosts/__init__.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/app/plugins/customhosts/__init__.py b/app/plugins/customhosts/__init__.py index 2a2fc392..99cd0fb8 100644 --- a/app/plugins/customhosts/__init__.py +++ b/app/plugins/customhosts/__init__.py @@ -145,6 +145,26 @@ class CustomHosts(_PluginBase): ] } ] + }, + { + 'component': 'VRow', + 'content': [ + { + 'component': 'VCol', + 'props': { + 'cols': 12, + }, + 'content': [ + { + 'component': 'VAlert', + 'props': { + 'text': 'host格式ip host,中间有空格!!!' + '(注:容器运行则更新容器hosts!非宿主机!)' + } + } + ] + } + ] } ] } @@ -211,7 +231,7 @@ class CustomHosts(_PluginBase): # 添加新的Hosts system_hosts.add(new_entrys) system_hosts.write() - logger.info("更新系统hosts文件成功(注:容器运行则更新容器hosts!)") + logger.info("更新系统hosts文件成功") except Exception as err: err_flag = True logger.error(f"更新系统hosts文件失败:{str(err) or '请检查权限'}") From 9ff6015fec304caa737e26f4543f9516f2eac9a1 Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 25 Oct 2023 16:53:51 +0800 Subject: [PATCH 5/8] =?UTF-8?q?fix=20Cloudflare=20IP=E4=BC=98=E9=80=89?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=8F=8F=E8=BF=B0=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/cloudflarespeedtest/__init__.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/plugins/cloudflarespeedtest/__init__.py b/app/plugins/cloudflarespeedtest/__init__.py index 140a1c71..4c70b4c0 100644 --- a/app/plugins/cloudflarespeedtest/__init__.py +++ b/app/plugins/cloudflarespeedtest/__init__.py @@ -682,6 +682,25 @@ class CloudflareSpeedTest(_PluginBase): ] } ] + }, + { + 'component': 'VRow', + 'content': [ + { + 'component': 'VCol', + 'props': { + 'cols': 12, + }, + 'content': [ + { + 'component': 'VAlert', + 'props': { + 'text': 'F12看请求的Server属性,如果是cloudflare说明该站点支持Cloudflare IP优选。' + } + } + ] + } + ] } ] } From 71b35e39ab3ac18d12b00300908d742e772d61a1 Mon Sep 17 00:00:00 2001 From: thsrite Date: Thu, 26 Oct 2023 09:10:59 +0800 Subject: [PATCH 6/8] fix 18262f98 --- app/plugins/mediasyncdel/__init__.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/app/plugins/mediasyncdel/__init__.py b/app/plugins/mediasyncdel/__init__.py index 2be15763..c6404aeb 100644 --- a/app/plugins/mediasyncdel/__init__.py +++ b/app/plugins/mediasyncdel/__init__.py @@ -583,7 +583,8 @@ class MediaSyncDel(_PluginBase): logger.info(f"正在同步删除{msg}") if not transfer_history: - logger.warn(f"{media_type} {media_name} 未获取到可删除数据,请检查路径映射是否配置错误,请检查tmdbid获取是否正确") + logger.warn( + f"{media_type} {media_name} 未获取到可删除数据,请检查路径映射是否配置错误,请检查tmdbid获取是否正确") return # 开始删除 @@ -627,20 +628,14 @@ class MediaSyncDel(_PluginBase): logger.info(f"同步删除 {msg} 完成!") + media_type = MediaType.MOVIE if media_type in ["Movie", "MOV"] else MediaType.TV + # 发送消息 if self._notify: - if media_type == "Episode": - # 根据tmdbid获取图片 - images = self.episode.images(tv_id=tmdb_id, - season_num=season_num, - episode_num=episode_num) - if images: - image = self.get_tmdbimage_url(images[-1].get("file_path"), prefix="original") - - if not image: + if not image or media_type == MediaType.TV: specific_image = self.chain.obtain_specific_image( mediaid=tmdb_id, - mtype=MediaType.MOVIE if media_type in ["Movie", "MOV"] else MediaType.TV, + mtype=media_type, image_type=MediaImageType.Backdrop, season=season_num, episode=episode_num @@ -679,7 +674,7 @@ class MediaSyncDel(_PluginBase): history = self.get_data('history') or [] history.append({ - "type": "电影" if media_type == "Movie" or media_type == "MOV" else "电视剧", + "type": media_type.value, "title": media_name, "year": year, "path": media_path, From 68b6e67a932467543a35d52d4ed480dbc9a4eb7f Mon Sep 17 00:00:00 2001 From: thsrite Date: Thu, 26 Oct 2023 11:07:11 +0800 Subject: [PATCH 7/8] fix #970 --- app/chain/download.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/chain/download.py b/app/chain/download.py index 09fc08b8..5f4be2bc 100644 --- a/app/chain/download.py +++ b/app/chain/download.py @@ -350,6 +350,7 @@ class DownloadChain(ChainBase): no_exists[_tmdbid].pop(_sea) if not no_exists.get(_tmdbid) and no_exists.get(_tmdbid) is not None: no_exists.pop(_tmdbid) + break return need def __update_episodes(_tmdbid: int, _sea: int, _need: list, _current: set) -> list: @@ -485,8 +486,9 @@ class DownloadChain(ChainBase): need_tv = no_exists.get(need_tmdbid) if not need_tv: continue + need_tv_copy = copy.deepcopy(no_exists.get(need_tmdbid)) # 循环每一季 - for sea, tv in need_tv.items(): + for sea, tv in need_tv_copy.items(): # 当前需要季 need_season = sea # 当前需要集 From 2dd4395698c44e7597e43d3b28d93194a449e152 Mon Sep 17 00:00:00 2001 From: thsrite Date: Thu, 26 Oct 2023 11:28:07 +0800 Subject: [PATCH 8/8] fix #935 --- app/plugins/moviepilotupdatenotify/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/plugins/moviepilotupdatenotify/__init__.py b/app/plugins/moviepilotupdatenotify/__init__.py index b2cb81cd..76bb631d 100644 --- a/app/plugins/moviepilotupdatenotify/__init__.py +++ b/app/plugins/moviepilotupdatenotify/__init__.py @@ -1,5 +1,6 @@ import datetime +import pytz from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.triggers.cron import CronTrigger @@ -91,7 +92,12 @@ class MoviePilotUpdateNotify(_PluginBase): # 推送更新消息 if self._notify: # 将时间字符串转为datetime对象 - update_time = datetime.datetime.strptime(update_time, "%Y-%m-%dT%H:%M:%SZ").strftime("%Y-%m-%d %H:%M:%S") + dt = datetime.datetime.strptime(update_time, "%Y-%m-%dT%H:%M:%SZ") + # 设置时区 + timezone = pytz.timezone(settings.TZ) + dt = dt.replace(tzinfo=timezone) + # 将datetime对象转换为带时区的字符串 + update_time = dt.strftime("%Y-%m-%d %H:%M:%S") self.post_message( mtype=NotificationType.SiteMessage, title="【MoviePilot更新通知】",