8000 Improved compliance to the XDG Base Directory Specification · Issue #46 · dhonus/jellyfin-tui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Improved compliance to the XDG Base Directory Specification #46
Closed
@throwaway-lmao

Description

@throwaway-lmao

I appreciate the work put into using the environment variables defined by the XDG Base Directory Specification, but I've noticed the data files for the application are placed somewhat oddly.

Generally, applications should expect that nothing in $XDG_CACHE_HOME is permanent. If it'd like to store persistent data, it should prefer $XDG_DATA_HOME or $XDG_STATE_HOME. From my understanding, the former is for data users might actually find important (i.e. preferences), while the latter is for whatever else (i.e. logs, layouts).

Unfortunately, when I went to regularly clear out my caches, I ended up deleting ~300 songs D:

I have limited understanding of what all the files this application uses do, but from my best guesses, I propose the following setup:

* $XDG_CONFIG_HOME
  * config.yaml
* $XDG_DATA_HOME
  * preferences.json
  * server_map.json
* $XDG_STATE_HOME
  * databases
  * downloads
  * log
* $XDG_CACHE_HOME
  * covers
  * states
* $XDG_RUNTIME_DIR
  * jellyfin-tui.lock

Some of these are definitely debatable, so I'm not dead set on this exact layout. The main one is the placement of cover images. I put them into the cache, while songs went in state, because my covers take ~30MiB total, while the ~300 songs I have downloaded take ~11GiB. I could see them being placed in the state directory to save some bandwidth, although it doesn't affect me at all if I have to download them again.

It may go without saying that I do not wish to redownload tens of gibibytes of data repeatedly, though, so at the bare minimum I hope songs get moved into XDG_STATEHOME, if possible.

Briefly skimming the code, it doesn't seem like this would be a terribly difficult change, so I may be able to make a PR for this when I get some time (if my limited Rust knowledge permits). Let me know if a different layout is preferred.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0