Skip to content

Commit

Permalink
use mediainfo and mplayer for info view audio files
Browse files Browse the repository at this point in the history
  • Loading branch information
Junker committed Jul 11, 2022
1 parent a1c015c commit 6211300
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,17 @@ local function info_view_video(node)
return info_view_node(node)
end

local function info_view_audio(node)
if program_exists("mediainfo") then
return exec_paging("mediainfo", node)
elseif program_exists("mplayer") then
return exec_paging("mplayer", node, "-identify", "-vo null", "-ao null", "-frames 0")
end

return info_view_node(node)
end


local function info_view_epub(node)
if program_exists("einfo") then
return exec_paging("einfo", node, "-v");
Expand Down Expand Up @@ -511,9 +522,10 @@ local function smart_view(ctx)

if node_mime:match("^image/.*") then
return smart_view_image(node)
end
if node_mime:match("^video/.*") then
elseif node_mime:match("^video/.*") then
return info_view_video(node)
elseif node_mime:match("^audio/.*") then
return info_view_audio(node)
end

for smart_view_,v in ipairs(archive_mime_types) do
Expand Down

0 comments on commit 6211300

Please sign in to comment.