I have multiple notes with metadata (YAML tags) and each note corresponds to a single mp3 file. Both the note and the mp3 have the same name. I’d like to dataview/dataviewjs/query a directory of notes and then based on the metadata have those mp3’s listed as playable files in the page.
I can get this to work with images but not mp3s.
Things I have tried
I can have an mp3 playable if I manually type it, like this
I can also use dataview to grab images from notes and display those using the embed(link), like this
LIST embed(link(file.name + ".jpg"))
FROM ("dir1" or "dir2") and #tagA/subtag
sort file.name asc
But when I try to use technique #2 with .mp3s, it doesn’t work.
It just lists the results as text. Perhaps this is a feature request for dataview development. I already put in a request here.
But I’m curious if anyone has a workaround, especially with query or dataviewjs.
I searched for mp3, embed, didn’t find anything regarding this.
I think the way forward would be to use a combination of Buttons + Templater + Dataview. The gist of the idea is as follows:
On a given page, have a button which replaces all text after the button with the result from a Templater command
The Templater command (based upon a template) triggers a Dataview script which collates the mp3-files in a random order using markdown syntax, which the template appends to the current file
This will give a static version of the embedded files, which will circumvent the issues that Dataview has with embedding files, whilst still allowing for a refresh of the playlist by the hit of a button.
Is this idea something you’re able to implement yourself? I’m running a little low on time tonight, so I need to do something else. If you’re not able to do it yourself, I might look into it one of the next few days.