5 Commits

Author SHA1 Message Date
757804b192 disable debug
Some checks failed
Luacheck / luacheck (push) Failing after 2m10s
2025-02-15 01:36:30 -08:00
33f10c84b9 clean up code 2025-02-15 01:15:55 -08:00
412634c943 update config file and readme 2025-02-14 20:21:19 -08:00
3f7a5fb183 add additional fields for history database
Some checks failed
Luacheck / luacheck (push) Failing after 2m27s
2025-02-13 18:53:00 -08:00
68875120c5 add documentation and update get_video_info
- change to json dump and use mpv native json reader
2025-02-13 01:50:48 -08:00

View File

@@ -421,21 +421,15 @@ function YouTubeQueue.get_video_info(url)
return nil
end
local category = nil
if data.categories then
category = data.categories[1]
else
category = "Unknown"
end
local info = {
channel_url = data.channel_url or "",
channel_name = data.uploader or "",
video_name = data.title or "",
view_count = data.view_count or "",
upload_date = data.upload_date or "",
category = category or "",
category = data.categories[1] or "",
thumbnail_url = data.thumbnail or "",
subscribers = data.channel_follower_count or 0,
subscribers = data.channel_follower_count or "",
}
if isnull(info.channel_url) or isnull(info.channel_name) or isnull(info.video_name) then
@@ -850,7 +844,6 @@ function YouTubeQueue.add_to_history_db(v)
print("Adding video to history")
print("Command: " .. table.concat(command, " "))
end
print_osd_message("Adding video to history...", MSG_DURATION)
mp.command_native_async({
name = "subprocess",
playback_only = false,
@@ -862,7 +855,6 @@ function YouTubeQueue.add_to_history_db(v)
return false
end
end)
print_osd_message("Video added to history db", MSG_DURATION)
return true
end