-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/sleikang/EmbyChineseNameSyn…
- Loading branch information
Showing
5 changed files
with
221 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Build EmbyChineseNameSynchronous Nightly | ||
|
||
on: | ||
schedule: | ||
- cron: '0 2 * * *' | ||
|
||
jobs: | ||
push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Set Version | ||
id: set-version | ||
run: | | ||
echo "::set-output name=version::${GITHUB_REF:10}" | ||
echo "ReleaseTag=${GITHUB_REF:10}" | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- | ||
name: Build EmbyChineseNameSynchronous | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
linux/arm/v7 | ||
linux/arm/v6 | ||
push: true | ||
build-args: | | ||
VERSION=${{ steps.set-version.outputs.version }} | ||
tags: | | ||
${{ secrets.DOCKER_USERNAME }}/embychinesenamesynchronous:nightly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Build EmbyChineseNameSynchronous | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Set Version | ||
id: set-version | ||
run: | | ||
echo "::set-output name=version::${GITHUB_REF:10}" | ||
echo "ReleaseTag=${GITHUB_REF:10}" | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- | ||
name: Build EmbyChineseNameSynchronous | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
linux/arm/v7 | ||
linux/arm/v6 | ||
push: true | ||
build-args: | | ||
VERSION=${{ steps.set-version.outputs.version }} | ||
tags: | | ||
${{ secrets.DOCKER_USERNAME }}/embychinesenamesynchronous:${{ steps.set-version.outputs.version }} | ||
${{ secrets.DOCKER_USERNAME }}/embychinesenamesynchronous:latest | ||
- | ||
name: Docker Hub Description | ||
uses: peter-evans/dockerhub-description@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
repository: ddsderek/embychinesenamesynchronous | ||
short-description: EmbyChineseNameSynchronous Image | ||
readme-filepath: ./README_DOCKER.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM alpine:3.16 | ||
|
||
ENV EMBYHOST=embyhost \ | ||
EMBYUSERID=embyuserid \ | ||
EMBYKEY=embykey \ | ||
TMDBKEY=tmdbkey \ | ||
THREADNUM=16 \ | ||
UPDATEPEOPLE=True \ | ||
UPDATETIME=1 \ | ||
TZ=Asia/Shanghai | ||
|
||
RUN apk add --update --no-cache \ | ||
python3-dev \ | ||
py3-pip \ | ||
bash \ | ||
tzdata && \ | ||
pip install zhconv && \ | ||
pip install requests && \ | ||
pip install simplejson && \ | ||
# 清理 | ||
rm -rf /tmp/* /root/.cache /var/cache/apk/* | ||
|
||
COPY --chmod=755 . /opt | ||
|
||
CMD [ "/opt/start.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
**docker-cli** | ||
|
||
``` | ||
docker run -itd \ | ||
--name EmbyChineseNameSynchronous \ | ||
-v ./logs:/opt/logs \ | ||
-e EMBYHOST=embyhost \ | ||
-e EMBYUSERID=embyuserid \ | ||
-e EMBYKEY=embykey \ | ||
-e TMDBKEY=tmdbkey \ | ||
-e THREADNUM=16 \ | ||
-e UPDATEPEOPLE=True \ | ||
-e UPDATETIME=1 \ | ||
-e TZ=Asia/Shanghai \ | ||
ddsderek/embychinesenamesynchronous:latest | ||
``` | ||
|
||
**docker-compose** | ||
|
||
``` | ||
version: '3.3' | ||
services: | ||
embychinesenamesynchronous: | ||
container_name: EmbyChineseNameSynchronous | ||
volumes: | ||
- './logs:/opt/logs' | ||
environment: | ||
- EMBYHOST=embyhost | ||
- EMBYUSERID=embyuserid | ||
- EMBYKEY=embykey | ||
- TMDBKEY=tmdbkey | ||
- THREADNUM=16 | ||
- UPDATEPEOPLE=True | ||
- UPDATETIME=1 | ||
- TZ=Asia/Shanghai | ||
image: 'ddsderek/embychinesenamesynchronous:latest' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
function setting { | ||
|
||
touch /setting.lock | ||
|
||
mkdir -p /opt/logs | ||
touch /opt/logs/EmbyChineseNameSynchronous.log | ||
|
||
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime | ||
echo $TZ > /etc/timezone | ||
|
||
cat > /opt/main.py <<EOF | ||
import time | ||
from embyserver import embyserver | ||
#EMBY 域名 包含http(s)和端口号后面不带/ | ||
#例如https://xxx.xxx.xxx:8920 | ||
embyhost = '$EMBYHOST' | ||
#EMBY 用户ID 进EMBY 用户点击管理员账号配置可以在网址上看到userId | ||
embyuserid = '$EMBYUSERID' | ||
#EMBY APIKEY | ||
embykey = '$EMBYKEY' | ||
#TMDB APIKEY | ||
tmdbkey = '$TMDBKEY' | ||
#线程数量 | ||
threadnum = $THREADNUM | ||
#是否刷新人名 | ||
updatepeople = $UPDATEPEOPLE | ||
#每次刷新全部媒体间隔时间 [小时] | ||
updatetime = $UPDATETIME | ||
if __name__ == '__main__': | ||
embymediaclient = embyserver(embyhost=embyhost, embyuserid=embyuserid, embykey=embykey, tmdbkey=tmdbkey, threadnum=threadnum, updatepeople=updatepeople) | ||
while True: | ||
try: | ||
print('开始刷新媒体库元数据') | ||
embymediaclient.update_media_name() | ||
print('刷新媒体库元数据完成') | ||
except Exception as reuslt: | ||
print(reuslt) | ||
EOF | ||
|
||
} | ||
|
||
if [ ! -f /setting.lock ]; then | ||
setting | ||
fi | ||
|
||
cd /opt | ||
python3 main.py >> /opt/logs/EmbyChineseNameSynchronous.log |