From aa05c0687391385600b0bc56d74eef83839fcd04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Wed, 26 Jul 2023 21:24:18 +0200 Subject: [PATCH] path-win: add subdirectory for cache To not polute %LOCALAPPDATA%/mpv as it may be used for other things too. --- DOCS/man/mpv.rst | 2 +- osdep/path-win.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DOCS/man/mpv.rst b/DOCS/man/mpv.rst index 8619d8b00e..a77cc21224 100644 --- a/DOCS/man/mpv.rst +++ b/DOCS/man/mpv.rst @@ -1653,7 +1653,7 @@ You can find the exact path by running ``echo %APPDATA%\mpv\mpv.conf`` in cmd.ex Other config files (such as ``input.conf``) are in the same directory. See the `FILES`_ section above. -The cache directory is located at ``%LOCALAPPDATA%/mpv``. +The cache directory is located at ``%LOCALAPPDATA%/mpv/cache``. The environment variable ``$MPV_HOME`` completely overrides these, like on UNIX. diff --git a/osdep/path-win.c b/osdep/path-win.c index 18f03561b7..013b093347 100644 --- a/osdep/path-win.c +++ b/osdep/path-win.c @@ -98,7 +98,7 @@ const char *mp_get_platform_path_win(void *talloc_ctx, const char *type) if (strcmp(type, "home") == 0) return mp_get_win_app_dir(talloc_ctx); if (strcmp(type, "cache") == 0) - return mp_get_win_local_app_dir(talloc_ctx); + return mp_path_join(talloc_ctx, mp_get_win_local_app_dir(talloc_ctx), "cache"); if (strcmp(type, "exe_dir") == 0) return mp_get_win_exe_dir(talloc_ctx); // Not really true, but serves as a way to return a lowest-priority dir.