Skip to content

Commit

Permalink
Merge branch 'jxxghp:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
thsrite authored Feb 11, 2023
2 parents bbde08f + a8c9723 commit f3f093b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 21 deletions.
36 changes: 18 additions & 18 deletions app/media/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,24 +461,24 @@ def gen_scraper_files(self, media, scraper_nfo, scraper_pic, dir_path, file_name
self.__save_image(seasonthumb,
os.path.dirname(dir_path),
"season%s-landscape" % media.get_season_seq().rjust(2, '0'))
# 处理集图片
if scraper_tv_pic.get("episode_thumb"):
episode_thumb = os.path.join(dir_path, file_name + "-thumb.jpg")
if not os.path.exists(episode_thumb):
# 优先从TMDB查询
episode_image = self.media.get_episode_images(tv_id=media.tmdb_id,
season_id=media.get_season_seq(),
episode_id=media.get_episode_seq(),
orginal=True)
if episode_image:
self.__save_image(episode_image, episode_thumb)
else:
# 从视频文件生成缩略图
video_path = os.path.join(dir_path, file_name + file_ext)
log.info(f"【Scraper】正在生成缩略图:{video_path} ...")
FfmpegHelper().get_thumb_image_from_video(video_path=video_path,
image_path=episode_thumb)
log.info(f"【Scraper】缩略图生成完成:{episode_thumb}")
# 处理集图片
if scraper_tv_pic.get("episode_thumb"):
episode_thumb = os.path.join(dir_path, file_name + "-thumb.jpg")
if not os.path.exists(episode_thumb):
# 优先从TMDB查询
episode_image = self.media.get_episode_images(tv_id=media.tmdb_id,
season_id=media.get_season_seq(),
episode_id=media.get_episode_seq(),
orginal=True)
if episode_image:
self.__save_image(episode_image, episode_thumb)
else:
# 从视频文件生成缩略图
video_path = os.path.join(dir_path, file_name + file_ext)
log.info(f"【Scraper】正在生成缩略图:{video_path} ...")
FfmpegHelper().get_thumb_image_from_video(video_path=video_path,
image_path=episode_thumb)
log.info(f"【Scraper】缩略图生成完成:{episode_thumb}")

except Exception as e:
ExceptionUtils.exception_traceback(e)
Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ ENV LANG="C.UTF-8" \
NASTOOL_VERSION=master \
PS1="\u@\h:\w \$ " \
REPO_URL="https://github.com/jxxghp/nas-tools.git" \
PYPI_MIRROR="https://pypi.tuna.tsinghua.edu.cn/simple" \
ALPINE_MIRROR="mirrors.ustc.edu.cn" \
PUID=0 \
PGID=0 \
UMASK=000 \
Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile.beta
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ ENV LANG="C.UTF-8" \
NASTOOL_VERSION=dev \
PS1="\u@\h:\w \$ " \
REPO_URL="https://github.com/jxxghp/nas-tools.git" \
PYPI_MIRROR="https://pypi.tuna.tsinghua.edu.cn/simple" \
ALPINE_MIRROR="mirrors.ustc.edu.cn" \
PUID=0 \
PGID=0 \
UMASK=000 \
Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile.lite
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ ENV LANG="C.UTF-8" \
NASTOOL_VERSION=lite \
PS1="\u@\h:\w \$ " \
REPO_URL="https://github.com/jxxghp/nas-tools.git" \
PYPI_MIRROR="https://pypi.tuna.tsinghua.edu.cn/simple" \
ALPINE_MIRROR="mirrors.ustc.edu.cn" \
PUID=0 \
PGID=0 \
UMASK=000 \
Expand Down
6 changes: 3 additions & 3 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ if [ "${NASTOOL_AUTO_UPDATE}" = "true" ]; then
if [ "${hash_old}" != "${hash_new}" ]; then
echo "检测到requirements.txt有变化,重新安装依赖..."
if [ "${NASTOOL_CN_UPDATE}" = "true" ]; then
pip install --upgrade pip setuptools wheel -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install --upgrade pip setuptools wheel -i "${PYPI_MIRROR}"
pip install -r requirements.txt -i "${PYPI_MIRROR}"
else
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
Expand Down Expand Up @@ -64,7 +64,7 @@ if [ "${NASTOOL_AUTO_UPDATE}" = "true" ]; then
if [ "${hash_old}" != "${hash_new}" ]; then
echo "检测到package_list.txt有变化,更新软件包..."
if [ "${NASTOOL_CN_UPDATE}" = "true" ]; then
sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
sed -i "s/dl-cdn.alpinelinux.org/${ALPINE_MIRROR}/g" /etc/apk/repositories
apk update -f
fi
apk add --no-cache libffi-dev
Expand Down

0 comments on commit f3f093b

Please sign in to comment.