Skip to content

Lua function to pretty print JSON, perhaps an optional arg for utils.format_json()? #17241

@MoltenMonster

Description

@MoltenMonster

Expected behavior of the wanted feature

I'm pretty printing JSON to a file using dkjson since MPV doesn't have a built-in function for it. Example:

{
  "video name":{
    "firstwatched":1767796909,
    "endtime":"5.528",
    "lastwatched":1767796909,
    "starttime":"0",
    "watchcount":1
  }
}

A function would be nice so I wouldn't need a module (just 1) in my script. Perhaps an optional 2nd arg could be added to utils.format_json(): a bool for if it should be pretty printed.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions