tweak: revert back cn domain. close #57

This commit is contained in:
cxfksword 2023-12-16 15:11:34 +08:00
parent a1b8533376
commit e3a4ea6d73
4 changed files with 33 additions and 29 deletions

View File

@ -44,18 +44,10 @@ jobs:
dotnet publish --nologo --no-restore --configuration=Release --framework=net6.0 -p:Version=${{steps.vars.outputs.VERSION}} ${{ env.project }}
mkdir -p artifacts
zip -j ./artifacts/${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ./Jellyfin.Plugin.MetaShark/bin/Release/net6.0/Jellyfin.Plugin.MetaShark.dll
cp ./doc/logo.png ./artifacts/logo.png
- name: Generate manifest
run: cd artifacts && python3 ../scripts/generate_manifest.py ${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ${GITHUB_REF#refs/*/}
- name: Deploy to jellyfin release repo
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.PAT }}
external_repository: cxfksword/jellyfin-release
destination_dir: ${{ env.artifact }}
publish_branch: master
publish_dir: ./artifacts
keep_files: true
run: python3 ./scripts/generate_manifest.py ./artifacts/${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ${GITHUB_REF#refs/*/}
env:
CN_DOMAIN: ${{ vars.CN_DOMAIN }}
- name: Publish release
uses: svenstaro/upload-release-action@v2
with:
@ -63,11 +55,11 @@ jobs:
file: ./artifacts/${{ env.artifact }}_*.zip
tag: ${{ github.ref }}
file_glob: true
# - name: Publish manifest
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ./artifacts/manifest*.json
# tag: "manifest"
# overwrite: true
# file_glob: true
- name: Publish manifest
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./manifest*.json
tag: "manifest"
overwrite: true
file_glob: true

View File

@ -72,7 +72,10 @@ namespace Jellyfin.Plugin.MetaShark.Providers
});
}
if (list.Count == 0)
{
this.Log($"Got images failed because the images of \"{item.Name}\" is empty!");
}
return list;
}

View File

@ -16,7 +16,13 @@ jellyfin电影元数据插件影片信息只要从豆瓣获取并由TheMov
只支持最新的`jellyfin 10.8.x`版本
添加插件存储库https://jellyfin-plugin-release.pages.dev/metashark/manifest.json
添加插件存储库:
国内加速https://mirror.ghproxy.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
> 如果无法访问,可以直接从 [Release](https://github.com/cxfksword/jellyfin-plugin-metashark/releases) 页面下载,并解压到 jellyfin 插件中目录使用
## 如何使用

View File

@ -18,7 +18,7 @@ def generate_manifest():
"overview": "jellyfin电影元数据插件",
"owner": "cxfksword",
"category": "Metadata",
"imageUrl": "https://jellyfin-plugin-release.pages.dev/metashark/logo.png",
"imageUrl": "https://github.com/cxfksword/jellyfin-plugin-metashark/raw/main/doc/logo.png",
"versions": []
}]
@ -27,7 +27,7 @@ def generate_version(filepath, version, changelog):
'version': f"{version}.0",
'changelog': changelog,
'targetAbi': '10.8.0.0',
'sourceUrl': f'https://jellyfin-plugin-release.pages.dev/metashark/metashark_{version}.0.zip',
'sourceUrl': f'https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/v{version}/metashark_{version}.0.zip',
'checksum': md5sum(filepath),
'timestamp': datetime.now().strftime('%Y-%m-%dT%H:%M:%S')
}
@ -47,7 +47,7 @@ def main():
# 解析旧 manifest
try:
with urlopen('https://raw.githubusercontent.com/cxfksword/jellyfin-release/master/metashark/manifest.json') as f:
with urlopen('https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/manifest/manifest.json') as f:
manifest = json.load(f)
except HTTPError as err:
if err.code == 404:
@ -63,11 +63,14 @@ def main():
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)
cn_domain = 'https://mirror.ghproxy.com/'
if 'CN_DOMAIN' in os.environ:
cn_domain = os.environ["CN_DOMAIN"]
cn_domain = cn_domain.rstrip('/')
with open('manifest_cn.json', 'w') as f:
manifest_cn = json.dumps(manifest, indent=2)
manifest_cn = re.sub('https://github.com', f'{cn_domain}/https://github.com', manifest_cn)
f.write(manifest_cn)
if __name__ == '__main__':