Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Add media title support
Browse files Browse the repository at this point in the history
- Specially useful for streams
  • Loading branch information
Naeim Taheri authored and Naeim Taheri committed May 23, 2020
1 parent 88663a7 commit 0c74df6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bookmarker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,13 @@ function printBookmarkInfo(bookmark)
end
local existance = (file_exists(path) and "") or "[!!] "
local pos = bookmark["pos"] or "0"
return existance .. dirname .. "\n" .. existance .. name .. "\n" .. displayTime(tonumber(pos))
local title = bookmark["title"]
if title ~= nil and title ~= "" and title ~= name then
title = "\n" .. title
else
title = ""
end
return existance .. dirname .. "\n" .. existance .. name .. title .. "\n" .. displayTime(tonumber(pos))
else
return "Undefined"
end
Expand Down Expand Up @@ -195,6 +201,7 @@ function currentPositionAsBookmark()
end
bookmark["filepath"] = mp.get_property("path")
bookmark["filename"] = mp.get_property("filename")
bookmark["title"] = mp.get_property("media-title")
msg.debug("[interface]", "bookmark to be saved: { " .. utils.format_json(bookmark) .. " }")
return bookmark
end
Expand Down

0 comments on commit 0c74df6

Please sign in to comment.