From 1537be08449bffd67c28f7b7b9449dd60962a308 Mon Sep 17 00:00:00 2001 From: wumode Date: Thu, 29 May 2025 18:17:51 +0800 Subject: [PATCH] =?UTF-8?q?update(ImdbSource):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=8E=92=E5=BA=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.v2.json | 3 ++- plugins.v2/imdbsource/__init__.py | 17 ++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.v2.json b/package.v2.json index f65a1a1..ddc2058 100644 --- a/package.v2.json +++ b/package.v2.json @@ -425,11 +425,12 @@ "name": "IMDb源", "description": "让探索支持IMDb数据源。", "labels": "探索", - "version": "1.3", + "version": "1.3.1", "icon": "IMDb_IOS-OSX_App.png", "author": "wumode", "level": 1, "history": { + "v1.3.1": "修复按日期排序错误", "v1.3": "优化网络连接", "v1.2": "推荐热门纪录片", "v1.1": "推荐支持IMDB数据源; 优化海报尺寸,减少卡顿", diff --git a/plugins.v2/imdbsource/__init__.py b/plugins.v2/imdbsource/__init__.py index 817dd45..770a72e 100644 --- a/plugins.v2/imdbsource/__init__.py +++ b/plugins.v2/imdbsource/__init__.py @@ -1,6 +1,7 @@ import re import json from typing import Optional, Any, List, Dict, Tuple +from datetime import datetime from app.core.config import settings from app.core.event import eventmanager, Event @@ -24,7 +25,7 @@ class ImdbSource(_PluginBase): plugin_icon = ("https://raw.githubusercontent.com/jxxghp/" "MoviePilot-Plugins/refs/heads/main/icons/IMDb_IOS-OSX_App.png") # 插件版本 - plugin_version = "1.3" + plugin_version = "1.3.1" # 插件作者 plugin_author = "wumode" # 作者主页 @@ -607,6 +608,8 @@ class ImdbSource(_PluginBase): elif year == "1970s": release_date_start = "1970-01-01" release_date_end = "1979-12-31" + if not release_date_end: + release_date_end = datetime.now().date().strftime("%Y-%m-%d") awards = (award,) if award else None ranked_lists = (ranked_list,) if ranked_list else None first_page = False @@ -644,17 +647,13 @@ class ImdbSource(_PluginBase): if mtype == "movies": for movie in results: movie_info = movie.get('node').get("title") - pub_status = movie_info.get("productionStatus") - if pub_status and pub_status.get("currentProductionStage"): - if pub_status.get("currentProductionStage", {}).get("id") == 'released': - res.append(self.__movie_to_media(movie_info)) + res.append(self.__movie_to_media(movie_info)) + else: for tv in results: tv_info = tv.get('node').get('title') - pub_status = tv_info.get("productionStatus") - if pub_status and pub_status.get("currentProductionStage"): - if pub_status.get("currentProductionStage", {}).get("id") == 'released': - res.append(self.__series_to_media(tv_info)) + res.append(self.__series_to_media(tv_info)) + return res def get_api(self) -> List[Dict[str, Any]]: