Load metadata for non-playing songs #38
Labels
No Label
art
big
blocked
bug
ci-cd
crash report
disputed
documentation
duplicate
feature request
good first issue
packaging
question
security
techdebt spring cleaning
testing
wontfix
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Projects/greg-ng#38
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I would like to see what songs will play, or be able to jump to a specific song, and for reordering
grzegors-webui had a background thread fetching the meta, maintaining a hashmap from urls to meta blobs. One shortcoming was that the fetch order was static, meaning that if you import a playlist then hit shuffle, the meta would still load in the old order
i also think it was that thread that marked items red when it was unable to pull the meta
Just to make sure I understood correctly, this issue occurs when you add one song after another, right? I've mostly tested with playlists, and they resolve all songs at once
mpv internal state is currently the single source of truth. Running the fetching script past the currently playing track has been requested before, in the context of preloading videos https://github.com/mpv-player/mpv/issues/6437#issuecomment-453795638
After a bit of more research, I've found that
ytdl_hook.lua
gets automatically loaded by mpv. At the end of the script, it callsmp.add_hook()
a bunch of times, and it hooks into theon-load
target which only runs when a single playlist entry is about to play. All of the functions are marked as local, and there is no API for introspecting the list of hooks as far as I'm aware. This means that there is no real way to access the functions used in the hooks from outside the script without making some patches.Here's a list of possible solutions:
Preferrable solutions, actually fixes the problem for everyone
Upstream another hook target
on-add
, and have the ytdl hook target that instead (see current hook targets). This would somewhat fix the problem for everyone automatically, but some people might complain that it reduces laziness unnecessarily.Upstream a
resolve
command which lets you try to further resolve a playlist entry. This might be the most versatile option, but requires a user to actively resolve the entries either programmatically or through a keybinding. It also calls for a few design decisions, should probably be made by some of the core maintainers:Mediocre solutions, still gets upstream maintenance and no reinventing the wheel
Patch the lua script to use non-local functions before compilation, so maybe we can include it as a lua module and call the functions arbitrarily from our own script.
Make a dynamically generated copy of the lua script without the
add_hook
calls so we can call the functions arbitrarily from our own script.Nonpreferred solution, maintainership relies solely on us and we're reinventing the wheel