Skip to content

Commit

Permalink
Merge pull request #743 from tcely/patch-2
Browse files Browse the repository at this point in the history
Add `XDG_CACHE_HOME` environment variable
  • Loading branch information
meeb authored Feb 19, 2025
2 parents 60a1e09 + d8e9fa2 commit 6ded048
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ HEALTHCHECK --interval=1m --timeout=10s --start-period=3m CMD ["/app/healthcheck

# ENVS and ports
ENV PYTHONPATH="/app" \
PYTHONPYCACHEPREFIX="/config/cache/pycache"
PYTHONPYCACHEPREFIX="/config/cache/pycache" \
XDG_CACHE_HOME="/config/cache"
EXPOSE 4848

# Volumes
Expand Down
3 changes: 2 additions & 1 deletion tubesync/tubesync/local_settings.py.container
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ BACKGROUND_TASK_ASYNC_THREADS = int(os.getenv('TUBESYNC_WORKERS', DEFAULT_THREAD

MEDIA_ROOT = CONFIG_BASE_DIR / 'media'
DOWNLOAD_ROOT = DOWNLOADS_BASE_DIR
YOUTUBE_DL_CACHEDIR = CONFIG_BASE_DIR / 'cache/youtube'
YOUTUBE_DL_CACHEDIR = CONFIG_BASE_DIR / 'cache/yt-dlp'
YOUTUBE_DL_TEMPDIR = DOWNLOAD_ROOT / 'cache'
COOKIES_FILE = CONFIG_BASE_DIR / 'cookies.txt'

Expand Down Expand Up @@ -106,6 +106,7 @@ if not YOUTUBE_DL_CACHEDIR.is_dir():
YOUTUBE_DL_CACHEDIR.mkdir(parents=True)
# rename any old yt_dlp cache directories to the current directory
old_youtube_cache_dirs = list(YOUTUBE_DL_CACHEDIR.parent.glob('youtube-*'))
old_youtube_cache_dirs.extend(list(YOUTUBE_DL_CACHEDIR.parent.glob('youtube/youtube-*')))
for cache_dir in old_youtube_cache_dirs:
cache_dir.rename(YOUTUBE_DL_CACHEDIR / cache_dir.name)

0 comments on commit 6ded048

Please sign in to comment.