Open pacien opened 4 years ago
this is also missing windows support... is that required @po5? look at the repo i linked they have https://github.com/hishamhm/datafile/blob/master/datafile/openers/windows.lua
not sure if APPDATA
is the correct place to put this?
I didn't merge this PR since it's obvious it'll break on tons of systems. You should not be trying to make up paths, they should come from a source of truth. This is why the script queries mpv for the path, because it knows better than anyone where mpv scripts go.
agreed, but I don't think putting state into mpv's script directory is great either :stuck_out_tongue:
i don't think mpv exposes it's state/cache directories via the plugin api, so if we want to improve on the current situation the xdg paths (and their equivalent on other platforms) seem like a sane choice?
mpv's options support shortcuts for various paths. Maybe the directory could be an option for mpv_sponsorblock that defaults to ~~cache/mpv_sponsorblock/
or similar.
I'm not sure why this dir is named "shared". No other users, scripts, or programs will be using this dir right? The only real requirement is that it be writable.
this is also missing windows support... is that required @po5? look at the repo i linked they have https://github.com/hishamhm/datafile/blob/master/datafile/openers/windows.lua
not sure if
APPDATA
is the correct place to put this?
On Windows, standard for user-specific app configs is %APPDATA%
. %LOCALAPPDATA%
is typically used for cache and temporary files, but can also be used for permanent storage. Both are generally writable, the main difference is %APPDATA%
may be synced across multiple systems while %LOCALAPPDATA%
is local to a specific machine, but this syncing feature is rarely used. Cache and temporary files are supposed to be in %TEMP%. mpv uses %APPDATA%\mpv
for it's config dir by default.
If you wanted to do everything "by-the-book", I would say sponsorblock.db
should go in %LOCALAPPDATA%\\mpv_sponsorblock
and sponsorblock.txt
should go in %APPDATA%\mpv_sponsorblock
, but that is probably too much trouble for no real benefit.
I would say the best location for both files on Windows is simply the script directory, %APPDATA%\mpv\scripts\sponsorblock
. You'll want to move the script itself into that dir as main.lua
as well https://github.com/po5/mpv_sponsorblock/pull/66
… Falling back to standard locations then the script's shared directory otherwise.
GitHub: closes #16