This commit is contained in:
nose
2025-12-20 02:12:45 -08:00
parent b0b198df95
commit b75faa49a2
27 changed files with 2883 additions and 3329 deletions

View File

@@ -523,7 +523,7 @@ local function _refresh_store_cache(timeout_seconds)
if not resp or not resp.success or type(resp.choices) ~= 'table' then
_lua_log('stores: failed to load store choices via helper; stderr=' .. tostring(resp and resp.stderr or '') .. ' error=' .. tostring(resp and resp.error or ''))
-- Fallback: directly call Python to import CLI.get_store_choices().
-- Fallback: directly call Python to import MedeiaCLI.get_store_choices().
-- This avoids helper IPC issues and still stays in sync with the REPL.
local python = (opts and opts.python_path) and tostring(opts.python_path) or 'python'
local cli_path = (opts and opts.cli_path) and tostring(opts.cli_path) or nil
@@ -537,7 +537,7 @@ local function _refresh_store_cache(timeout_seconds)
if cli_path and cli_path ~= '' then
local root = tostring(cli_path):match('(.*)[/\\]') or ''
if root ~= '' then
local code = "import json, sys; sys.path.insert(0, r'" .. root .. "'); from CLI import get_store_choices; print(json.dumps(get_store_choices()))"
local code = "import json, sys; sys.path.insert(0, r'" .. root .. "'); from CLI import MedeiaCLI; print(json.dumps(MedeiaCLI.get_store_choices()))"
local res = utils.subprocess({
args = { python, '-c', code },
cancellable = false,
@@ -1027,7 +1027,7 @@ local function _start_download_flow_for_current()
return
end
ensure_mpv_ipc_server()
M.run_pipeline('get-file -store ' .. quote_pipeline_arg(store_hash.store) .. ' -hash ' .. store_hash.hash .. ' -path ' .. quote_pipeline_arg(folder))
M.run_pipeline('get-file -store ' .. quote_pipeline_arg(store_hash.store) .. ' -query ' .. quote_pipeline_arg('hash:' .. store_hash.hash) .. ' -path ' .. quote_pipeline_arg(folder))
mp.osd_message('Download started', 2)
return
end