Commit graph

11 commits

Author SHA1 Message Date
75206a97f1
Add extra for websockets support 2024-07-11 12:17:09 +10:00
60116fd616
Make PyObjC a Darwin-only dependency 2024-07-10 23:57:34 +10:00
27d8c37139
Significantly overhaul configuration management
Everything now uses bog-standard Python dataclasses, with Pydantic
providing validation and type conversion through separate classes using
its type adapter feature. It's also possible to define your classes
using Pydantic's own model type directly, making the type adapter
unnecessary, but I didn't want to do things that way because no actual
validation is needed when constructing a Song instance for example.
Having Pydantic do its thing only on-demand was preferable.

I tried a number of validation libraries before settling on Pydantic for
this. It's not the fastest option out there (msgspec is I think), but it
makes adding support for third-party types like yarl.URL really easy, it
generates a nice clean JSON Schema which is easy enough to adjust to my
requirements through its GenerateJsonSchema hooks, and raw speed isn't
all that important anyway since this is a single-user desktop program
that reads its configuration file once on startup.

Also, MessagePack is now mandatory if you're caching to an external
service. It just didn't make a whole lot sense to explicitly install
mpd-now-playable's Redis or Memcached support and then use pickling with
them.

With all this fussing around done, I'm probably finally ready to
actually use that configuration file to configure new features! Yay!
2024-07-01 00:10:17 +10:00
3b7ddfa718
fix: handle missing environment variables more robustly 2024-06-28 14:14:24 +10:00
1eca56b40e
Update Ruff and PyObjC versions 2024-06-23 17:32:10 +10:00
3cb5db7528
Add field descriptions to the config schema :) 2024-06-22 20:12:23 +10:00
dc037a0a4b
Support a TOML configuration file
The new config file currently only configures the same options that were
already available through environment variables. However I have ideas
for additional features that would be much nicer to support using a
structured configuration format like TOML rather than environment
variables, so config files exist now!

The previous environment variables are still supported and will be used
if you don't have a config file. I plan to keep supporting the MPD_HOST
and MPD_PORT environment variables forever since they're shared with
other MPD clients such as mpc, but I may eventually drop the environment
variables specific to mpd-now-playable in a future release.
2024-06-22 18:19:39 +10:00
c7773bf324
Allow installing persistent cache drivers for album art 2024-05-14 13:24:21 +10:00
5afeb32f9a
Update pdm.lock hashes for PDM 2.15.2 2024-05-09 12:51:40 +10:00
06cae0fc0a
Swap to aiocache because it's easier to use in custom ways 2023-11-27 15:39:53 +11:00
dae3e49783
Initial commit: set up project and dependencies 2023-11-27 10:39:10 +11:00