Rename old_youtube_cache_dirs

It makes sense to do this here because anyone who had the previous setting was, more than likely, using this file.
This commit is contained in:
tcely 2024-12-22 02:42:30 -05:00 committed by GitHub
parent 2f89c333a4
commit 42a1033e7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,3 +88,13 @@ SOURCE_DOWNLOAD_DIRECTORY_PREFIX = True if SOURCE_DOWNLOAD_DIRECTORY_PREFIX_STR
VIDEO_HEIGHT_CUTOFF = int(os.getenv("TUBESYNC_VIDEO_HEIGHT_CUTOFF", "240"))
# ensure that the current directory exists
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-*'))
for cache_dir in old_youtube_cache_dirs:
cache_dir.rename(YOUTUBE_DL_CACHEDIR / cache_dir.name)