From 2655f025ccc038b71e6ee846bd15042bb685f1e2 Mon Sep 17 00:00:00 2001 From: cxfksword <718792+cxfksword@users.noreply.github.com> Date: Sat, 25 Nov 2023 09:44:57 +0800 Subject: [PATCH] fix: remove ghproxy domain. #53 --- .github/workflows/publish.yaml | 14 +++++++------- .gitignore | 3 +-- README.md | 6 +----- generate_manifest.py | 22 ++++++++++++---------- global.json | 1 - 5 files changed, 21 insertions(+), 25 deletions(-) delete mode 100644 global.json diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 0c85e2a..b771c16 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -55,13 +55,13 @@ jobs: destination_dir: ${{ env.artifact }} publish_branch: master publish_dir: ./artifacts - # - name: Publish release - # uses: svenstaro/upload-release-action@v2 - # with: - # repo_token: ${{ secrets.GITHUB_TOKEN }} - # file: ./artifacts/${{ env.artifact }}_*.zip - # tag: ${{ github.ref }} - # file_glob: true + - name: Publish release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./artifacts/${{ env.artifact }}_*.zip + tag: ${{ github.ref }} + file_glob: true # - name: Publish manifest # uses: svenstaro/upload-release-action@v2 # with: diff --git a/.gitignore b/.gitignore index 65cc20e..b82082d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,5 @@ obj/ artifacts **/.DS_Store metashark/ -manifest_cn.json -manifest.json +*.json .vscode diff --git a/README.md b/README.md index ca31229..9994524 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,7 @@ jellyfin电影元数据插件,影片信息只要从豆瓣获取,并由TheMov 只支持最新的`jellyfin 10.8.x`版本 -添加插件存储库: - -国内加速:https://gh-proxy.com/https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/manifest/manifest_cn.json - -国外访问:https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/manifest/manifest.json +添加插件存储库:https://jellyfin-plugin-release.pages.dev/metashark/manifest.json ## 如何使用 diff --git a/generate_manifest.py b/generate_manifest.py index 07aafd8..e2d29f4 100755 --- a/generate_manifest.py +++ b/generate_manifest.py @@ -9,6 +9,7 @@ from datetime import datetime from urllib.request import urlopen from urllib.error import HTTPError + def generate_manifest(): return [{ "guid": "9a19103f-16f7-4668-be54-9a1e7a4f7556", @@ -17,7 +18,7 @@ def generate_manifest(): "overview": "jellyfin电影元数据插件", "owner": "cxfksword", "category": "Metadata", - "imageUrl": "https://github.com/cxfksword/jellyfin-plugin-metashark/raw/main/doc/logo.png", + "imageUrl": "https://jellyfin-plugin-release.pages.dev/metashark/logo.png", "versions": [] }] @@ -26,7 +27,7 @@ def generate_version(filepath, version, changelog): 'version': f"{version}.0", 'changelog': changelog, 'targetAbi': '10.8.0.0', - 'sourceUrl': f'https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/v{version}/metashark_{version}.0.zip', + 'sourceUrl': f'https://jellyfin-plugin-release.pages.dev/metashark/metashark_{version}.0.zip', 'checksum': md5sum(filepath), 'timestamp': datetime.now().strftime('%Y-%m-%dT%H:%M:%S') } @@ -39,7 +40,7 @@ def md5sum(filename): def main(): filename = sys.argv[1] tag = sys.argv[2] - version = tag.removeprefix('v') + version = tag.lstrip('v') filepath = os.path.join(os.getcwd(), filename) result = subprocess.run(['git', 'tag','-l','--format=%(contents)', tag, '-l'], stdout=subprocess.PIPE) changelog = result.stdout.decode('utf-8').strip() @@ -54,18 +55,19 @@ def main(): else: raise - # 追加新版本 + # 追加新版本/覆盖旧版本 + manifest[0]['versions'] = list(filter(lambda x: x['version'] == version, manifest[0]['versions'])) manifest[0]['versions'].insert(0, generate_version(filepath, version, changelog)) with open('manifest.json', 'w') as f: json.dump(manifest, f, indent=2) - # 国内加速 - with open('manifest_cn.json', 'w') as f: - manifest_cn = json.dumps(manifest, indent=2) - manifest_cn = re.sub('https://github.com/cxfksword/jellyfin-plugin-metashark/raw/main/doc/logo.png', "https://jellyfin-plugin-release.pages.dev/metashark/logo.png", manifest_cn) - manifest_cn = re.sub('https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/v[0-9.]+', "https://jellyfin-plugin-release.pages.dev/metashark", manifest_cn) - f.write(manifest_cn) + # # 国内加速 + # with open('manifest_cn.json', 'w') as f: + # manifest_cn = json.dumps(manifest, indent=2) + # manifest_cn = re.sub('https://github.com/cxfksword/jellyfin-plugin-metashark/raw/main/doc/logo.png', "https://jellyfin-plugin-release.pages.dev/metashark/logo.png", manifest_cn) + # manifest_cn = re.sub('https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/v[0-9.]+', "https://jellyfin-plugin-release.pages.dev/metashark", manifest_cn) + # f.write(manifest_cn) if __name__ == '__main__': diff --git a/global.json b/global.json deleted file mode 100644 index ec9400d..0000000 --- a/global.json +++ /dev/null @@ -1 +0,0 @@ -{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}