Commit graph

11 commits

Author SHA1 Message Date
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
f74bc9b6e5
Update README.md with caching info 2024-05-14 14:06:04 +10:00
8b5912bed2
Add PyPI package version badge to readme 2024-03-07 15:53:11 +11:00
54d2a6d415
Remove the temporary way to install from README.md 2023-12-06 14:33:33 +11:00
628ac9ae6a
Improve metadata for PyPI 2023-12-06 14:32:36 +11:00
06d9631445
Update README to note that seeking works :) 2023-12-06 13:55:10 +11:00
095c099a38
Use the same environment variables as mpc does 2023-12-06 11:42:50 +11:00
88a38a1bbd
Update pipx install instructions 2023-12-06 10:52:14 +11:00
ba7a46d8c5
Clarify install instructions 2023-11-27 18:05:40 +11:00
506b658782
Update README.md with documentation 2023-11-27 17:57:07 +11:00
dae3e49783
Initial commit: set up project and dependencies 2023-11-27 10:39:10 +11:00