Updates the technical documentation of the music library, the plugins, and the architecture decisions

This commit is contained in:
BinaryAlley committed 2026-10-06 11:30:00 +03:00
1 parent 012d702b17
commit bf8b49653d
26 files changed
+1836 -620

No files matched your search

+142 -28
View File
@@ -1,14 +1,15 @@
- [Lumina Domain](#lumina-domain)
- [Audio Library Aggregate](#audio-library-aggregate)
- [Music Library Aggregate](#music-library-aggregate)
- [Artist](#artist)
- [Album](#album)
- [Track](#track)
- [Audio Rating](#audio-rating)
# [Lumina Domain](#lumina-domain)
## [Audio Library Aggregate](#audio-library-aggregate)
## [Music Library Aggregate](#music-library-aggregate)
The audio library aggregate is the aggregate root of the `MusicLibrary` aggregate, which models the music of a media library. An artist is the aggregate root, owning its albums, and each album owns its tracks. Albums and tracks carry full metadata: title, description, release information, languages, genres and tags, and the tracks additionally carry the audio characteristics of their file, their moods and their ISRC codes. The media contributors that make up an artist, or that performed on an album or a track, are carried as `MusicMediaContributor` value objects.
The music library aggregate models the music of a media library. `Artist` is the aggregate root, owning its albums, and each album owns its tracks. Albums and tracks carry full metadata: title, description, release information, languages, genres and tags, and the tracks additionally carry the audio characteristics of their file, their moods and their ISRC codes. The media contributors that make up an artist, or that performed on an album or a track, are carried as `MusicMediaContributor` value objects.
### [Artist](#artist)
@@ -18,8 +19,25 @@ class Artist
Result<Artist> Create(
LibraryId libraryId,
string name,
Optional<string> sortName,
Optional<string> disambiguation,
Optional<MusicArtistType> type,
Optional<MusicArtistGender> gender,
Optional<string> country,
Optional<MusicArea> area,
Optional<MusicArea> beginArea,
Optional<MusicArea> endArea,
Optional<DateOnly> lifeSpanBegin,
Optional<DateOnly> lifeSpanEnd,
bool isEnded,
Optional<string> website,
Optional<MusicBrainzId> musicBrainzArtistId,
List<string> ipis,
List<string> isnis,
List<MusicArtistAlias> aliases,
List<Genre> genres,
List<Tag> tags,
List<AudioRating> ratings,
List<MusicMediaContributor> contributors,
List<Album> albums);
}
@@ -34,10 +52,58 @@ class Artist
"value": "00000000-0000-0000-0000-000000000000"
},
"name": "Queen",
"sortName": "Queen",
"disambiguation": null,
"type": "Group",
"gender": null,
"country": "GB",
"area": {
"musicBrainzAreaId": {
"value": "00000000-0000-0000-0000-000000000000"
},
"name": "United Kingdom",
"sortName": null,
"disambiguation": null,
"type": "Country",
"iso3166Code": "GB"
},
"beginArea": null,
"endArea": null,
"lifeSpanBegin": "1970-06-27",
"lifeSpanEnd": null,
"isEnded": false,
"website": "https://www.queenonline.com",
"musicBrainzArtistId": {
"value": "00000000-0000-0000-0000-000000000000"
},
"ipis": [],
"isnis": [],
"aliases": [
{
"name": "Queen",
"sortName": "Queen",
"type": "Artist name",
"locale": "en",
"isPrimary": true,
"beginDate": "1970-06-27",
"endDate": null,
"isEnded": false
}
],
"genres": [
{ "name": "Rock" }
],
"tags": [
{ "name": "classic" }
],
"ratings": [
{
"value": 4.5,
"maxValue": 5,
"source": "MusicBrainz",
"voteCount": 2345
}
],
"contributors": [],
"albums": [
{
@@ -54,9 +120,14 @@ class Album
{
Result<Album> Create(
AlbumMetadata metadata,
Optional<string> disambiguation,
Optional<MusicMediaFormat> mediaFormat,
Optional<MusicReleasePackaging> packaging,
Optional<string> script,
Optional<Barcode> barcode,
Optional<string> catalogNumber,
List<string> catalogNumbers,
Optional<string> label,
Optional<string> asin,
Optional<MusicBrainzId> musicBrainzReleaseId,
Optional<MusicBrainzId> musicBrainzReleaseGroupId,
Optional<MusicBrainzId> musicBrainzReleaseArtistId,
@@ -74,6 +145,7 @@ class Album
"metadata": {
"title": "A Night at the Opera",
"originalTitle": "A Night at the Opera",
"releaseTitle": "A Night at the Opera",
"description": "The fourth studio album by the British rock band Queen, released in 1975. It was the most expensive album ever recorded at the time of its release.",
"releaseInfo": {
"originalReleaseDate": "1975-11-21",
@@ -101,16 +173,21 @@ class Album
"languageName": "English",
"nativeName": "English"
},
"releaseType": "Album",
"releaseTypes": [ "Album" ],
"releaseStatus": "Official",
"totalDiscs": 1,
"totalTracks": 12
},
"disambiguation": null,
"mediaFormat": "CD",
"packaging": "JewelCase",
"script": "Latn",
"barcode": {
"value": "0042282778329"
},
"catalogNumber": "EMC 4008",
"catalogNumbers": ["EMC 4008"],
"label": "EMI",
"asin": "B000000000",
"musicBrainzReleaseId": {
"value": "00000000-0000-0000-0000-000000000000"
},
@@ -149,20 +226,20 @@ class Album
class Track
{
Result<Track> Create(
LibraryId libraryId,
string path,
AudioMetadata metadata,
Optional<string> disambiguation,
int trackNumber,
Optional<int> discNumber,
List<Isrc> isrcs,
List<Mood> moods,
Optional<string> script,
Optional<MusicKey> key,
Optional<int> bpm,
List<Mood> moods,
Optional<string> work,
bool isVideo,
List<Isrc> isrcs,
Optional<MusicWork> work,
Optional<MusicBrainzId> musicBrainzRecordingId,
Optional<MusicBrainzId> musicBrainzTrackId,
Optional<MusicBrainzId> musicBrainzWorkId,
List<MusicMediaContributor> contributors,
List<AudioRating> ratings);
}
@@ -173,9 +250,6 @@ class Track
"id": {
"value": "00000000-0000-0000-0000-000000000000"
},
"libraryId": {
"value": "00000000-0000-0000-0000-000000000000"
},
"path": "/music/queen/a-night-at-the-opera/01-bohemian-rhapsody.flac",
"metadata": {
"title": "Bohemian Rhapsody",
@@ -212,32 +286,50 @@ class Track
"channels": 2,
"bitDepth": 16,
"audioCodec": "FLAC",
"bitrate": 980
"bitrate": 980,
"acoustId": "f0e1d2c3-b4a5-4c6d-8e7f-9a0b1c2d3e4f",
"replayGainTrackGain": -7.5,
"replayGainTrackPeak": 0.9877,
"replayGainAlbumGain": -6.8,
"replayGainAlbumPeak": 0.9999
},
"disambiguation": null,
"trackNumber": 1,
"discNumber": 1,
"isrcs": [
{
"value": "GBUM71029604"
}
],
"script": "Latn",
"key": "CMajor",
"bpm": 72,
"moods": [
{ "name": "dramatic" },
{ "name": "anxious" }
],
"work": "Bohemian Rhapsody",
"isVideo": false,
"work": {
"musicBrainzWorkId": {
"value": "00000000-0000-0000-0000-000000000000"
},
"title": "Bohemian Rhapsody",
"type": "Song",
"languages": [
{
"languageCode": "en",
"languageName": "English",
"nativeName": "English"
}
],
"iswcs": []
},
"musicBrainzRecordingId": {
"value": "00000000-0000-0000-0000-000000000000"
},
"musicBrainzTrackId": {
"value": "00000000-0000-0000-0000-000000000000"
},
"musicBrainzWorkId": {
"value": "00000000-0000-0000-0000-000000000000"
},
"moods": [
{ "name": "dramatic" },
{ "name": "anxious" }
],
"isrcs": [
{
"value": "GBUM71029604"
}
],
"contributors": [],
"ratings": [
{
@@ -249,3 +341,25 @@ class Track
]
}
```
### [Audio Rating](#audio-rating)
The rating of a music media element derives from the common `Rating` value object and adds the source the rating came from.
```csharp
class AudioRating : Rating
{
Result<AudioRating> Create(decimal value, decimal maxValue, Optional<AudioRatingSource> source, Optional<int> voteCount);
}
```
```json
{
"value": 9.3,
"maxValue": 10.0,
"source": "MusicBrainz",
"voteCount": 84
}
```
`AudioRatingSource` is `User`, `MusicBrainz`, `Discogs` or `LastFm`.
+23 -11
View File
@@ -4,6 +4,7 @@
- [Genre](#genre)
- [Tag](#tag)
- [Rating](#rating)
- [Mood](#mood)
- [Release Info](#release-info)
- [Language Info](#language-info)
@@ -18,7 +19,7 @@
```csharp
class Genre
{
ErrorOr<Genre> Create(string name);
Result<Genre> Create(string name);
}
```
@@ -33,7 +34,7 @@ class Genre
```csharp
class Tag
{
ErrorOr<Tag> Create(string name);
Result<Tag> Create(string name);
}
```
@@ -45,19 +46,30 @@ class Tag
#### [Rating](#rating)
`Rating` is the abstract base of the ratings of media elements. It carries the numeric value, its maximum and an optional vote count, but no factory of its own, because the concrete ratings of each media type derive from it and add their own source. The rating of the audio library context, `AudioRating` with its `AudioRatingSource`, is documented alongside the music library aggregate.
```csharp
class Rating
abstract class Rating
{
ErrorOr<Rating> Create(decimal value, decimal maxValue, Optional<RatingSource> source = default, Optional<int> voteCount = default);
decimal Value { get; }
decimal MaxValue { get; }
Optional<int> VoteCount { get; }
decimal AsPercentage();
}
```
#### [Mood](#mood)
```csharp
class Mood
{
Result<Mood> Create(string name);
}
```
```json
{
"value": 9.3,
"maxValue": 10.0,
"source": "Imdb",
"voteCount": 84
"name": "dramatic"
}
```
@@ -66,8 +78,8 @@ class Rating
```csharp
class ReleaseInfo
{
ErrorOr<ReleaseInfo> Create(Optional<DateOnly> originalReleaseDate, Optional<int> originalReleaseYear,
Optional<DateOnly> reReleaseDate, Optional<int> reReleaseYear, Optional<string> releaseCountry, Optional<string> releaseVersion);
Result<ReleaseInfo> Create(Optional<DateOnly> originalReleaseDate, Optional<int> originalReleaseYear,
Optional<DateOnly> reReleaseDate, Optional<int> reReleaseYear, Optional<ReleaseCountry> releaseCountry, Optional<string> releaseVersion);
}
```
@@ -97,4 +109,4 @@ class LanguageInfo
"languageName": "French",
"nativeName": "Française",
}
```
```
+18 -2
View File
@@ -1,7 +1,23 @@
<span style="color: #FF0000;">Domain</span>
├── <span style="color: #004BFF;">Audio Library Bounded Context</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└── <span style="color: #F589DD;">Audio Library Aggregate</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└── <span style="color: #BDE180;">Audio Metadata</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└── <span style="color: #F589DD;">Music Library Aggregate</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Artist Id</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Album Id</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Track Id</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Music Media Contributor</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Music Brainz Id</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Music Area</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Music Artist Alias</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Music Work</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Isrc</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Barcode</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Album Metadata</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Audio Metadata</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Audio Rating</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #80B0E0;">Album</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #80B0E0;">Track</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #FEB423;">Music Library Type Scanner</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└── <span style="color: #B46DD4;">Artist</span>
├── <span style="color: #004BFF;">Video Library Bounded Context</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #F589DD;">Movie Library Aggregate</span>
│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├── <span style="color: #BDE180;">Movie Id</span>
+22 -26
View File
@@ -28,19 +28,10 @@
- _**Music Video**_: A video representation of a song
## Audio Content
- _**Song**_: An individual music track
- _**Album**_: A collection of songs
- _**Artist**_: The creator of music content
- _**Audiobook**_: A narrated version of a book
- _**Live Recording**_: Audio or video of a live performance
- _**Interview**_: Audio or video recording of a conversation
- _**Cover Song**_: A rendition of a song performed by an artist other than the original
- _**Remix**_: A modified version of an original song
- _**Sound Effect**_: A short audio clip used for specific purposes
- _**Soundtrack**_: A collection of music used in a film or TV show
- _**Podcast**_: A series of audio episodes
- _**Podcast Episode**_: An individual installment of a podcast
- _**Radio Show**_: An audio program broadcast on the radio
- _**Track**_: An individual music track, the smallest unit of music in a music library (the entity is named Track, not Song)
- _**Album**_: A release that gathers the tracks of an artist
- _**Artist**_: The creator of music content, the root of the music library aggregate
- _**MusicReleaseType**_: The set of content types a music release can carry, like Album, Single, Ep, Compilation, AudioBook, Interview, Live, Remix, Soundtrack or SpokenWord
## Written Content
- _**Book**_: A standalone written work
@@ -79,15 +70,9 @@
- Anime
- YouTubeVideo
- MusicVideo
- Song
- Track
- Album
- Artist
- Audiobook
- LiveRecording
- Interview
- CoverSong
- Remix
- SoundEffect
- Podcast
- PodcastEpisode
- Book
@@ -118,7 +103,7 @@
## Aggregates
- VideoLibrary (root: VideoLibrary, entities: TVShow, Season, Episode, Movie, FilmSeries, ConcertVideo, Documentary, TutorialVideo, HomeVideo, Anime, YouTubeVideo, MusicVideo)
- AudioLibrary (root: AudioLibrary, entities: Song, Album, Artist, Audiobook, LiveRecording, Interview, CoverSong, Remix, SoundEffect)
- MusicLibrary (root: Artist, entities: Album, Track)
- PodcastLibrary (root: PodcastLibrary, entities: Podcast, PodcastEpisode)
- WrittenContentLibrary (root: WrittenContentLibrary, entities: Book, EBook, BookSeries, ComicBook, ComicSeries, Magazine, MagazineIssue, Newspaper, Manga, GraphicNovel, AcademicPaper, SheetMusic, Screenplay)
- PhotoLibrary (root: PhotoLibrary, entities: Photo, PhotoAlbum, AlbumArtwork, MoviePoster)
@@ -175,14 +160,25 @@
- StreamInfo
- StreamingQuality
- UserPreferences
- Rating
- Rating (abstract)
- AudioRating
- Genre
- Mood
- ReleaseInfo
- LanguageInfo
- AlbumMetadata
- MusicMediaContributor
- MusicBrainzId
- MusicArea
- MusicArtistAlias
- MusicWork
- Isrc
- Barcode
## Domain Services
- MediaScanner (with specialized scanners for each media type)
- MetadataFetcher (with different strategies for various media types and sources)
- Music Library Type Scanner
- Music File System Discovery Job
- Music Metadata Extraction Job
- TranscodingService
- StreamingService
- AudiobookPlaybackService
@@ -216,8 +212,8 @@
## Bounded Contexts
- MediaManagement
- Aggregates: VideoLibrary, AudioLibrary, PodcastLibrary, WrittenContentLibrary, PhotoLibrary
- Services: MediaScanner, MetadataFetcher, TranscodingService
- Aggregates: VideoLibrary, MusicLibrary, PodcastLibrary, WrittenContentLibrary, PhotoLibrary
- Services: Music Library Type Scanner, Music File System Discovery Job, Music Metadata Extraction Job
- UserExperience
- Aggregates: UserProfile
- Services: RecommendationEngine, ContentCurationService, UserActivityTrackingService