You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add capabilities caching API examples (loadCapabilities, KnownExtension),
getLyricsBySongId usage example, updated endpoint table, and full v0.7.0
CHANGELOG entry covering all new types, fields, and public inits.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,47 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
---
9
9
10
+
## [0.7.0] — 2026-05-04
11
+
12
+
### Added
13
+
14
+
-**OpenSubsonic server identification** — `ServerCapabilities` now exposes `serverType` and `serverVersion` populated from the `type` / `serverVersion` fields returned by OpenSubsonic-compliant servers (Navidrome, gonic, …).
15
+
16
+
-**`KnownExtension` enum** — compile-time–safe identifiers for every OpenSubsonic extension defined in the spec (`songLyrics`, `apiKeyAuthentication`, `playbackReport`, `transcodeOffset`, `formPost`, `indexBasedQueue`, `sonicSimilarity`, `transcoding`, `getPodcastEpisode`). Use `caps.supports(.songLyrics)` instead of the stringly-typed overload.
17
+
18
+
-**`ServerCapabilities.extensionList`** — computed property that derives a `[OpenSubsonicExtension]` array from the extensions dictionary, matching the shape returned by `getOpenSubsonicExtensions()`.
19
+
20
+
-**`ServerCapabilities.legacy()`** — factory that creates a non-OpenSubsonic capability snapshot with empty extensions, useful as a safe default when `fetchCapabilities()` has not been called.
21
+
22
+
-**`ServerCapabilities` public init** — all five fields are now constructible from outside the module, enabling consumer-side mocking and testing.
23
+
24
+
-**`loadCapabilities()`** — lazy capability accessor on `SwiftSonicClient`. Fetches from the server on first call; returns the cached value on all subsequent calls. `@discardableResult`.
25
+
26
+
-**`refreshCapabilities()`** — forces a new `fetchCapabilities()` pass and updates the cached `serverCapabilities` property. Use after re-authentication or when you suspect the server configuration has changed. `@discardableResult`.
27
+
28
+
-**`getLyricsBySongId(id:)`** — implements the OpenSubsonic `songLyrics` extension. Returns a `LyricsList` containing an array of `StructuredLyrics` sets, each with a language code, sync flag, optional display metadata, and an array of `Line` values (with optional millisecond `start` timestamps for synced lyrics).
29
+
30
+
-**New model types** (`Lyrics.swift`):
31
+
-`LyricsList` — top-level container; `structuredLyrics` defaults to `[]` when absent from the response.
32
+
-`StructuredLyrics` — one language set; fields `lang`, `synced`, `line`, `displayArtist`, `displayTitle`, `offset`.
33
+
-`Line` — a single lyric line; `value` (String) + optional `start` (Int, milliseconds).
34
+
35
+
-**`OpenSubsonicExtension` public init** — `init(name:versions:)` is now public.
36
+
37
+
-**Public inits for all `SharedModels` types** — `ItemGenre`, `ReplayGain`, `ItemDate`, `DiscTitle`, `RecordLabel`, `ContributorArtist`, and `Contributor` all gain public memberwise initialisers with `nil` defaults on optional fields.
38
+
39
+
-**OpenSubsonic fields on `Song`** — `mediaType: String?` and `displayComposer: String?` added to `Song` and its public init (both default to `nil`).
40
+
41
+
-**OpenSubsonic fields on `AlbumID3`** — `explicitStatus: String?` and `version: String?` added to `AlbumID3` and its public init (both default to `nil`).
42
+
43
+
-**Test count** — test suite grows from 296 to ~370 tests across new suites covering capabilities caching, `KnownExtension`, `getLyricsBySongId` decoding (synced, unsynced, multi-language, empty), and all new public inits.
44
+
45
+
### Notes
46
+
47
+
All changes are additive; no breaking changes from v0.6.x. The new `loadCapabilities()` / `refreshCapabilities()` methods complement the existing `fetchCapabilities()` + `serverCapabilities` property pair — choose whichever pattern suits your architecture.
0 commit comments