syntax revamp
This commit is contained in:
@@ -2658,6 +2658,41 @@ local function _queue_pipeline_in_repl(pipeline_cmd, queued_message, failure_pre
|
||||
return false
|
||||
end
|
||||
|
||||
do
|
||||
local repo_root = _detect_repo_root()
|
||||
local detail = 'REPL not running'
|
||||
if repo_root ~= '' then
|
||||
local log_dir = utils.join_path(repo_root, 'Log')
|
||||
if _path_exists(log_dir) then
|
||||
local state_path = utils.join_path(log_dir, 'medeia-repl-state.json')
|
||||
local fh = io.open(state_path, 'r')
|
||||
if fh then
|
||||
local raw = fh:read('*a')
|
||||
fh:close()
|
||||
raw = trim(tostring(raw or ''))
|
||||
if raw ~= '' then
|
||||
local ok, payload = pcall(utils.parse_json, raw)
|
||||
if ok and type(payload) == 'table' then
|
||||
local status = trim(tostring(payload.status or 'running')):lower()
|
||||
local updated_at = tonumber(payload.updated_at or 0)
|
||||
local now = (os and os.time) and os.time() or nil
|
||||
if status == '' or status == 'running' then
|
||||
if updated_at and updated_at > 0 and now and (now - updated_at) <= 3 then
|
||||
detail = ''
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if detail ~= '' then
|
||||
_lua_log(queue_label .. ': repl unavailable err=' .. detail)
|
||||
mp.osd_message((failure_prefix or 'REPL queue failed') .. ': ' .. detail, 5)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
local queue_metadata = { kind = 'mpv-download' }
|
||||
if type(metadata) == 'table' then
|
||||
for key, value in pairs(metadata) do
|
||||
@@ -5566,7 +5601,7 @@ local function _start_download_flow_for_current()
|
||||
end
|
||||
|
||||
ensure_mpv_ipc_server()
|
||||
local pipeline_cmd = 'file -get -store ' .. quote_pipeline_arg(store_hash.store) .. ' -query ' .. quote_pipeline_arg('hash:' .. store_hash.hash) .. ' -path ' .. quote_pipeline_arg(folder)
|
||||
local pipeline_cmd = 'file -download -instance ' .. quote_pipeline_arg(store_hash.store) .. ' -query ' .. quote_pipeline_arg('hash:' .. store_hash.hash) .. ' -path ' .. quote_pipeline_arg(folder)
|
||||
_queue_pipeline_in_repl(
|
||||
pipeline_cmd,
|
||||
'Queued in REPL: store copy',
|
||||
|
||||
Reference in New Issue
Block a user