25 Commits

Author SHA1 Message Date
f48506b1ca
generic: net return full response struct
This is still quite easy to stub, and the extra information is very
useful to the caller.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-19 21:36:33 +09:00
5fe911dd01
songs: represent autoplay as integer
This is represented in the same way as CID fields, so use the same data type.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-19 20:50:02 +09:00
8edf742aaa
cmd/msrserve: initial drop-in replacement server
This is still quite ugly and only meant to get things going for now, as
a proof of concept. It is usable though, and quite fast.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-19 01:18:28 +09:00
30599306f1
treewide: copy to address
This saves the unnecessary extra copy.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-18 23:37:09 +09:00
0999ccd211
cmd/msrfetch: preserve metadata order
The composite maps are no longer needed as the new Album variant makes
more sense than them. They are also unordered while the base variants of
both endpoints are ordered. Composite is therefore only used for
validation in the current implementation.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-18 21:56:45 +09:00
526a0371a4
song: zero fields for variants
Once again, helps remove code duplication and be more future-proof in
case any more variants are uncovered.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-18 20:38:53 +09:00
a63af7a4fb
album: zero fields for variants
This eliminates code duplication in some areas of the server.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-18 20:30:49 +09:00
b5f5626b02
album: extend struct for /api/album/%d/data
This also includes tests against a sample response from the
https://monster-siren.hypergryph.com/api/album/1030/data endpoint.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-18 19:29:23 +09:00
da4b1d86d9
cmd/msrfetch: fetch from enriched composite data
This creates a content-addressed store for all media files. It is not
yet usable but an API and cdn backend will be implemented from it in a
later commit, as well as tooling for export and tagging.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-18 07:20:36 +09:00
21871a387c
generic: return content length alongside body
This increases efficiency for bigger response bodies.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-18 06:06:52 +09:00
00b50dab08
cmd/msrfetch: save enriched compound data
This implementation of cmd/msrfetch is only temporary, used to fetch the
testdata. At this point we have all metadata present in the repo and all
that is left is to fetch the media.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-18 05:55:19 +09:00
343a8c5f45
generic: provide configured encoder
This encoder emits data identical to upstream API response body.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-18 04:53:12 +09:00
bb1164d081
song: enrich metadata from API
This should be the last of the API interactions we need.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-18 04:10:38 +09:00
d4789d958b
composite: flatten album and song data
This establishes relation between album and song.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-18 01:46:07 +09:00
2d6b87702d
generic: move StringInt padding to string method
This allows the implementation to be reused for url and filename
formatting in the downloader.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-17 08:02:18 +09:00
ea54772c03
song: struct for /api/song/%d
This also includes tests against a sample response from the
https://monster-siren.hypergryph.com/api/song/048794 endpoint.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-17 07:49:06 +09:00
c2c4171a3a
generic: emulate nullable string behaviour
This fills the gap for nullable strings returned by the API.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-17 07:47:57 +09:00
7dd470f9ae
generic: struct for response common fields
This is common across all responses.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-17 06:57:16 +09:00
033357459f
songs: struct for /api/songs
This also includes tests against a sample response from the
https://monster-siren.hypergryph.com/api/songs endpoint.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-17 06:41:57 +09:00
b001ef50aa
generic: pad for different lengths
This can be autodetected based on existing string.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-17 06:40:35 +09:00
2f34599823
generic: generalise json check
This code is shared for all json checks.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-17 06:33:11 +09:00
821e46d405
albums: struct for /api/albums
This also includes tests against a sample response from the
https://monster-siren.hypergryph.com/api/albums endpoint.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-17 06:15:59 +09:00
cc45f04800
generic: pad string representation
This replicates api behaviour.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-17 06:01:00 +09:00
5b9d1e4fe8
generic: parse string representation of integer
This makes the data easier to handle down the pipeline.

Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-17 05:41:40 +09:00
bddce42723
go: initialise go module
Signed-off-by: Yonah <contrib@gensokyo.uk>
2025-09-17 04:51:52 +09:00