mpv2oboeru

mpv helpers to create flashcards from movies and TV shows
git clone anongit@rnpnr.xyz:mpv2oboeru.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 05fc1de2b408b1d0f1e5696a9528524821e0ecdb
Parent: 781252cdcad2460794783d8fb4e845c9f7aed2c2
Author: Ren Tatsumoto
Date:   Sat, 12 Dec 2020 20:21:10 +0300

add functions to return platform's temp directory

Diffstat:
Msubs2srs.lua | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/subs2srs.lua b/subs2srs.lua @@ -524,6 +524,10 @@ local function init_platform_windows() local curl_tmpfile_path = utils.join_path(os.getenv('TEMP'), 'curl_tmp.txt') mp.register_event('shutdown', function() os.remove(curl_tmpfile_path) end) + self.tmp_dir = function() + return os.getenv('TEMP') + end + self.copy_to_clipboard = function(text) mp.commandv("run", "cmd.exe", "/d", "/c", string.format("@echo off & chcp 65001 & echo %s|clip", text)) end @@ -569,6 +573,10 @@ local function init_platform_nix() config.anki_user ) + self.tmp_dir = function() + return '/tmp' + end + self.copy_to_clipboard = function(text) local handle = io.popen(clip, 'w') handle:write(text)