Commit graph

10 commits

Author SHA1 Message Date
bc56686fc4
Support multivalued song tags (fixes #1)
python-mpd2 unreliably returns either a single value or a list of
values for commands like currentsong, which is super fun if you're
trying to write type stubs for it that statically describe its
behaviour. Whee.

Anyway, I ended up changing my internal song model to always use lists
for tags like artist and genre which are likely to have multiple values.
There's some finagling involved in massaging python-mpd2's output into
lists every time. However it's much nicer to work with an object that
always has a list of artists, even if it's a list of one or zero
artists, rather than an object that can have a single artist, a list of
multiple artists, or a null. So it's worth it.

The MPNowPlayingInfoCenter in MacOS only works with single string values
for these tags, not lists, so we have to join the artists and such into
a single string for its consumption. I'm using commas for the separator
at the moment, but I may make this a config option later on if there's
interest.
2024-06-23 17:24:37 +10:00
2def2aece5
Organise 'tools' modules into a subpackage 2024-06-22 18:48:32 +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
fd7866ed14
Try both readpicture and albumart, prefer the former 2024-05-17 19:46:10 +10:00
8ad255856e
Extend cache TTL now external caches are supported 2024-05-14 16:07:43 +10:00
4a2ac29d30
Use more conventional Redis key separators for album cache 2024-05-14 15:09:20 +10:00
55d82c72c3
Support MPD_NOW_PLAYABLE_CACHE setting (Redis or Memcached) 2024-05-14 13:25:13 +10:00
1caf4a184c
Cache 'no artwork', rather than repeatedly populating the cache with None 2024-05-09 12:12:54 +10:00
ffc399290f
Safely cache artwork for tracks without expected tags 2023-12-02 14:47:50 +11:00
a673f2ef90
Initial commit of source - working, but needs stubs for Cocoa 2023-11-27 15:49:33 +11:00