mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 16:11:10 +00:00
Updates the technical documentation of the music library, the plugins, and the architecture decisions
This commit is contained in:
1 parent
012d702b17
commit
bf8b49653d
26 files changed
+1836
-620
No files matched your search
@@ -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`.
|
||||
Reference in new issue
Block a user