diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e92b7ea3..6ebeee9a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,11 +80,13 @@ jobs: - name: Prepare Frontend run: | + # 下载nginx Invoke-WebRequest -Uri "http://nginx.org/download/nginx-1.25.2.zip" -OutFile "nginx.zip" Expand-Archive -Path "nginx.zip" -DestinationPath "nginx-1.25.2" Move-Item -Path "nginx-1.25.2/nginx-1.25.2" -Destination "nginx" Remove-Item -Path "nginx.zip" Remove-Item -Path "nginx-1.25.2" -Recurse -Force + # 下载前端 $FRONTEND_VERSION = (Invoke-WebRequest -Uri "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | ConvertFrom-Json).tag_name Invoke-WebRequest -Uri "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/$FRONTEND_VERSION/dist.zip" -OutFile "dist.zip" Expand-Archive -Path "dist.zip" -DestinationPath "dist" @@ -96,11 +98,31 @@ jobs: New-Item -Path "nginx/temp/__keep__.txt" -ItemType File -Force New-Item -Path "nginx/logs" -ItemType Directory -Force New-Item -Path "nginx/logs/__keep__.txt" -ItemType File -Force + # 下载插件 thsrite + Invoke-WebRequest -Uri "https://github.com/thsrite/MoviePilot-Plugins/archive/refs/heads/main.zip" -OutFile "MoviePilot-Plugins-main.zip" + Expand-Archive -Path "MoviePilot-Plugins-main.zip" -DestinationPath "MoviePilot-Plugins-main" + Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/" -Force + Remove-Item -Path "MoviePilot-Plugins-main.zip" + Remove-Item -Path "MoviePilot-Plugins-main" -Recurse -Force + # 下载插件 honue + Invoke-WebRequest -Uri "https://github.com/honue/MoviePilot-Plugins/archive/refs/heads/main.zip" -OutFile "MoviePilot-Plugins-main.zip" + Expand-Archive -Path "MoviePilot-Plugins-main.zip" -DestinationPath "MoviePilot-Plugins-main" + Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/" -Force + Remove-Item -Path "MoviePilot-Plugins-main.zip" + Remove-Item -Path "MoviePilot-Plugins-main" -Recurse -Force + # 下载插件 InfinityPacer + Invoke-WebRequest -Uri "https://github.com/InfinityPacer/MoviePilot-Plugins/archive/refs/heads/main.zip" -OutFile "MoviePilot-Plugins-main.zip" + Expand-Archive -Path "MoviePilot-Plugins-main.zip" -DestinationPath "MoviePilot-Plugins-main" + Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/" -Force + Remove-Item -Path "MoviePilot-Plugins-main.zip" + Remove-Item -Path "MoviePilot-Plugins-main" -Recurse -Force + # 下载插件 jxxghp Invoke-WebRequest -Uri "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" -OutFile "MoviePilot-Plugins-main.zip" Expand-Archive -Path "MoviePilot-Plugins-main.zip" -DestinationPath "MoviePilot-Plugins-main" Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/" -Force Remove-Item -Path "MoviePilot-Plugins-main.zip" Remove-Item -Path "MoviePilot-Plugins-main" -Recurse -Force + # 下载资源 Invoke-WebRequest -Uri "https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip" -OutFile "MoviePilot-Resources-main.zip" Expand-Archive -Path "MoviePilot-Resources-main.zip" -DestinationPath "MoviePilot-Resources-main" Move-Item -Path "MoviePilot-Resources-main/MoviePilot-Resources-main/resources/*" -Destination "app/helper/" -Force diff --git a/app/utils/object.py b/app/utils/object.py index 4684db59..c383a21f 100644 --- a/app/utils/object.py +++ b/app/utils/object.py @@ -35,20 +35,24 @@ class ObjectUtils: """ 检查函数是否已实现 """ - source = inspect.getsource(func) - in_comment = False - for line in source.split('\n'): - line = line.strip() - if not line: - continue - if line.startswith('"""') or line.startswith("'''"): - in_comment = not in_comment - continue - if not in_comment and not (line.startswith('#') - or line == "pass" - or line.startswith('@') - or line.startswith('def ')): - return True + try: + source = inspect.getsource(func) + in_comment = False + for line in source.split('\n'): + line = line.strip() + if not line: + continue + if line.startswith('"""') or line.startswith("'''"): + in_comment = not in_comment + continue + if not in_comment and not (line.startswith('#') + or line == "pass" + or line.startswith('@') + or line.startswith('def ')): + return True + except Exception as err: + print(str(err)) + return func.__code__.co_code not in [b'd\x01S\x00', b'\x97\x00d\x00S\x00'] return False @staticmethod