Skip to content

Can the functions passed to psflib be modified such that the plugin still works for e.g. zip files? #16

@joshbarrass

Description

@joshbarrass

DeaDBeeF has a built-in plugin that allows music to be played directly from a zip file, rather than having to extract that file. This works fine for conventional, self-contained formats, but breaks for this format, I believe due to us being unable to open the psflib file. Is there any way that we could modify the functions we pass to psflib for opening files, etc. to fix this?

I'm not 100% on how this would be done, as I don't fully understand the workings of psflib or DeaDBeeF's file APIs, but I expect it may require us to extract the protocol, directory, etc. manually and have our file opening function prepend this to files that don't specify any. This way, we may be able to modify psflib's request to open the psflib file (e.g. calling open for file "lib.psflib") to add in the necessary bits ourselves before we pass this on to DeaDBeeF. i.e.:

  1. psflib requests we open "lib.psflib"
  2. As there is no directory, protocol, etc., we add this ourselves based on what we know (perhaps we can obtain this from the last URI opened, or could maybe use some higher order function magic to curry this into the function call -- the exact workings of this are to be determined)
  3. This modified URI, e.g. "zipfile:///lib.psflib" is passed to DeaDBeeF's open function, which handles opening of the file as normal.
  4. "Normal" requests (e.g. opening regular files) should not be broken by this. Perhaps we could attempt to open the file without any intervention, and then only modify the URI if this fails? If it then fails again, even after our intervention, we report an error as usual.

If there are any external ideas on whether this would actually work to enable this functionality, suggestions on how this could be implemented, or anything else, let me know. Otherwise I will probably just work on this myself as a low-priority issue when I get a chance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions