Giter Site home page Giter Site logo

Comments (3)

MaxKellermann avatar MaxKellermann commented on June 12, 2024

There's nothing "intelligent" about it. If MPD unescapes all %20 to a space, what happens with a file whose name really contains a "%20"? This potentially breaks existing playlists. Can you point me to the M3u specification which defines the escaping rules for the URIs contained therein?

from mpd.

kingosticks avatar kingosticks commented on June 12, 2024

For the URI case, the URI spec exists and defines percent encoding should be used and what to do for literal '%' characters. So if you know it's a URI then it's clear what to do.

The problem is, as Max knows, the M3U spec doesn't exist. Don't waste your time looking. You might consider RFC 8216 to be the closest thing but just using that would break some existing playlists. This is because M3U parsers generally support both URIs and bare file paths, but it's not trivial (or maybe even possible on some platforms?) to identify which you have. I think you could do something pretty sensible in most cases but maybe it's too complex.

Arguably mpd could have a "strict RFC 8216" option when parsing M3U files and treat everything as URIs. Alternatively you could post-process your M3U files but unless you can automate that it doesn't seem like a good solution.

from mpd.

kbridger avatar kbridger commented on June 12, 2024

Understood the spec isn't going to help. To brainstorm:

  • Could MPD try both interpretations, and use the one that resolves to a real file? Or both if it resolves to 2 files (which would be weird but possible I guess).
  • Could the user specify how to interpret it?

from mpd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.