- [Lumina Domain](#lumina-domain) - [Audio Library Aggregate](#audio-library-aggregate) - [Artist](#artist) - [Album](#album) - [Track](#track) # [Lumina Domain](#lumina-domain) ## [Audio Library Aggregate](#audio-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. ### [Artist](#artist) ```csharp class Artist { Result Create( LibraryId libraryId, string name, Optional website, Optional musicBrainzArtistId, List contributors, List albums); } ``` ```json { "id": { "value": "00000000-0000-0000-0000-000000000000" }, "libraryId": { "value": "00000000-0000-0000-0000-000000000000" }, "name": "Queen", "website": "https://www.queenonline.com", "musicBrainzArtistId": { "value": "00000000-0000-0000-0000-000000000000" }, "contributors": [], "albums": [ { "value": "00000000-0000-0000-0000-000000000000" } ] } ``` ### [Album](#album) ```csharp class Album { Result Create( AlbumMetadata metadata, Optional mediaFormat, Optional barcode, Optional catalogNumber, Optional musicBrainzReleaseId, Optional musicBrainzReleaseGroupId, Optional musicBrainzReleaseArtistId, List contributors, List ratings, List tracks); } ``` ```json { "id": { "value": "00000000-0000-0000-0000-000000000000" }, "metadata": { "title": "A Night at the Opera", "originalTitle": "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", "originalReleaseYear": 1975, "reReleaseDate": null, "reReleaseYear": null, "releaseCountry": "GB", "releaseVersion": "Remastered" }, "genres": [ { "name": "Rock" }, { "name": "Progressive Rock" } ], "tags": [ { "name": "classic" }, { "name": "vinyl" } ], "language": { "languageCode": "en", "languageName": "English", "nativeName": "English" }, "originalLanguage": { "languageCode": "en", "languageName": "English", "nativeName": "English" }, "releaseType": "Album", "releaseStatus": "Official", "totalDiscs": 1, "totalTracks": 12 }, "mediaFormat": "CD", "barcode": { "value": "0042282778329" }, "catalogNumber": "EMC 4008", "musicBrainzReleaseId": { "value": "00000000-0000-0000-0000-000000000000" }, "musicBrainzReleaseGroupId": { "value": "00000000-0000-0000-0000-000000000000" }, "musicBrainzReleaseArtistId": { "value": "00000000-0000-0000-0000-000000000000" }, "contributors": [], "ratings": [ { "value": 4.5, "maxValue": 5, "source": "MusicBrainz", "voteCount": 2345 }, { "value": 4.8, "maxValue": 5, "source": "LastFm", "voteCount": 1234 } ], "tracks": [ { "value": "00000000-0000-0000-0000-000000000000" } ] } ``` ### [Track](#track) ```csharp class Track { Result Create( LibraryId libraryId, string path, AudioMetadata metadata, int trackNumber, Optional discNumber, List isrcs, Optional script, Optional key, Optional bpm, List moods, Optional work, Optional musicBrainzRecordingId, Optional musicBrainzTrackId, Optional musicBrainzWorkId, List contributors, List ratings); } ``` ```json { "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", "originalTitle": "Bohemian Rhapsody", "description": "A song by the British rock band Queen. It was written by Freddie Mercury and originally released on the album A Night at the Opera in 1975.", "releaseInfo": { "originalReleaseDate": "1975-10-31", "originalReleaseYear": 1975, "reReleaseDate": null, "reReleaseYear": null, "releaseCountry": "GB", "releaseVersion": "Original" }, "genres": [ { "name": "Rock" }, { "name": "Progressive Rock" } ], "tags": [ { "name": "classic" }, { "name": "epic" } ], "language": { "languageCode": "en", "languageName": "English", "nativeName": "English" }, "originalLanguage": { "languageCode": "en", "languageName": "English", "nativeName": "English" }, "durationInSeconds": 354, "sampleRate": 44100, "channels": 2, "bitDepth": 16, "audioCodec": "FLAC", "bitrate": 980 }, "trackNumber": 1, "discNumber": 1, "isrcs": [ { "value": "GBUM71029604" } ], "script": "Latn", "key": "CMajor", "bpm": 72, "moods": [ { "name": "dramatic" }, { "name": "anxious" } ], "work": "Bohemian Rhapsody", "musicBrainzRecordingId": { "value": "00000000-0000-0000-0000-000000000000" }, "musicBrainzTrackId": { "value": "00000000-0000-0000-0000-000000000000" }, "musicBrainzWorkId": { "value": "00000000-0000-0000-0000-000000000000" }, "contributors": [], "ratings": [ { "value": 4.5, "maxValue": 5, "source": "MusicBrainz", "voteCount": 2345 } ] } ```