mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-01 18:57:24 +00:00
Merge pull request #193 from BinaryAlley/feature/implement-crud-endpoints-for-artist-album-track
Feature/implement crud endpoints for artist album track
This commit is contained in:
1540 files changed
+116120
-16052
No files matched your search
@@ -0,0 +1,36 @@
|
||||
# Lumina API
|
||||
|
||||
- [Lumina API](#lumina-api)
|
||||
- [Permissions](#permissions)
|
||||
- [Get Permissions](#get-permissions)
|
||||
- [Get Permissions Request](#get-permissions-request)
|
||||
- [Get Permissions Response](#get-permissions-response)
|
||||
|
||||
## Permissions
|
||||
|
||||
### Get Permissions
|
||||
|
||||
#### Get Permissions Request
|
||||
|
||||
```js
|
||||
GET api/v1/auth/permissions
|
||||
```
|
||||
|
||||
#### Get Permissions Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "5264e3a8-bdec-4ec0-9423-839f3a9afe4b",
|
||||
"permissionName": "CanDeleteUsers"
|
||||
},
|
||||
{
|
||||
"id": "7830cd55-3585-4da1-bfad-994be8637da8",
|
||||
"permissionName": "CanViewUsers"
|
||||
}
|
||||
]
|
||||
```
|
||||
@@ -0,0 +1,182 @@
|
||||
# Lumina API
|
||||
|
||||
- [Lumina API](#lumina-api)
|
||||
- [Roles](#roles)
|
||||
- [Get Roles](#get-roles)
|
||||
- [Get Roles Request](#get-roles-request)
|
||||
- [Get Roles Response](#get-roles-response)
|
||||
- [Get Role Permissions](#get-role-permissions)
|
||||
- [Get Role Permissions Request](#get-role-permissions-request)
|
||||
- [Get Role Permissions Response](#get-role-permissions-response)
|
||||
- [Add Role](#add-role)
|
||||
- [Add Role Request](#add-role-request)
|
||||
- [Add Role Response](#add-role-response)
|
||||
- [Update Role](#update-role)
|
||||
- [Update Role Request](#update-role-request)
|
||||
- [Update Role Response](#update-role-response)
|
||||
- [Delete Role](#delete-role)
|
||||
- [Delete Role Request](#delete-role-request)
|
||||
- [Delete Role Response](#delete-role-response)
|
||||
|
||||
## Roles
|
||||
|
||||
### Get Roles
|
||||
|
||||
#### Get Roles Request
|
||||
|
||||
```js
|
||||
GET api/v1/auth/roles
|
||||
```
|
||||
|
||||
#### Get Roles Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "776e440d-39d2-4f31-8dcd-481de61e8792",
|
||||
"roleName": "Admin"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
### Get Role Permissions
|
||||
|
||||
#### Get Role Permissions Request
|
||||
|
||||
```js
|
||||
GET api/v1/auth/roles/{roleId}/permissions
|
||||
```
|
||||
|
||||
#### Get Role Permissions Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"role": {
|
||||
"id": "61567253-c752-4680-989c-a40a73f3e4b9",
|
||||
"roleName": "Editor"
|
||||
},
|
||||
"permissions": [
|
||||
{
|
||||
"id": "5264e3a8-bdec-4ec0-9423-839f3a9afe4b",
|
||||
"permissionName": "CanDeleteUsers"
|
||||
},
|
||||
{
|
||||
"id": "7830cd55-3585-4da1-bfad-994be8637da8",
|
||||
"permissionName": "CanViewUsers"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Add Role
|
||||
|
||||
#### Add Role Request
|
||||
|
||||
```js
|
||||
POST api/v1/auth/roles
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"roleName": "Editor",
|
||||
"permissions": [
|
||||
"7934ff13-1ccd-4c24-bab3-6423c905e249",
|
||||
"8f23e43a-bb4b-483a-99eb-7ab361df7482"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Add Role Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"role": {
|
||||
"id": "e5b67972-6928-4be1-a757-e98879d4a12a",
|
||||
"roleName": "Editor"
|
||||
},
|
||||
"permissions": [
|
||||
{
|
||||
"id": "7934ff13-1ccd-4c24-bab3-6423c905e249",
|
||||
"permissionName": "CanDeleteUsers"
|
||||
},
|
||||
{
|
||||
"id": "8f23e43a-bb4b-483a-99eb-7ab361df7482",
|
||||
"permissionName": "CanViewUsers"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Update Role
|
||||
|
||||
#### Update Role Request
|
||||
|
||||
```js
|
||||
PUT api/v1/auth/roles
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"roleId": "73d204e2-5922-441d-83d8-8d4d8fc29eaa",
|
||||
"roleName": "Editor",
|
||||
"permissions": [
|
||||
"ac113d18-69bb-4162-8c05-ff7a5559059a",
|
||||
"3c2fd936-8d4a-4963-b237-9f8d3aeeab26"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Update Role Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"role": {
|
||||
"id": "61567253-c752-4680-989c-a40a73f3e4b9",
|
||||
"roleName": "Editor"
|
||||
},
|
||||
"permissions": [
|
||||
{
|
||||
"id": "5264e3a8-bdec-4ec0-9423-839f3a9afe4b",
|
||||
"permissionName": "CanDeleteUsers"
|
||||
},
|
||||
{
|
||||
"id": "7830cd55-3585-4da1-bfad-994be8637da8",
|
||||
"permissionName": "CanViewUsers"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Delete Role
|
||||
|
||||
#### Delete Role Request
|
||||
|
||||
```js
|
||||
DELETE api/v1/auth/roles/{roleId}
|
||||
```
|
||||
|
||||
#### Delete Role Response
|
||||
|
||||
```js
|
||||
204 No Content
|
||||
```
|
||||
@@ -16,7 +16,7 @@
|
||||
##### Get Directories Request
|
||||
|
||||
```js
|
||||
GET api/v1/directories/get-directories?path=C%3A%5CUsers%5C&includeHiddenElements=true
|
||||
GET api/v1/directories/get-directories?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true
|
||||
```
|
||||
|
||||
##### Get Directories Response
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
##### Get Files Request
|
||||
|
||||
```js
|
||||
GET api/v1/files/get-files?path=C%3A%5CUsers%5C&includeHiddenElements=true
|
||||
GET api/v1/files/get-files?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true
|
||||
```
|
||||
|
||||
##### Get Files Response
|
||||
@@ -52,7 +52,7 @@ GET api/v1/files/get-files?path=C%3A%5CUsers%5C&includeHiddenElements=true
|
||||
##### Get Tree Files Request
|
||||
|
||||
```js
|
||||
GET api/v1/files/get-tree-files?path=C%3A%5CUsers%5C&includeHiddenElements=true
|
||||
GET api/v1/files/get-tree-files?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true
|
||||
```
|
||||
|
||||
##### Get Tree Files Response
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
##### Check Path Exists Request
|
||||
|
||||
```js
|
||||
GET api/v1/path/check-path-exists?path=C%3A%5CUsers%5C&includeHiddenElements=true
|
||||
GET api/v1/path/check-path-exists?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true
|
||||
```
|
||||
|
||||
##### Check Path Exists Response
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,446 @@
|
||||
# Lumina API
|
||||
|
||||
- [Lumina API](#lumina-api)
|
||||
- [Track](#track)
|
||||
- [Add Track](#add-track)
|
||||
- [Add Track Request](#add-track-request)
|
||||
- [Add Track Response](#add-track-response)
|
||||
- [Get Track](#get-track)
|
||||
- [Get Track Request](#get-track-request)
|
||||
- [Get Track Response](#get-track-response)
|
||||
- [Update Track](#update-track)
|
||||
- [Update Track Request](#update-track-request)
|
||||
- [Update Track Response](#update-track-response)
|
||||
- [Delete Track](#delete-track)
|
||||
|
||||
## Track
|
||||
|
||||
### Add Track
|
||||
|
||||
#### Add Track Request
|
||||
|
||||
```js
|
||||
POST api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/tracks
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"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.",
|
||||
"durationInSeconds": 354,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 980,
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1975-10-31",
|
||||
"originalReleaseYear": 1975,
|
||||
"reReleaseDate": null,
|
||||
"reReleaseYear": null,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "Original"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Progressive Rock" }
|
||||
],
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "epic" }
|
||||
]
|
||||
},
|
||||
"trackNumber": 1,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "CMajor",
|
||||
"bpm": 72,
|
||||
"work": "Bohemian Rhapsody",
|
||||
"musicBrainzRecordingId": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
|
||||
"musicBrainzTrackId": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
|
||||
"musicBrainzWorkId": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
|
||||
"moods": [
|
||||
{ "name": "dramatic" },
|
||||
{ "name": "anxious" }
|
||||
],
|
||||
"isrcs": [
|
||||
{ "value": "GBUM71029604" }
|
||||
],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Vocals" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Guitar" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Add Track Response
|
||||
|
||||
```js
|
||||
201 Created
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f",
|
||||
"albumId": "e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f",
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"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" },
|
||||
"language": { "languageCode": "en", "languageName": "English", "nativeName": "English" },
|
||||
"originalLanguage": { "languageCode": "en", "languageName": "English", "nativeName": "English" },
|
||||
"tags": [ { "name": "classic" }, { "name": "epic" } ],
|
||||
"genres": [ { "name": "Rock" }, { "name": "Progressive Rock" } ],
|
||||
"durationInSeconds": 354,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 980
|
||||
},
|
||||
"trackNumber": 1,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "CMajor",
|
||||
"bpm": 72,
|
||||
"work": "Bohemian Rhapsody",
|
||||
"musicBrainzRecordingId": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
|
||||
"musicBrainzTrackId": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
|
||||
"musicBrainzWorkId": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
|
||||
"createdOnUtc": "2025-01-01T12:00:00.0000000Z",
|
||||
"updatedOnUtc": null,
|
||||
"moods": [
|
||||
{
|
||||
"name": "dramatic"
|
||||
},
|
||||
{
|
||||
"name": "anxious"
|
||||
}
|
||||
],
|
||||
"isrcs": [
|
||||
{
|
||||
"value": "GBUM71029604"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d",
|
||||
"role": "Vocals"
|
||||
},
|
||||
{
|
||||
"contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e",
|
||||
"role": "Guitar"
|
||||
}
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Get Track
|
||||
|
||||
#### Get Track Request
|
||||
|
||||
```js
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/tracks/9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f
|
||||
```
|
||||
|
||||
#### Get Track Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f",
|
||||
"albumId": "e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f",
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"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" },
|
||||
"language": { "languageCode": "en", "languageName": "English", "nativeName": "English" },
|
||||
"originalLanguage": { "languageCode": "en", "languageName": "English", "nativeName": "English" },
|
||||
"tags": [ { "name": "classic" }, { "name": "epic" } ],
|
||||
"genres": [ { "name": "Rock" }, { "name": "Progressive Rock" } ],
|
||||
"durationInSeconds": 354,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 980
|
||||
},
|
||||
"trackNumber": 1,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "CMajor",
|
||||
"bpm": 72,
|
||||
"work": "Bohemian Rhapsody",
|
||||
"musicBrainzRecordingId": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
|
||||
"musicBrainzTrackId": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
|
||||
"musicBrainzWorkId": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
|
||||
"createdOnUtc": "2025-01-01T12:00:00.0000000Z",
|
||||
"updatedOnUtc": null,
|
||||
"moods": [
|
||||
{
|
||||
"name": "dramatic"
|
||||
},
|
||||
{
|
||||
"name": "anxious"
|
||||
}
|
||||
],
|
||||
"isrcs": [
|
||||
{
|
||||
"value": "GBUM71029604"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d",
|
||||
"role": "Vocals"
|
||||
},
|
||||
{
|
||||
"contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e",
|
||||
"role": "Guitar"
|
||||
}
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Update Track
|
||||
|
||||
#### Update Track Request
|
||||
|
||||
```js
|
||||
PUT api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/tracks/9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"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.",
|
||||
"durationInSeconds": 354,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 980,
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1975-10-31",
|
||||
"originalReleaseYear": 1975,
|
||||
"reReleaseDate": null,
|
||||
"reReleaseYear": null,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "Original"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Progressive Rock" }
|
||||
],
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "epic" }
|
||||
]
|
||||
},
|
||||
"trackNumber": 1,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "CMajor",
|
||||
"bpm": 72,
|
||||
"work": "Bohemian Rhapsody",
|
||||
"musicBrainzRecordingId": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
|
||||
"musicBrainzTrackId": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
|
||||
"musicBrainzWorkId": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
|
||||
"moods": [
|
||||
{ "name": "dramatic" },
|
||||
{ "name": "anxious" }
|
||||
],
|
||||
"isrcs": [
|
||||
{ "value": "GBUM71029604" }
|
||||
],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Vocals" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Guitar" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Update Track Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f",
|
||||
"albumId": "e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f",
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"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" },
|
||||
"language": { "languageCode": "en", "languageName": "English", "nativeName": "English" },
|
||||
"originalLanguage": { "languageCode": "en", "languageName": "English", "nativeName": "English" },
|
||||
"tags": [ { "name": "classic" }, { "name": "epic" } ],
|
||||
"genres": [ { "name": "Rock" }, { "name": "Progressive Rock" } ],
|
||||
"durationInSeconds": 354,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 980
|
||||
},
|
||||
"trackNumber": 1,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "CMajor",
|
||||
"bpm": 72,
|
||||
"work": "Bohemian Rhapsody",
|
||||
"musicBrainzRecordingId": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
|
||||
"musicBrainzTrackId": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
|
||||
"musicBrainzWorkId": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
|
||||
"createdOnUtc": "2025-01-01T12:00:00.0000000Z",
|
||||
"updatedOnUtc": null,
|
||||
"moods": [
|
||||
{
|
||||
"name": "dramatic"
|
||||
},
|
||||
{
|
||||
"name": "anxious"
|
||||
}
|
||||
],
|
||||
"isrcs": [
|
||||
{
|
||||
"value": "GBUM71029604"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d",
|
||||
"role": "Vocals"
|
||||
},
|
||||
{
|
||||
"contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e",
|
||||
"role": "Guitar"
|
||||
}
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Delete Track
|
||||
|
||||
```js
|
||||
DELETE api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/tracks/{trackId}
|
||||
```
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
Deletes the track identified by the route.
|
||||
File renamed without changes.
+388
-41
@@ -14,6 +14,12 @@
|
||||
- [Get Books Lite](#get-books-lite)
|
||||
- [Get Books Lite Request](#get-books-lite-request)
|
||||
- [Get Books Lite Response](#get-books-lite-response)
|
||||
- [Update Book](#update-book)
|
||||
- [Update Book Request](#update-book-request)
|
||||
- [Update Book Response](#update-book-response)
|
||||
- [Update Book Cover](#update-book-cover)
|
||||
- [Update Book Cover Request](#update-book-cover-request)
|
||||
- [Update Book Cover Response](#update-book-cover-response)
|
||||
- [Get Reading Availability](#get-reading-availability)
|
||||
- [Get Reading Availability Request](#get-reading-availability-request)
|
||||
- [Get Reading Availability Response](#get-reading-availability-response)
|
||||
@@ -34,13 +40,12 @@
|
||||
#### Add Book Request
|
||||
|
||||
```js
|
||||
POST api/v1/books
|
||||
POST api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"path": "/books/the-fellowship-of-the-ring.pdf",
|
||||
"path": "/media/libraries/books/the-fellowship-of-the-ring.pdf",
|
||||
"metadata": {
|
||||
"title": "The Fellowship of the Ring",
|
||||
"originalTitle": "The Fellowship of the Ring",
|
||||
@@ -50,7 +55,7 @@ POST api/v1/books
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "uk",
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"genres": [
|
||||
@@ -93,33 +98,27 @@ POST api/v1/books
|
||||
"appleBooksId": "id395211",
|
||||
"isbns": [
|
||||
{
|
||||
"value": "0395272238",
|
||||
"format": "Isbn10"
|
||||
"value": "0395272238",
|
||||
"format": "Isbn10"
|
||||
},
|
||||
{
|
||||
"value": "9780395272237",
|
||||
"format": "Isbn13"
|
||||
"value": "9780395272237",
|
||||
"format": "Isbn13"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"name": "J.R.R. Tolkien",
|
||||
"role": {
|
||||
"name": "author",
|
||||
"category": "book"
|
||||
}
|
||||
"contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d",
|
||||
"role": "Author"
|
||||
},
|
||||
{
|
||||
"name": "Alan Lee",
|
||||
"role": {
|
||||
"name": "illustrator",
|
||||
"category": "book"
|
||||
}
|
||||
"contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e",
|
||||
"role": "Illustrator"
|
||||
}
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "Goodreads",
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
@@ -144,7 +143,7 @@ POST api/v1/books
|
||||
{
|
||||
"id": "32b336e8-dafc-4a08-9dec-9454e66dd55d",
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"path": "/books/the-fellowship-of-the-ring.pdf",
|
||||
"path": "/media/libraries/books/the-fellowship-of-the-ring.pdf",
|
||||
"metadata": {
|
||||
"publisher": "Houghton Mifflin",
|
||||
"pageCount": 398,
|
||||
@@ -156,7 +155,7 @@ POST api/v1/books
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "uk",
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"language": {
|
||||
@@ -215,14 +214,19 @@ POST api/v1/books
|
||||
"format": "Isbn13"
|
||||
}
|
||||
],
|
||||
"contributors": [],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Author" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Illustrator" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
},
|
||||
{
|
||||
"source": "Amazon",
|
||||
"value": 4.7,
|
||||
"maxValue": 5,
|
||||
"voteCount": 87654
|
||||
@@ -232,7 +236,8 @@ POST api/v1/books
|
||||
"lastMetadataUpdateUtc": null,
|
||||
"metadataProvider": null,
|
||||
"createdOnUtc": "2025-01-01T12:00:00.0000000Z",
|
||||
"updatedOnUtc": null
|
||||
"updatedOnUtc": null,
|
||||
"coverPath": null
|
||||
}
|
||||
```
|
||||
|
||||
@@ -241,7 +246,7 @@ POST api/v1/books
|
||||
#### Get Book Request
|
||||
|
||||
```js
|
||||
GET api/v1/books/{id}
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}
|
||||
```
|
||||
|
||||
#### Get Book Response
|
||||
@@ -250,19 +255,118 @@ GET api/v1/books/{id}
|
||||
200 Ok
|
||||
```
|
||||
|
||||
Returns an empty response. This endpoint is not yet implemented.
|
||||
```json
|
||||
{
|
||||
"id": "32b336e8-dafc-4a08-9dec-9454e66dd55d",
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"path": "/media/libraries/books/the-fellowship-of-the-ring.pdf",
|
||||
"metadata": {
|
||||
"publisher": "Houghton Mifflin",
|
||||
"pageCount": 398,
|
||||
"title": "The Fellowship of the Ring",
|
||||
"originalTitle": "The Fellowship of the Ring",
|
||||
"description": "The first part of J.R.R. Tolkien's epic adventure The Lord of the Rings. In a sleepy village in the Shire, young Frodo Baggins finds himself faced with an immense task, as his elderly cousin Bilbo entrusts the Ring to his care. Frodo must leave his home and make a perilous journey across Middle-earth to the Cracks of Doom, there to destroy the Ring and foil the Dark Lord in his evil purpose.",
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1954-07-29",
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "epic fantasy"
|
||||
},
|
||||
{
|
||||
"name": "quest"
|
||||
},
|
||||
{
|
||||
"name": "middle-earth"
|
||||
}
|
||||
],
|
||||
"genres": [
|
||||
{
|
||||
"name": "fantasy"
|
||||
},
|
||||
{
|
||||
"name": "adventure"
|
||||
},
|
||||
{
|
||||
"name": "classic"
|
||||
}
|
||||
]
|
||||
},
|
||||
"format": "Paperback",
|
||||
"edition": "50th Anniversary Edition",
|
||||
"volumeNumber": 1,
|
||||
"series": null,
|
||||
"asin": "B007978NPG",
|
||||
"goodreadsId": "3",
|
||||
"lccn": "54009621",
|
||||
"oclcNumber": "ocm00012345",
|
||||
"openLibraryId": "OL7603910M",
|
||||
"libraryThingId": "3203347",
|
||||
"googleBooksId": "aWZzLPhY4o0C",
|
||||
"barnesAndNobleId": "1100307790",
|
||||
"appleBooksId": "id395211",
|
||||
"isbns": [
|
||||
{
|
||||
"value": "0395272238",
|
||||
"format": "Isbn10"
|
||||
},
|
||||
{
|
||||
"value": "9780395272237",
|
||||
"format": "Isbn13"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Author" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Illustrator" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
},
|
||||
{
|
||||
"source": "Amazon",
|
||||
"value": 4.7,
|
||||
"maxValue": 5,
|
||||
"voteCount": 87654
|
||||
}
|
||||
],
|
||||
"metadataStatus": "Pending",
|
||||
"lastMetadataUpdateUtc": null,
|
||||
"metadataProvider": null,
|
||||
"createdOnUtc": "2025-01-01T12:00:00.0000000Z",
|
||||
"updatedOnUtc": null,
|
||||
"coverPath": null
|
||||
}
|
||||
```
|
||||
|
||||
### Get Books
|
||||
|
||||
#### Get Books Request
|
||||
|
||||
```js
|
||||
GET api/v1/books?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&perPage=10&searchTerm=fellowship&sortBy=title&sortOrder=Ascending
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books?currentPage=1&perPage=10&searchTerm=fellowship&sortBy=title&sortOrder=Ascending
|
||||
```
|
||||
|
||||
| Query Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `libraryId` | `string` (GUID) | Required. The Id of the media library whose books are retrieved. |
|
||||
| `currentPage` | `int` | Optional. The page of results to retrieve. |
|
||||
| `perPage` | `int` | Optional. The maximum number of books to retrieve per page. |
|
||||
| `searchTerm` | `string` | Optional. The search term used to filter results. |
|
||||
@@ -281,7 +385,7 @@ GET api/v1/books?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&pe
|
||||
{
|
||||
"id": "32b336e8-dafc-4a08-9dec-9454e66dd55d",
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"path": "/books/the-fellowship-of-the-ring.pdf",
|
||||
"path": "/media/libraries/books/the-fellowship-of-the-ring.pdf",
|
||||
"metadata": {
|
||||
"title": "The Fellowship of the Ring",
|
||||
"originalTitle": "The Fellowship of the Ring",
|
||||
@@ -291,7 +395,7 @@ GET api/v1/books?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&pe
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "uk",
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"genres": [
|
||||
@@ -320,9 +424,7 @@ GET api/v1/books?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&pe
|
||||
"format": "Paperback",
|
||||
"edition": "50th Anniversary Edition",
|
||||
"volumeNumber": 1,
|
||||
"series": {
|
||||
"title": "The Lord of the Rings"
|
||||
},
|
||||
"series": null,
|
||||
"asin": "B007978NPG",
|
||||
"goodreadsId": "3",
|
||||
"lccn": "54009621",
|
||||
@@ -342,19 +444,30 @@ GET api/v1/books?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&pe
|
||||
"format": "Isbn13"
|
||||
}
|
||||
],
|
||||
"contributors": [],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Author" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Illustrator" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
},
|
||||
{
|
||||
"source": "Amazon",
|
||||
"value": 4.7,
|
||||
"maxValue": 5,
|
||||
"voteCount": 87654
|
||||
}
|
||||
],
|
||||
"metadataStatus": "Pending",
|
||||
"lastMetadataUpdateUtc": null,
|
||||
"metadataProvider": null,
|
||||
"createdOnUtc": "2025-01-01T12:00:00.0000000Z",
|
||||
"updatedOnUtc": null
|
||||
"updatedOnUtc": null,
|
||||
"coverPath": null
|
||||
}
|
||||
],
|
||||
"currentPage": 1,
|
||||
@@ -369,17 +482,16 @@ GET api/v1/books?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&pe
|
||||
#### Get Books Lite Request
|
||||
|
||||
```js
|
||||
GET api/v1/books/lite?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage=1&perPage=10&searchTerm=fellowship&filterAlphaKey=f&ignoreThePrefixForAlphaPicker=true&sortBy=title&sortOrder=Ascending
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/lite?currentPage=1&perPage=10&searchTerm=fellowship&filterAlphaKey=f&shouldIgnoreThePrefixForAlphaPicker=true&sortBy=title&sortOrder=Ascending
|
||||
```
|
||||
|
||||
| Query Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `libraryId` | `string` (GUID) | Required. The Id of the media library whose books are retrieved. |
|
||||
| `currentPage` | `int` | Optional. The page of results to retrieve. |
|
||||
| `perPage` | `int` | Optional. The maximum number of books to retrieve per page. |
|
||||
| `searchTerm` | `string` | Optional. The search term used to filter results. |
|
||||
| `filterAlphaKey` | `string` | Optional. Filters results by the first character of their title. A single ASCII letter (case-insensitive), `#` for titles starting with a digit, or `*` for titles starting with any other character. |
|
||||
| `ignoreThePrefixForAlphaPicker` | `bool` | Whether the leading "The " prefix of a title should be ignored when computing the alpha key. |
|
||||
| `shouldIgnoreThePrefixForAlphaPicker` | `bool` | Whether the leading "The " prefix of a title should be ignored when computing the alpha key. |
|
||||
| `sortBy` | `string` | Optional. The name of the field by which to sort the results. |
|
||||
| `sortOrder` | `string` | Optional. The direction in which to sort the results (`Ascending` or `Descending`). |
|
||||
|
||||
@@ -406,12 +518,247 @@ GET api/v1/books/lite?libraryId=3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a¤tPage
|
||||
}
|
||||
```
|
||||
|
||||
### Update Book
|
||||
|
||||
#### Update Book Request
|
||||
|
||||
```js
|
||||
PUT api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"metadata": {
|
||||
"title": "The Fellowship of the Ring",
|
||||
"originalTitle": "The Fellowship of the Ring",
|
||||
"description": "The first part of J.R.R. Tolkien's epic adventure The Lord of the Rings. In a sleepy village in the Shire, young Frodo Baggins finds himself faced with an immense task, as his elderly cousin Bilbo entrusts the Ring to his care. Frodo must leave his home and make a perilous journey across Middle-earth to the Cracks of Doom, there to destroy the Ring and foil the Dark Lord in his evil purpose.",
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1954-07-29",
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"genres": [
|
||||
{ "name": "fantasy" },
|
||||
{ "name": "adventure" },
|
||||
{ "name": "classic" }
|
||||
],
|
||||
"tags": [
|
||||
{ "name": "epic fantasy" },
|
||||
{ "name": "quest" },
|
||||
{ "name": "middle-earth" }
|
||||
],
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"publisher": "Houghton Mifflin",
|
||||
"pageCount": 398
|
||||
},
|
||||
"format": "Paperback",
|
||||
"edition": "50th Anniversary Edition",
|
||||
"volumeNumber": 1,
|
||||
"series": {
|
||||
"title": "The Lord of the Rings"
|
||||
},
|
||||
"asin": "B007978NPG",
|
||||
"goodreadsId": "3",
|
||||
"lccn": "54009621",
|
||||
"oclcNumber": "ocm00012345",
|
||||
"openLibraryId": "OL7603910M",
|
||||
"libraryThingId": "3203347",
|
||||
"googleBooksId": "aWZzLPhY4o0C",
|
||||
"barnesAndNobleId": "1100307790",
|
||||
"appleBooksId": "id395211",
|
||||
"isbns": [
|
||||
{
|
||||
"value": "0395272238",
|
||||
"format": "Isbn10"
|
||||
},
|
||||
{
|
||||
"value": "9780395272237",
|
||||
"format": "Isbn13"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d",
|
||||
"role": "Author"
|
||||
},
|
||||
{
|
||||
"contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e",
|
||||
"role": "Illustrator"
|
||||
}
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
},
|
||||
{
|
||||
"source": "Amazon",
|
||||
"value": 4.7,
|
||||
"maxValue": 5,
|
||||
"voteCount": 87654
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Update Book Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "32b336e8-dafc-4a08-9dec-9454e66dd55d",
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"path": "/media/libraries/books/the-fellowship-of-the-ring.pdf",
|
||||
"metadata": {
|
||||
"publisher": "Houghton Mifflin",
|
||||
"pageCount": 398,
|
||||
"title": "The Fellowship of the Ring",
|
||||
"originalTitle": "The Fellowship of the Ring",
|
||||
"description": "The first part of J.R.R. Tolkien's epic adventure The Lord of the Rings. In a sleepy village in the Shire, young Frodo Baggins finds himself faced with an immense task, as his elderly cousin Bilbo entrusts the Ring to his care. Frodo must leave his home and make a perilous journey across Middle-earth to the Cracks of Doom, there to destroy the Ring and foil the Dark Lord in his evil purpose.",
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1954-07-29",
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "epic fantasy"
|
||||
},
|
||||
{
|
||||
"name": "quest"
|
||||
},
|
||||
{
|
||||
"name": "middle-earth"
|
||||
}
|
||||
],
|
||||
"genres": [
|
||||
{
|
||||
"name": "fantasy"
|
||||
},
|
||||
{
|
||||
"name": "adventure"
|
||||
},
|
||||
{
|
||||
"name": "classic"
|
||||
}
|
||||
]
|
||||
},
|
||||
"format": "Paperback",
|
||||
"edition": "50th Anniversary Edition",
|
||||
"volumeNumber": 1,
|
||||
"series": null,
|
||||
"asin": "B007978NPG",
|
||||
"goodreadsId": "3",
|
||||
"lccn": "54009621",
|
||||
"oclcNumber": "ocm00012345",
|
||||
"openLibraryId": "OL7603910M",
|
||||
"libraryThingId": "3203347",
|
||||
"googleBooksId": "aWZzLPhY4o0C",
|
||||
"barnesAndNobleId": "1100307790",
|
||||
"appleBooksId": "id395211",
|
||||
"isbns": [
|
||||
{
|
||||
"value": "0395272238",
|
||||
"format": "Isbn10"
|
||||
},
|
||||
{
|
||||
"value": "9780395272237",
|
||||
"format": "Isbn13"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Author" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Illustrator" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
},
|
||||
{
|
||||
"source": "Amazon",
|
||||
"value": 4.7,
|
||||
"maxValue": 5,
|
||||
"voteCount": 87654
|
||||
}
|
||||
],
|
||||
"metadataStatus": "Enriched",
|
||||
"lastMetadataUpdateUtc": "2025-01-01T12:00:00.0000000Z",
|
||||
"metadataProvider": "GoogleBooks",
|
||||
"createdOnUtc": "2025-01-01T12:00:00.0000000Z",
|
||||
"updatedOnUtc": "2025-02-01T12:00:00.0000000Z",
|
||||
"coverPath": "/media/books/books-3f2504e0-4f89-41d3-9a0c-0305e82c3301/The Lord of the Rings-2b0e5f5a-0b3f-4b7e-8f4a-8c9e3d2f5a6b/cover.jpg"
|
||||
}
|
||||
```
|
||||
|
||||
### Update Book Cover
|
||||
|
||||
Updates the cover image of the book identified by `bookId` with the image uploaded in the multipart form of the request. The book must belong to the media library identified by `libraryId`, and the uploaded file must be an image.
|
||||
|
||||
#### Update Book Cover Request
|
||||
|
||||
```js
|
||||
PUT api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}/cover
|
||||
Content-Type: multipart/form-data; boundary=LuminaBoundary
|
||||
|
||||
--LuminaBoundary
|
||||
Content-Disposition: form-data; name="cover"; filename="cover.jpg"
|
||||
Content-Type: image/jpeg
|
||||
|
||||
< ./cover.jpg
|
||||
--LuminaBoundary--
|
||||
```
|
||||
|
||||
#### Update Book Cover Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"coverPath": "/media/books/books-3f2504e0-4f89-41d3-9a0c-0305e82c3301/The Lord of the Rings-2b0e5f5a-0b3f-4b7e-8f4a-8c9e3d2f5a6b/cover.jpg"
|
||||
}
|
||||
```
|
||||
|
||||
### Get Reading Availability
|
||||
|
||||
#### Get Reading Availability Request
|
||||
|
||||
```js
|
||||
GET api/v1/books/{bookId}/reading/availability
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}/reading/availability
|
||||
```
|
||||
|
||||
Reports whether the book identified by `bookId` can be opened for reading: the book reader that supports the format of the book is resolved and its enablement for the media library of the book is checked, without extracting the book. When the book cannot be read, the response carries the code of the error preventing it, so the client can tell a missing book reader apart from a disabled one.
|
||||
@@ -436,7 +783,7 @@ Reports whether the book identified by `bookId` can be opened for reading: the b
|
||||
#### Get Reading Manifest Request
|
||||
|
||||
```js
|
||||
GET api/v1/books/{bookId}/reading/manifest
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}/reading/manifest
|
||||
```
|
||||
|
||||
Opens the book identified by `bookId` for reading by extracting its contents through the book reader that is enabled for its media library, and returns the reading manifest: the title and author of the book, its hierarchical table of contents, its ordered spine of reading sections, the keys of its resources, and whether it has extractable text content. A scanned book, whose pages are only images, has no text content and is displayed as page images.
|
||||
@@ -487,7 +834,7 @@ Opens the book identified by `bookId` for reading by extracting its contents thr
|
||||
#### Get Reading Section Request
|
||||
|
||||
```js
|
||||
GET api/v1/books/{bookId}/reading/sections/{locationRef}
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}/reading/sections/{locationRef}
|
||||
```
|
||||
|
||||
Returns the reading section identified by `locationRef` of the book identified by `bookId`. The section content is sanitized by the host before it is served, and its references to the resources of the book are resolved by the client through the resource endpoint. The `locationRef` of a section is taken from the spine of the reading manifest of the book.
|
||||
@@ -511,7 +858,7 @@ Returns the reading section identified by `locationRef` of the book identified b
|
||||
#### Get Reading Resource Request
|
||||
|
||||
```js
|
||||
GET api/v1/books/{bookId}/reading/resources/{resourceKey}
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{bookId}/reading/resources/{resourceKey}
|
||||
```
|
||||
|
||||
Returns the binary resource identified by `resourceKey` of the book identified by `bookId` (for example an image, a font, or a stylesheet of the book, or a page image of a scanned PDF that is rendered on demand). The `resourceKey` of a resource is taken from the reading manifest of the book.
|
||||
@@ -0,0 +1,25 @@
|
||||
# Lumina API
|
||||
|
||||
- [Lumina API](#lumina-api)
|
||||
- [Health](#health)
|
||||
- [Check Health](#check-health)
|
||||
- [Check Health Request](#check-health-request)
|
||||
- [Check Health Response](#check-health-response)
|
||||
|
||||
## Health
|
||||
|
||||
### Check Health
|
||||
|
||||
#### Check Health Request
|
||||
|
||||
```js
|
||||
GET api/v1/check-health
|
||||
```
|
||||
|
||||
#### Check Health Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
Returns an empty response. This endpoint is not yet implemented.
|
||||
+4
-22
@@ -1,10 +1,7 @@
|
||||
# Lumina API
|
||||
|
||||
- [Lumina API](#lumina-api)
|
||||
- [Maintenance](#maintenance)
|
||||
- [Check Health](#check-health)
|
||||
- [Check Health Request](#check-health-request)
|
||||
- [Check Health Response](#check-health-response)
|
||||
- [Initialization](#initialization)
|
||||
- [Setup Application](#setup-application)
|
||||
- [Setup Application Request](#setup-application-request)
|
||||
- [Setup Application Response](#setup-application-response)
|
||||
@@ -12,23 +9,7 @@
|
||||
- [Check Initialization Request](#check-initialization-request)
|
||||
- [Check Initialization Response](#check-initialization-response)
|
||||
|
||||
## Maintenance
|
||||
|
||||
### Check Health
|
||||
|
||||
#### Check Health Request
|
||||
|
||||
```js
|
||||
GET api/v1/check-health
|
||||
```
|
||||
|
||||
#### Check Health Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
Returns an empty response. This endpoint is not yet implemented.
|
||||
## Initialization
|
||||
|
||||
### Setup Application
|
||||
|
||||
@@ -61,6 +42,7 @@ POST api/v1/initialization
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Check Initialization
|
||||
|
||||
#### Check Initialization Request
|
||||
@@ -79,4 +61,4 @@ GET api/v1/initialization
|
||||
{
|
||||
"isInitialized": true
|
||||
}
|
||||
```
|
||||
```
|
||||
@@ -2,24 +2,6 @@
|
||||
|
||||
- [Lumina API](#lumina-api)
|
||||
- [Authorization](#authorization)
|
||||
- [Get Permissions](#get-permissions)
|
||||
- [Get Permissions Request](#get-permissions-request)
|
||||
- [Get Permissions Response](#get-permissions-response)
|
||||
- [Get Roles](#get-roles)
|
||||
- [Get Roles Request](#get-roles-request)
|
||||
- [Get Roles Response](#get-roles-response)
|
||||
- [Get Role Permissions](#get-role-permissions)
|
||||
- [Get Role Permissions Request](#get-role-permissions-request)
|
||||
- [Get Role Permissions Response](#get-role-permissions-response)
|
||||
- [Add Role](#add-role)
|
||||
- [Add Role Request](#add-role-request)
|
||||
- [Add Role Response](#add-role-response)
|
||||
- [Update Role](#update-role)
|
||||
- [Update Role Request](#update-role-request)
|
||||
- [Update Role Response](#update-role-response)
|
||||
- [Delete Role](#delete-role)
|
||||
- [Delete Role Request](#delete-role-request)
|
||||
- [Delete Role Response](#delete-role-response)
|
||||
- [Get Authorization](#get-authorization)
|
||||
- [Get Authorization Request](#get-authorization-request)
|
||||
- [Get Authorization Response](#get-authorization-response)
|
||||
@@ -35,190 +17,6 @@
|
||||
|
||||
## Authorization
|
||||
|
||||
### Get Permissions
|
||||
|
||||
#### Get Permissions Request
|
||||
|
||||
```js
|
||||
GET api/v1/auth/permissions
|
||||
```
|
||||
|
||||
#### Get Permissions Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "5264e3a8-bdec-4ec0-9423-839f3a9afe4b",
|
||||
"permissionName": "CanDeleteUsers"
|
||||
},
|
||||
{
|
||||
"id": "7830cd55-3585-4da1-bfad-994be8637da8",
|
||||
"permissionName": "CanViewUsers"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Get Roles
|
||||
|
||||
#### Get Roles Request
|
||||
|
||||
```js
|
||||
GET api/v1/auth/roles
|
||||
```
|
||||
|
||||
#### Get Roles Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "776e440d-39d2-4f31-8dcd-481de61e8792",
|
||||
"roleName": "Admin"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Get Role Permissions
|
||||
|
||||
#### Get Role Permissions Request
|
||||
|
||||
```js
|
||||
GET api/v1/auth/roles/{roleId}/permissions
|
||||
```
|
||||
|
||||
#### Get Role Permissions Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"role": {
|
||||
"id": "61567253-c752-4680-989c-a40a73f3e4b9",
|
||||
"roleName": "Editor"
|
||||
},
|
||||
"permissions": [
|
||||
{
|
||||
"id": "5264e3a8-bdec-4ec0-9423-839f3a9afe4b",
|
||||
"permissionName": "CanDeleteUsers"
|
||||
},
|
||||
{
|
||||
"id": "7830cd55-3585-4da1-bfad-994be8637da8",
|
||||
"permissionName": "CanViewUsers"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Add Role
|
||||
|
||||
#### Add Role Request
|
||||
|
||||
```js
|
||||
POST api/v1/auth/roles
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"roleName": "Editor",
|
||||
"permissions": [
|
||||
"7934ff13-1ccd-4c24-bab3-6423c905e249",
|
||||
"8f23e43a-bb4b-483a-99eb-7ab361df7482"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Add Role Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"role": {
|
||||
"id": "e5b67972-6928-4be1-a757-e98879d4a12a",
|
||||
"roleName": "Editor"
|
||||
},
|
||||
"permissions": [
|
||||
{
|
||||
"id": "7934ff13-1ccd-4c24-bab3-6423c905e249",
|
||||
"permissionName": "CanDeleteUsers"
|
||||
},
|
||||
{
|
||||
"id": "8f23e43a-bb4b-483a-99eb-7ab361df7482",
|
||||
"permissionName": "CanViewUsers"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Update Role
|
||||
|
||||
#### Update Role Request
|
||||
|
||||
```js
|
||||
PUT api/v1/auth/roles
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"roleId": "73d204e2-5922-441d-83d8-8d4d8fc29eaa",
|
||||
"roleName": "Editor",
|
||||
"permissions": [
|
||||
"ac113d18-69bb-4162-8c05-ff7a5559059a",
|
||||
"3c2fd936-8d4a-4963-b237-9f8d3aeeab26"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Update Role Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"role": {
|
||||
"id": "61567253-c752-4680-989c-a40a73f3e4b9",
|
||||
"roleName": "Editor"
|
||||
},
|
||||
"permissions": [
|
||||
{
|
||||
"id": "5264e3a8-bdec-4ec0-9423-839f3a9afe4b",
|
||||
"permissionName": "CanDeleteUsers"
|
||||
},
|
||||
{
|
||||
"id": "7830cd55-3585-4da1-bfad-994be8637da8",
|
||||
"permissionName": "CanViewUsers"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Delete Role
|
||||
|
||||
#### Delete Role Request
|
||||
|
||||
```js
|
||||
DELETE api/v1/auth/roles/{roleId}
|
||||
```
|
||||
|
||||
#### Delete Role Response
|
||||
|
||||
```js
|
||||
204 No Content
|
||||
```
|
||||
|
||||
### Get Authorization
|
||||
|
||||
#### Get Authorization Request
|
||||
@@ -244,6 +42,7 @@ GET api/v1/auth/get-authorization?userId=8e5e2be7-9f3b-4309-882b-8913dc6bda10
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Get User Permissions
|
||||
|
||||
#### Get User Permissions Request
|
||||
@@ -275,6 +74,7 @@ GET api/v1/auth/users/{userId}/permissions
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
### Get User Role
|
||||
|
||||
#### Get User Role Request
|
||||
@@ -296,6 +96,7 @@ GET api/v1/auth/users/{userId}/role
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Update User Role And Permissions
|
||||
|
||||
#### Update User Role And Permissions Request
|
||||
@@ -329,4 +130,4 @@ PUT api/v1/auth/users/{userId}/role-and-permissions
|
||||
"CanDeleteUsers"
|
||||
]
|
||||
}
|
||||
```
|
||||
```
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
# Architecture Decision Record (ADR): 0014 - Closed Generic Persistence Toolkit for Aggregate Graph Persistence
|
||||
|
||||
## Status
|
||||
|
||||
**Accepted** (2026-09-26)
|
||||
|
||||
## Context
|
||||
|
||||
Repositories in the DataAccess layer persist aggregate graphs: they load a tracked root entity, apply the edited scalar values, reconcile child collections, and add or update shared reference rows. This work was implemented independently in each repository, which produced duplication and drift.
|
||||
|
||||
1. **Shared reference handling**: a shared reference row (a tag or a genre) is keyed by its name and is shared across the whole database. When a graph is inserted or updated, the stored rows whose names already exist have to be reused instead of re-inserted, so that the shared tables are not duplicated, and a name shared by several parents of one request must be tracked only once. This logic existed inline in `BookRepository`, and as a private `ReconcileTagsAndGenresAsync` method in `BookRepository`, `AlbumRepository`, and `TrackRepository`.
|
||||
|
||||
2. **Child collection reconciliation**: the same identity-preserving reconcile logic was repeated for every child collection of every aggregate (contributors, ratings, ISBNs, tags, genres, moods, ISRCs, content locations, permissions).
|
||||
|
||||
3. **Scalar copy on edit**: `EditableValuesCopier` applies editable scalar values while leaving the audit columns to the auditing interceptor. Seven auditable repositories (`Role`, `LibraryScan`, `ScheduledJob`, `ScheduledJobExecution`, `Theme`, `User`, `UserSettings`) still copied scalars with `CurrentValues.SetValues`, which writes every scalar property, including the primary key and the audit columns. Writing the primary key is destructive whenever the tracked row was located by a key other than its primary key: `UserRepository` locates the row by username, so an incoming entity whose Id differs from, or is unset relative to, the stored one would retarget the tracked row's identity, leaving the guarantee "the stored identity is never overwritten by an edit" to caller convention instead of to the code.
|
||||
|
||||
`Lumina.DataAccess\Common\Persistence` already held `CollectionReconciler` and `EditableValuesCopier`, but there was no shared reference primitive and no explicit boundary defining what may live there, so the shared reference concern was expressed per type and per repository.
|
||||
|
||||
## Decision
|
||||
|
||||
Treat `Lumina.DataAccess\Common\Persistence` as a closed set of generic, entity-agnostic primitives that express the whole of aggregate graph persistence. Per-entity logic stays in the repository, and cross-cutting logic is generalized rather than specialized.
|
||||
|
||||
### The closed set
|
||||
|
||||
| Primitive | Responsibility |
|
||||
|---|---|
|
||||
| `EditableValuesCopier` | Copies only the editable scalar values onto the tracked entity. The primary key is never written, so the tracked identity always wins over the incoming one regardless of how the row was located, and the audit columns are never written, so the auditing interceptor remains their only writer. |
|
||||
| `CollectionReconciler` | Reconciles a tracked child collection against a desired set by key selectors, preserving the identity and audit columns of the children that already exist. |
|
||||
| `SharedReferenceResolver` | Resolves shared reference rows by name so each distinct name maps to a single tracked instance. The stored row wins over the incoming instance, and within-request duplicates are collapsed. |
|
||||
|
||||
### Genericity rules
|
||||
|
||||
- `EditableValuesCopier` is generic over `IAuditableEntity`. It reads the primary key from the Entity Framework metadata, so it enforces the key-matching contract for any entity without per-entity code.
|
||||
- `CollectionReconciler` is generic over existing item, incoming item, and key type.
|
||||
- `SharedReferenceResolver` is generic over `ISharedReferenceEntity`, a marker interface implemented by the shared reference records (`TagEntity`, `GenreEntity`). This is the one concern that is shaped by a family of entities, expressed through the marker interface rather than through per-entity code, so a new shared reference type adds no new persistence type.
|
||||
|
||||
### Application
|
||||
|
||||
- Insert resolves shared references across the whole aggregate, then normalizes every collection of the aggregate to the resolved instances.
|
||||
- Update reconciles the tracked shared reference collections in place, reusing the stored rows.
|
||||
- Scalar edits go through `EditableValuesCopier`. The repository decides how the tracked row is located (by its primary key, or by a natural key such as the username), and the copier keeps that row's primary key and audit columns untouched, so the incoming entity never has to carry a matching key.
|
||||
- Child collections are reconciled through `CollectionReconciler` by a stable key.
|
||||
|
||||
## Consequences
|
||||
|
||||
### Positive Outcomes
|
||||
|
||||
| Aspect | Benefit |
|
||||
|---|---|
|
||||
| Bounded surface | The folder holds exactly three generic types; new entity types and new shared reference types add no persistence type |
|
||||
| Consistency | Every repository persists graphs the same way, with the same identity and audit semantics |
|
||||
| Correctness | Audit columns are never overwritten by an edit, and shared reference rows are never tracked more than once per request |
|
||||
| Identity preservation | The tracked primary key is never overwritten by an edit, even when the incoming entity carries a different, or unset, key, so locating a row by a natural key stays safe |
|
||||
| Testability | The primitives are covered directly by unit tests, independently of any repository |
|
||||
| Ownership | No new external dependency and no declarative engine; the toolkit depends only on the internal `ISharedReferenceEntity` marker, and the logic stays explicit and inspectable |
|
||||
|
||||
### Risks and Mitigations
|
||||
|
||||
| Risk | Mitigation Strategy |
|
||||
|---|---|
|
||||
| The generic resolver depends on an entity keyed by `Name` and translated by EF Core | `SharedReferenceResolver` is generic over `ISharedReferenceEntity` and is exercised by both unit and integration tests, which prove the EF translation |
|
||||
| A future concern is generalized before its shape is stable | The rule permits keeping a concern in the repository until it can actually be generalized, rather than extracting speculatively |
|
||||
| Behavior change from applying `EditableValuesCopier` to the seven repositories | Covered by the DataAccess and Presentation.Api integration suites, which pass across the migrated repositories |
|
||||
| The copier relies on Entity Framework metadata to find the primary key | Unit tests copy onto a tracked entity whose incoming key does not match, and assert that the stored identity and audit columns survive |
|
||||
|
||||
## Alternatives Considered
|
||||
|
||||
### 1. Keep graph persistence duplicated in each repository
|
||||
|
||||
Leave the shared reference handling, collection reconciliation, and scalar copy implemented per repository.
|
||||
|
||||
**Rejected**: the duplication and the drift are the problem this decision addresses. Shared reference handling in particular has a single general shape, and repeating it per repository is what allows the shared-table and audit-column defects above to reappear.
|
||||
|
||||
### 2. Declarative aggregate persistence profiles
|
||||
|
||||
Introduce a generic persistence engine driven by a per-aggregate profile describing scalar copy behavior, child collections, and shared lookups, reducing repositories to load and apply.
|
||||
|
||||
**Rejected**: it is effectively a small in-house ORM, with functional and ownership costs disproportionate to the problem. The closed generic toolkit achieves the stated goal, keeping graph persistence explicit, without a new abstraction layer to own.
|
||||
|
||||
### 3. Model tags and genres as owned value objects
|
||||
|
||||
Stop modeling shared references as a shared table keyed by name, and store them per aggregate, removing the duplicate-key-in-graph class of bug at the source.
|
||||
|
||||
**Rejected**: it requires a database schema change and changes query behavior for shared references, which is out of scope. The shared tables are kept, and the concern is handled where it belongs, in the persistence toolkit.
|
||||
@@ -0,0 +1,251 @@
|
||||
- [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<Artist> Create(
|
||||
LibraryId libraryId,
|
||||
string name,
|
||||
Optional<string> website,
|
||||
Optional<MusicBrainzId> musicBrainzArtistId,
|
||||
List<MusicMediaContributor> contributors,
|
||||
List<Album> 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<Album> Create(
|
||||
AlbumMetadata metadata,
|
||||
Optional<MusicMediaFormat> mediaFormat,
|
||||
Optional<Barcode> barcode,
|
||||
Optional<string> catalogNumber,
|
||||
Optional<MusicBrainzId> musicBrainzReleaseId,
|
||||
Optional<MusicBrainzId> musicBrainzReleaseGroupId,
|
||||
Optional<MusicBrainzId> musicBrainzReleaseArtistId,
|
||||
List<MusicMediaContributor> contributors,
|
||||
List<AudioRating> ratings,
|
||||
List<Track> 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<Track> Create(
|
||||
LibraryId libraryId,
|
||||
string path,
|
||||
AudioMetadata metadata,
|
||||
int trackNumber,
|
||||
Optional<int> discNumber,
|
||||
List<Isrc> isrcs,
|
||||
Optional<string> script,
|
||||
Optional<MusicKey> key,
|
||||
Optional<int> bpm,
|
||||
List<Mood> moods,
|
||||
Optional<string> work,
|
||||
Optional<MusicBrainzId> musicBrainzRecordingId,
|
||||
Optional<MusicBrainzId> musicBrainzTrackId,
|
||||
Optional<MusicBrainzId> musicBrainzWorkId,
|
||||
List<MusicMediaContributor> contributors,
|
||||
List<AudioRating> 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
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
@@ -27,7 +27,7 @@ class Book
|
||||
Optional<string> barnesAndNobleId,
|
||||
Optional<string> appleBooksId,
|
||||
List<Isbn> isbns,
|
||||
List<MediaContributorId> contributors,
|
||||
List<BookMediaContributor> contributors,
|
||||
List<BookRating> ratings);
|
||||
}
|
||||
```
|
||||
@@ -46,7 +46,7 @@ class Book
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "uk",
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"genres": [
|
||||
@@ -99,7 +99,10 @@ class Book
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"value": "00000000-0000-0000-0000-000000000000",
|
||||
"contributorId": {
|
||||
"value": "00000000-0000-0000-0000-000000000000"
|
||||
},
|
||||
"role": "Author"
|
||||
}
|
||||
],
|
||||
"ratings": [
|
||||
|
||||
@@ -87,7 +87,7 @@ class ReleaseInfo
|
||||
```csharp
|
||||
class LanguageInfo
|
||||
{
|
||||
ErrorOr<LanguageInfo> Create(string languageCode, string languageName, Optional<string> nativeName);
|
||||
LanguageInfo Create(string languageCode, string languageName, Optional<string> nativeName);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
- _**File**_: The actual digital file of a media item
|
||||
- _**Stream**_: A media item accessed via streaming rather than local storage
|
||||
- _**Language Track**_: An audio or text track in a specific language
|
||||
- _**Media Contributor**_: A person, group, or organization that contributed to a media item, together with the role they played
|
||||
|
||||
## Video Content
|
||||
- _**TV Show**_: A series of episodes typically organized into seasons
|
||||
@@ -113,6 +114,7 @@
|
||||
- File
|
||||
- Stream
|
||||
- LanguageTrack
|
||||
- MediaContributor
|
||||
|
||||
## Aggregates
|
||||
- VideoLibrary (root: VideoLibrary, entities: TVShow, Season, Episode, Movie, FilmSeries, ConcertVideo, Documentary, TutorialVideo, HomeVideo, Anime, YouTubeVideo, MusicVideo)
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1 +0,0 @@
|
||||
GET {{host}}/api/v1/books?libraryId={{$guid}}
|
||||
@@ -1,2 +0,0 @@
|
||||
GET {{host}}/api/v1/books/lite?libraryId={{$guid}}¤tPage=1&perPage=10
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -1 +0,0 @@
|
||||
GET {{host}}/api/v1/books/{{$guid}}
|
||||
@@ -1,2 +0,0 @@
|
||||
GET {{host}}/api/v1/books/{{$guid}}/reading/availability
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -1,2 +0,0 @@
|
||||
GET {{host}}/api/v1/books/{{$guid}}/reading/manifest
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -1,2 +0,0 @@
|
||||
GET {{host}}/api/v1/books/{{$guid}}/reading/resources/0f4d6e2b1c9a4f3e8d7c6b5a4f3e2d1c
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -1,2 +0,0 @@
|
||||
GET {{host}}/api/v1/books/{{$guid}}/reading/sections/chapter1
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -1,2 +1,2 @@
|
||||
GET {{host}}/api/v1/directories/get-directories?path=C%3A%5CUsers%5C&includeHiddenElements=true
|
||||
GET {{host}}/api/v1/directories/get-directories?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -1,2 +1,2 @@
|
||||
GET {{host}}/api/v1/files/get-files?path=C%3A%5CUsers%5C&includeHiddenElements=true
|
||||
GET {{host}}/api/v1/files/get-files?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -1,2 +1,2 @@
|
||||
GET {{host}}/api/v1/files/get-tree-files?path=C%3A%5CUsers%5C&includeHiddenElements=true
|
||||
GET {{host}}/api/v1/files/get-tree-files?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -1,2 +1,2 @@
|
||||
GET {{host}}/api/v1/path/check-path-exists?path=C%3A%5CUsers%5C&includeHiddenElements=true
|
||||
GET {{host}}/api/v1/path/check-path-exists?path=C%3A%5CUsers%5C&shouldIncludeHiddenElements=true
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -0,0 +1,215 @@
|
||||
POST {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"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"
|
||||
},
|
||||
"releaseType": "Album",
|
||||
"releaseStatus": "Official",
|
||||
"totalDiscs": 1,
|
||||
"totalTracks": 12,
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Progressive Rock" }
|
||||
],
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "vinyl" }
|
||||
]
|
||||
},
|
||||
"mediaFormat": "CD",
|
||||
"barcode": "0042282778329",
|
||||
"catalogNumber": "EMC 4008",
|
||||
"musicBrainzReleaseId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
|
||||
"musicBrainzReleaseGroupId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
|
||||
"musicBrainzReleaseArtistId": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
|
||||
"contributors": [
|
||||
{ "contributorId": "0e7b4a6c-5f8d-6b9e-ca0b-3c4d5e6f7a8b", "role": "Producer" },
|
||||
{ "contributorId": "1a8c5b7d-6a9e-7c0f-db1c-4d5e6f7a8b9c", "role": "Engineer" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
],
|
||||
"tracks": [
|
||||
{
|
||||
"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.",
|
||||
"durationInSeconds": 354,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 980,
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1975-10-31",
|
||||
"originalReleaseYear": 1975,
|
||||
"reReleaseDate": null,
|
||||
"reReleaseYear": null,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "Original"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Progressive Rock" }
|
||||
],
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "epic" }
|
||||
]
|
||||
},
|
||||
"trackNumber": 1,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "CMajor",
|
||||
"bpm": 72,
|
||||
"work": "Bohemian Rhapsody",
|
||||
"musicBrainzRecordingId": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
|
||||
"musicBrainzTrackId": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
|
||||
"musicBrainzWorkId": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Vocals" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Guitar" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
],
|
||||
"moods": [
|
||||
{ "name": "dramatic" },
|
||||
{ "name": "anxious" }
|
||||
],
|
||||
"isrcs": [
|
||||
{ "value": "GBUM71029604" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "/music/queen/a-night-at-the-opera/07-youre-my-best-friend.flac",
|
||||
"metadata": {
|
||||
"title": "You're My Best Friend",
|
||||
"originalTitle": "You're My Best Friend",
|
||||
"description": "A song by the British rock band Queen, written by bass guitarist John Deacon. It was originally released on the album A Night at the Opera in 1975 and as a single in 1976.",
|
||||
"durationInSeconds": 181,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 912,
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1976-06-18",
|
||||
"originalReleaseYear": 1976,
|
||||
"reReleaseDate": null,
|
||||
"reReleaseYear": null,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "Original"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Pop Rock" }
|
||||
],
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "love" }
|
||||
]
|
||||
},
|
||||
"trackNumber": 7,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "BMajor",
|
||||
"bpm": 118,
|
||||
"work": "You're My Best Friend",
|
||||
"musicBrainzRecordingId": "0f3e4d5c-6b7a-4f8e-9d0c-1b2a3c4d5e6f",
|
||||
"musicBrainzTrackId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
|
||||
"musicBrainzWorkId": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Vocals" },
|
||||
{ "contributorId": "8c5f2e4a-3d6b-4f7c-ae8f-1a2b3c4d5e6f", "role": "BassGuitar" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.2,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 1234
|
||||
},
|
||||
{
|
||||
"value": 4.4,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 567
|
||||
}
|
||||
],
|
||||
"moods": [
|
||||
{ "name": "happy" },
|
||||
{ "name": "warm" }
|
||||
],
|
||||
"isrcs": [
|
||||
{ "value": "GBUM71029609" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
DELETE {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/{{$guid}}
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/{{$guid}}
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/{{$guid}}/tracks
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/{{$guid}}/tracks/lite?currentPage=1&perPage=10
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -0,0 +1,65 @@
|
||||
PUT {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/{{$guid}}
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"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"
|
||||
},
|
||||
"releaseType": "Album",
|
||||
"releaseStatus": "Official",
|
||||
"totalDiscs": 1,
|
||||
"totalTracks": 12,
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Progressive Rock" }
|
||||
],
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "vinyl" }
|
||||
]
|
||||
},
|
||||
"mediaFormat": "CD",
|
||||
"barcode": "0042282778329",
|
||||
"catalogNumber": "EMC 4008",
|
||||
"musicBrainzReleaseId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
|
||||
"musicBrainzReleaseGroupId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
|
||||
"musicBrainzReleaseArtistId": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
|
||||
"contributors": [
|
||||
{ "contributorId": "0e7b4a6c-5f8d-6b9e-ca0b-3c4d5e6f7a8b", "role": "Producer" },
|
||||
{ "contributorId": "1a8c5b7d-6a9e-7c0f-db1c-4d5e6f7a8b9c", "role": "Engineer" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
POST {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"name": "Queen",
|
||||
"website": "https://www.queenonline.com",
|
||||
"musicBrainzArtistId": "6f9c0b2a-1d3e-4a5b-8c7d-9e0f1a2b3c4d",
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Vocals" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Guitar" }
|
||||
],
|
||||
"albums": [
|
||||
{
|
||||
"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"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "vinyl" }
|
||||
],
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Progressive Rock" }
|
||||
],
|
||||
"releaseType": "Album",
|
||||
"releaseStatus": "Official",
|
||||
"totalDiscs": 1,
|
||||
"totalTracks": 12
|
||||
},
|
||||
"mediaFormat": "CD",
|
||||
"barcode": "0042282778329",
|
||||
"catalogNumber": "EMC 4008",
|
||||
"musicBrainzReleaseId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
|
||||
"musicBrainzReleaseGroupId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
|
||||
"musicBrainzReleaseArtistId": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
|
||||
"contributors": [
|
||||
{ "contributorId": "0e7b4a6c-5f8d-6b9e-ca0b-3c4d5e6f7a8b", "role": "Producer" },
|
||||
{ "contributorId": "1a8c5b7d-6a9e-7c0f-db1c-4d5e6f7a8b9c", "role": "Engineer" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
],
|
||||
"tracks": [
|
||||
{
|
||||
"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"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "epic" }
|
||||
],
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Progressive Rock" }
|
||||
],
|
||||
"durationInSeconds": 354,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 980
|
||||
},
|
||||
"trackNumber": 1,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "CMajor",
|
||||
"bpm": 72,
|
||||
"work": "Bohemian Rhapsody",
|
||||
"musicBrainzRecordingId": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
|
||||
"musicBrainzTrackId": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
|
||||
"musicBrainzWorkId": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
|
||||
"moods": [
|
||||
{ "name": "dramatic" },
|
||||
{ "name": "anxious" }
|
||||
],
|
||||
"isrcs": [
|
||||
{ "value": "GBUM71029604" }
|
||||
],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Vocals" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Guitar" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "/music/queen/a-night-at-the-opera/07-youre-my-best-friend.flac",
|
||||
"metadata": {
|
||||
"title": "You're My Best Friend",
|
||||
"originalTitle": "You're My Best Friend",
|
||||
"description": "A song by the British rock band Queen, written by bass guitarist John Deacon. It was originally released on the album A Night at the Opera in 1975 and as a single in 1976.",
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1976-06-18",
|
||||
"originalReleaseYear": 1976,
|
||||
"reReleaseDate": null,
|
||||
"reReleaseYear": null,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "Original"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "love" }
|
||||
],
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Pop Rock" }
|
||||
],
|
||||
"durationInSeconds": 181,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 912
|
||||
},
|
||||
"trackNumber": 7,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "BMajor",
|
||||
"bpm": 118,
|
||||
"work": "You're My Best Friend",
|
||||
"musicBrainzRecordingId": "0f3e4d5c-6b7a-4f8e-9d0c-1b2a3c4d5e6f",
|
||||
"musicBrainzTrackId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
|
||||
"musicBrainzWorkId": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
|
||||
"moods": [
|
||||
{ "name": "happy" },
|
||||
{ "name": "warm" }
|
||||
],
|
||||
"isrcs": [
|
||||
{ "value": "GBUM71029609" }
|
||||
],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Vocals" },
|
||||
{ "contributorId": "8c5f2e4a-3d6b-4f7c-ae8f-1a2b3c4d5e6f", "role": "BassGuitar" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.2,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 1234
|
||||
},
|
||||
{
|
||||
"value": 4.4,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 567
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
DELETE {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/{{$guid}}
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/{{$guid}}
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/{{$guid}}/albums
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/{{$guid}}/albums/lite?currentPage=1&perPage=10
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists?currentPage=1&perPage=10&searchTerm=queen
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/lite?currentPage=1&perPage=10&searchTerm=queen
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
PUT {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/{{$guid}}
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"name": "Queen",
|
||||
"website": "https://www.queenonline.com",
|
||||
"musicBrainzArtistId": "6f9c0b2a-1d3e-4a5b-8c7d-9e0f1a2b3c4d",
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Vocals" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Guitar" }
|
||||
],
|
||||
"albums": [
|
||||
{
|
||||
"albumId": "e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f",
|
||||
"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"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "vinyl" }
|
||||
],
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Progressive Rock" }
|
||||
],
|
||||
"releaseType": "Album",
|
||||
"releaseStatus": "Official",
|
||||
"totalDiscs": 1,
|
||||
"totalTracks": 12
|
||||
},
|
||||
"mediaFormat": "CD",
|
||||
"barcode": "0042282778329",
|
||||
"catalogNumber": "EMC 4008",
|
||||
"musicBrainzReleaseId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
|
||||
"musicBrainzReleaseGroupId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
|
||||
"musicBrainzReleaseArtistId": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
|
||||
"contributors": [
|
||||
{ "contributorId": "0e7b4a6c-5f8d-6b9e-ca0b-3c4d5e6f7a8b", "role": "Producer" },
|
||||
{ "contributorId": "1a8c5b7d-6a9e-7c0f-db1c-4d5e6f7a8b9c", "role": "Engineer" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
],
|
||||
"tracks": [
|
||||
{
|
||||
"trackId": "9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f",
|
||||
"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"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "epic" }
|
||||
],
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Progressive Rock" }
|
||||
],
|
||||
"durationInSeconds": 354,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 980
|
||||
},
|
||||
"trackNumber": 1,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "CMajor",
|
||||
"bpm": 72,
|
||||
"work": "Bohemian Rhapsody",
|
||||
"musicBrainzRecordingId": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
|
||||
"musicBrainzTrackId": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
|
||||
"musicBrainzWorkId": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
|
||||
"moods": [
|
||||
{ "name": "dramatic" },
|
||||
{ "name": "anxious" }
|
||||
],
|
||||
"isrcs": [
|
||||
{ "value": "GBUM71029604" }
|
||||
],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Vocals" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Guitar" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"trackId": "8e1f2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b",
|
||||
"path": "/music/queen/a-night-at-the-opera/07-youre-my-best-friend.flac",
|
||||
"metadata": {
|
||||
"title": "You're My Best Friend",
|
||||
"originalTitle": "You're My Best Friend",
|
||||
"description": "A song by the British rock band Queen, written by bass guitarist John Deacon. It was originally released on the album A Night at the Opera in 1975 and as a single in 1976.",
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1976-06-18",
|
||||
"originalReleaseYear": 1976,
|
||||
"reReleaseDate": null,
|
||||
"reReleaseYear": null,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "Original"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "love" }
|
||||
],
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Pop Rock" }
|
||||
],
|
||||
"durationInSeconds": 181,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 912
|
||||
},
|
||||
"trackNumber": 7,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "BMajor",
|
||||
"bpm": 118,
|
||||
"work": "You're My Best Friend",
|
||||
"musicBrainzRecordingId": "0f3e4d5c-6b7a-4f8e-9d0c-1b2a3c4d5e6f",
|
||||
"musicBrainzTrackId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
|
||||
"musicBrainzWorkId": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
|
||||
"moods": [
|
||||
{ "name": "happy" },
|
||||
{ "name": "warm" }
|
||||
],
|
||||
"isrcs": [
|
||||
{ "value": "GBUM71029609" }
|
||||
],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Vocals" },
|
||||
{ "contributorId": "8c5f2e4a-3d6b-4f7c-ae8f-1a2b3c4d5e6f", "role": "BassGuitar" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.2,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 1234
|
||||
},
|
||||
{
|
||||
"value": 4.4,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 567
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
POST {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/tracks
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"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.",
|
||||
"durationInSeconds": 354,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 980,
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1975-10-31",
|
||||
"originalReleaseYear": 1975,
|
||||
"reReleaseDate": null,
|
||||
"reReleaseYear": null,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "Original"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Progressive Rock" }
|
||||
],
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "epic" }
|
||||
]
|
||||
},
|
||||
"trackNumber": 1,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "CMajor",
|
||||
"bpm": 72,
|
||||
"work": "Bohemian Rhapsody",
|
||||
"musicBrainzRecordingId": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
|
||||
"musicBrainzTrackId": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
|
||||
"musicBrainzWorkId": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
|
||||
"moods": [
|
||||
{ "name": "dramatic" },
|
||||
{ "name": "anxious" }
|
||||
],
|
||||
"isrcs": [
|
||||
{ "value": "GBUM71029604" }
|
||||
],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Vocals" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Guitar" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
DELETE {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/tracks/{{$guid}}
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/tracks/{{$guid}}
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -0,0 +1,78 @@
|
||||
PUT {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/tracks/{{$guid}}
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"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.",
|
||||
"durationInSeconds": 354,
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"audioCodec": "FLAC",
|
||||
"bitrate": 980,
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1975-10-31",
|
||||
"originalReleaseYear": 1975,
|
||||
"reReleaseDate": null,
|
||||
"reReleaseYear": null,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "Original"
|
||||
},
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"genres": [
|
||||
{ "name": "Rock" },
|
||||
{ "name": "Progressive Rock" }
|
||||
],
|
||||
"tags": [
|
||||
{ "name": "classic" },
|
||||
{ "name": "epic" }
|
||||
]
|
||||
},
|
||||
"trackNumber": 1,
|
||||
"discNumber": 1,
|
||||
"script": "Latn",
|
||||
"key": "CMajor",
|
||||
"bpm": 72,
|
||||
"work": "Bohemian Rhapsody",
|
||||
"musicBrainzRecordingId": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
|
||||
"musicBrainzTrackId": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
|
||||
"musicBrainzWorkId": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
|
||||
"moods": [
|
||||
{ "name": "dramatic" },
|
||||
{ "name": "anxious" }
|
||||
],
|
||||
"isrcs": [
|
||||
{ "value": "GBUM71029604" }
|
||||
],
|
||||
"contributors": [
|
||||
{ "contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d", "role": "Vocals" },
|
||||
{ "contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e", "role": "Guitar" }
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"value": 4.5,
|
||||
"maxValue": 5,
|
||||
"source": "MusicBrainz",
|
||||
"voteCount": 2345
|
||||
},
|
||||
{
|
||||
"value": 4.8,
|
||||
"maxValue": 5,
|
||||
"source": "LastFm",
|
||||
"voteCount": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+91
@@ -0,0 +1,91 @@
|
||||
POST {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"path": "/media/libraries/books/the-fellowship-of-the-ring.pdf",
|
||||
"metadata": {
|
||||
"title": "The Fellowship of the Ring",
|
||||
"originalTitle": "The Fellowship of the Ring",
|
||||
"description": "The first part of J.R.R. Tolkien's epic adventure The Lord of the Rings. In a sleepy village in the Shire, young Frodo Baggins finds himself faced with an immense task, as his elderly cousin Bilbo entrusts the Ring to his care. Frodo must leave his home and make a perilous journey across Middle-earth to the Cracks of Doom, there to destroy the Ring and foil the Dark Lord in his evil purpose.",
|
||||
"releaseInfo": {
|
||||
"originalReleaseDate": "1954-07-29",
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"genres": [
|
||||
{ "name": "fantasy" },
|
||||
{ "name": "adventure" },
|
||||
{ "name": "classic" }
|
||||
],
|
||||
"tags": [
|
||||
{ "name": "epic fantasy" },
|
||||
{ "name": "quest" },
|
||||
{ "name": "middle-earth" }
|
||||
],
|
||||
"language": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"originalLanguage": {
|
||||
"languageCode": "en",
|
||||
"languageName": "English",
|
||||
"nativeName": "English"
|
||||
},
|
||||
"publisher": "Houghton Mifflin",
|
||||
"pageCount": 398
|
||||
},
|
||||
"format": "Paperback",
|
||||
"edition": "50th Anniversary Edition",
|
||||
"volumeNumber": 1,
|
||||
"series": {
|
||||
"title": "The Lord of the Rings"
|
||||
},
|
||||
"asin": "B007978NPG",
|
||||
"goodreadsId": "3",
|
||||
"lccn": "54009621",
|
||||
"oclcNumber": "ocm00012345",
|
||||
"openLibraryId": "OL7603910M",
|
||||
"libraryThingId": "3203347",
|
||||
"googleBooksId": "aWZzLPhY4o0C",
|
||||
"barnesAndNobleId": "1100307790",
|
||||
"appleBooksId": "id395211",
|
||||
"isbns": [
|
||||
{
|
||||
"value": "0395272238",
|
||||
"format": "Isbn10"
|
||||
},
|
||||
{
|
||||
"value": "9780395272237",
|
||||
"format": "Isbn13"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d",
|
||||
"role": "Author"
|
||||
},
|
||||
{
|
||||
"contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e",
|
||||
"role": "Illustrator"
|
||||
}
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
},
|
||||
{
|
||||
"source": "Amazon",
|
||||
"value": 4.7,
|
||||
"maxValue": 5,
|
||||
"voteCount": 87654
|
||||
}
|
||||
]
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{{$guid}}
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books?currentPage=1&perPage=10&searchTerm=fellowship&sortBy=title&sortOrder=Ascending
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/lite?currentPage=1&perPage=10&searchTerm=fellowship&filterAlphaKey=f&shouldIgnoreThePrefixForAlphaPicker=true&sortBy=title&sortOrder=Ascending
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
+13
-20
@@ -1,9 +1,8 @@
|
||||
POST {{host}}/api/v1/books
|
||||
PUT {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{{$guid}}
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
|
||||
"path": "/books/the-fellowship-of-the-ring.pdf",
|
||||
"metadata": {
|
||||
"title": "The Fellowship of the Ring",
|
||||
"originalTitle": "The Fellowship of the Ring",
|
||||
@@ -13,7 +12,7 @@ Content-Type: application/json
|
||||
"originalReleaseYear": 1954,
|
||||
"reReleaseDate": "2001-09-06",
|
||||
"reReleaseYear": 2001,
|
||||
"releaseCountry": "uk",
|
||||
"releaseCountry": "GB",
|
||||
"releaseVersion": "50th Anniversary Edition"
|
||||
},
|
||||
"genres": [
|
||||
@@ -56,33 +55,27 @@ Content-Type: application/json
|
||||
"appleBooksId": "id395211",
|
||||
"isbns": [
|
||||
{
|
||||
"value": "0395272238",
|
||||
"format": "Isbn10"
|
||||
"value": "0395272238",
|
||||
"format": "Isbn10"
|
||||
},
|
||||
{
|
||||
"value": "9780395272237",
|
||||
"format": "Isbn13"
|
||||
"value": "9780395272237",
|
||||
"format": "Isbn13"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"name": "J.R.R. Tolkien",
|
||||
"role": {
|
||||
"name": "author",
|
||||
"category": "book"
|
||||
}
|
||||
"contributorId": "6a3f0c2d-1b4e-4f5a-8c6d-9e0f1a2b3c4d",
|
||||
"role": "Author"
|
||||
},
|
||||
{
|
||||
"name": "Alan Lee",
|
||||
"role": {
|
||||
"name": "illustrator",
|
||||
"category": "book"
|
||||
}
|
||||
"contributorId": "7b4e1d3f-2c5a-4e6b-9d7e-0f1a2b3c4d5e",
|
||||
"role": "Illustrator"
|
||||
}
|
||||
],
|
||||
"ratings": [
|
||||
{
|
||||
"source": "Goodreads",
|
||||
"source": "GoogleBooks",
|
||||
"value": 4.36,
|
||||
"maxValue": 5,
|
||||
"voteCount": 2345678
|
||||
@@ -94,4 +87,4 @@ Content-Type: application/json
|
||||
"voteCount": 87654
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
PUT {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{{$guid}}/cover
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
Content-Type: multipart/form-data; boundary=LuminaBoundary
|
||||
|
||||
--LuminaBoundary
|
||||
Content-Disposition: form-data; name="cover"; filename="cover.jpg"
|
||||
Content-Type: image/jpeg
|
||||
|
||||
< ./cover.jpg
|
||||
--LuminaBoundary--
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{{$guid}}/reading/availability
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{{$guid}}/reading/manifest
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{{$guid}}/reading/resources/0f4d6e2b1c9a4f3e8d7c6b5a4f3e2d1c
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/books/{{$guid}}/reading/sections/chapter1
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/{{$guid}}/artwork-providers
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
@@ -0,0 +1,11 @@
|
||||
PUT {{host}}/api/v1/libraries/{{$guid}}/artwork-providers/reorder
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"libraryId": "{{$guid}}",
|
||||
"pluginIds": [
|
||||
"{{$guid}}",
|
||||
"{{$guid}}"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
PUT {{host}}/api/v1/libraries/{{$guid}}/artwork-providers/{{$guid}}/enabled
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"libraryId": "{{$guid}}",
|
||||
"pluginId": "{{$guid}}",
|
||||
"isEnabled": true
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,6 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Contracts.DTO.Common;
|
||||
using Lumina.Contracts.DTO.MediaContributors;
|
||||
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary;
|
||||
using Lumina.Contracts.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
|
||||
@@ -68,7 +67,7 @@ internal static class CalibreMapper
|
||||
/// <returns>The release information of the book, always present even when the publication date is missing.</returns>
|
||||
private static ReleaseInfoDto BuildReleaseInfo(DateTimeOffset? publishDate)
|
||||
{
|
||||
// the release info must always be present, even when the publication date is missing, so that the metadata can be applied to the book
|
||||
// The release info must always be present, even when the publication date is missing, so that the metadata can be applied to the book.
|
||||
if (publishDate is null)
|
||||
{
|
||||
return new ReleaseInfoDto(
|
||||
@@ -124,20 +123,20 @@ internal static class CalibreMapper
|
||||
List<MediaContributorDto> result = [];
|
||||
HashSet<string> seen = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
void Add(string? displayName, string role, MediaContributorRoleCategory category)
|
||||
void Add(string? displayName, MediaContributorRole role)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(displayName) || !seen.Add($"{displayName}|{role}"))
|
||||
return;
|
||||
result.Add(new MediaContributorDto(
|
||||
Name: new MediaContributorNameDto(DisplayName: displayName.Trim(), LegalName: null),
|
||||
Role: new MediaContributorRoleDto(Name: role, Category: category))
|
||||
Role: role)
|
||||
);
|
||||
}
|
||||
|
||||
foreach (OpfCreatorDto creator in creators)
|
||||
Add(creator.Name, "Author", MediaContributorRoleCategory.Author);
|
||||
Add(creator.Name, MediaContributorRole.Author);
|
||||
foreach (OpfContributorDto contributor in contributors)
|
||||
Add(contributor.Name, MapContributorRole(contributor.Role), MapContributorCategory(contributor.Role));
|
||||
Add(contributor.Name, MapContributorRole(contributor.Role));
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -189,7 +188,7 @@ internal static class CalibreMapper
|
||||
private static string? NormalizeIsbn(string isbn)
|
||||
{
|
||||
string normalized = new string([.. isbn.Where(character => character is not '-' && !char.IsWhiteSpace(character))]).ToUpperInvariant();
|
||||
// valid ISBNs must be 10 or 13 characters in length, all characters except the last one must be digits, and the last one must be a digit for ISBN-13 and X for ISBN-10
|
||||
// Valid ISBNs must be 10 or 13 characters in length, all characters except the last one must be digits, and the last one must be a digit for ISBN-13 and X for ISBN-10.
|
||||
if ((normalized.Length != 10 && normalized.Length != 13) ||
|
||||
normalized[..^1].Any(character => !char.IsDigit(character)) ||
|
||||
(!char.IsDigit(normalized[^1]) && !(normalized.Length == 10 && normalized[^1] == 'X')))
|
||||
@@ -214,30 +213,20 @@ internal static class CalibreMapper
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Maps a creator or contributor role code into a role name.
|
||||
/// Maps a creator or contributor role code into the canonical role.
|
||||
/// </summary>
|
||||
/// <param name="role">The role code to map.</param>
|
||||
/// <returns>The mapped role name.</returns>
|
||||
private static string MapContributorRole(string? role)
|
||||
{
|
||||
return string.Equals(role, "aut", StringComparison.OrdinalIgnoreCase) ? "Author" : string.IsNullOrWhiteSpace(role) ? "Contributor" : role;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Maps a creator or contributor role code into the canonical category of the role.
|
||||
/// </summary>
|
||||
/// <param name="role">The role code to map.</param>
|
||||
/// <returns>The canonical category of the role.</returns>
|
||||
private static MediaContributorRoleCategory MapContributorCategory(string? role)
|
||||
/// <returns>The canonical role.</returns>
|
||||
private static MediaContributorRole MapContributorRole(string? role)
|
||||
{
|
||||
if (string.Equals(role, "aut", StringComparison.OrdinalIgnoreCase) || role?.Contains("author", StringComparison.OrdinalIgnoreCase) == true)
|
||||
return MediaContributorRoleCategory.Author;
|
||||
return MediaContributorRole.Author;
|
||||
if (string.Equals(role, "ill", StringComparison.OrdinalIgnoreCase))
|
||||
return MediaContributorRoleCategory.Illustrator;
|
||||
return MediaContributorRole.Illustrator;
|
||||
if (string.Equals(role, "trl", StringComparison.OrdinalIgnoreCase))
|
||||
return MediaContributorRoleCategory.Translator;
|
||||
return MediaContributorRole.Translator;
|
||||
if (string.Equals(role, "bkp", StringComparison.OrdinalIgnoreCase))
|
||||
return MediaContributorRoleCategory.Publisher;
|
||||
return MediaContributorRoleCategory.Other;
|
||||
return MediaContributorRole.Publisher;
|
||||
return MediaContributorRole.Other;
|
||||
}
|
||||
}
|
||||
@@ -59,8 +59,8 @@ internal static partial class OpenLibraryMapper
|
||||
/// <param name="authors">The authors of the book.</param>
|
||||
/// <param name="ratings">The ratings of the book, or <see langword="null"/> when no ratings were found.</param>
|
||||
/// <param name="fallback">The search document used as a fallback source of data, or <see langword="null"/>.</param>
|
||||
/// <returns>The mapped book request.</returns>
|
||||
public static AddBookRequest MapDetailed(
|
||||
/// <returns>The mapped book metadata.</returns>
|
||||
public static BookMetadataDto MapDetailed(
|
||||
BookMetadataLookupDto lookup,
|
||||
OpenLibraryEditionResponse? edition,
|
||||
OpenLibraryWorkResponse? work,
|
||||
@@ -99,26 +99,23 @@ internal static partial class OpenLibraryMapper
|
||||
string? releaseCountry = edition?.PublishPlaces.FirstOrDefault() ?? fallback?.PublishPlaces.FirstOrDefault();
|
||||
string? releaseVersion = edition?.EditionName;
|
||||
|
||||
return new AddBookRequest(
|
||||
lookup.LibraryId,
|
||||
lookup.Path,
|
||||
new WrittenContentMetadataDto(
|
||||
title,
|
||||
work?.OriginalTitle,
|
||||
description,
|
||||
new ReleaseInfoDto(
|
||||
originalRelease.Date,
|
||||
originalYear,
|
||||
editionRelease.Date,
|
||||
editionRelease.Date?.Year ?? editionRelease.Year,
|
||||
MapReleaseCountry(releaseCountry),
|
||||
NullIfWhiteSpace(releaseVersion)),
|
||||
[.. genreNames.Select(name => new GenreDto(name))],
|
||||
[.. subjects.Select(name => new TagDto(name))],
|
||||
MapLanguage(currentLanguageCode),
|
||||
MapLanguage(originalLanguageCode),
|
||||
edition?.Publishers.FirstOrDefault() ?? fallback?.Publishers.FirstOrDefault(),
|
||||
edition?.NumberOfPages ?? fallback?.NumberOfPagesMedian),
|
||||
return new BookMetadataDto(
|
||||
title,
|
||||
work?.OriginalTitle,
|
||||
description,
|
||||
new ReleaseInfoDto(
|
||||
originalRelease.Date,
|
||||
originalYear,
|
||||
editionRelease.Date,
|
||||
editionRelease.Date?.Year ?? editionRelease.Year,
|
||||
MapReleaseCountry(releaseCountry),
|
||||
NullIfWhiteSpace(releaseVersion)),
|
||||
[.. genreNames.Select(name => new GenreDto(name))],
|
||||
[.. subjects.Select(name => new TagDto(name))],
|
||||
MapLanguage(currentLanguageCode),
|
||||
MapLanguage(originalLanguageCode),
|
||||
edition?.Publishers.FirstOrDefault() ?? fallback?.Publishers.FirstOrDefault(),
|
||||
edition?.NumberOfPages ?? fallback?.NumberOfPagesMedian,
|
||||
MapFormat(edition?.PhysicalFormat),
|
||||
NullIfWhiteSpace(edition?.EditionName),
|
||||
ParseVolumeNumber(edition?.Volume, edition?.Series.FirstOrDefault()),
|
||||
@@ -134,7 +131,8 @@ internal static partial class OpenLibraryMapper
|
||||
NullIfWhiteSpace(appleBooksId),
|
||||
isbns,
|
||||
contributors,
|
||||
mappedRatings);
|
||||
mappedRatings,
|
||||
CoverImagePath: null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -142,8 +140,8 @@ internal static partial class OpenLibraryMapper
|
||||
/// </summary>
|
||||
/// <param name="lookup">The lookup describing the book to map.</param>
|
||||
/// <param name="document">The search document to map.</param>
|
||||
/// <returns>The mapped book request candidate.</returns>
|
||||
public static AddBookRequest MapSearchCandidate(BookMetadataLookupDto lookup, OpenLibrarySearchDocumentResponse document)
|
||||
/// <returns>The mapped book metadata candidate.</returns>
|
||||
public static BookMetadataDto MapSearchCandidate(BookMetadataLookupDto lookup, OpenLibrarySearchDocumentResponse document)
|
||||
{
|
||||
return MapDetailed(lookup, null, null, [], null, document);
|
||||
}
|
||||
@@ -274,24 +272,24 @@ internal static partial class OpenLibraryMapper
|
||||
List<MediaContributorDto> result = [];
|
||||
HashSet<string> seen = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
void Add(string? displayName, string? legalName, string role, MediaContributorRoleCategory category)
|
||||
void Add(string? displayName, string? legalName, MediaContributorRole role)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(displayName) || !seen.Add($"{displayName}|{role}"))
|
||||
return;
|
||||
result.Add(new MediaContributorDto(new MediaContributorNameDto(displayName.Trim(), NullIfWhiteSpace(legalName)), new MediaContributorRoleDto(role, category)));
|
||||
result.Add(new MediaContributorDto(new MediaContributorNameDto(displayName.Trim(), NullIfWhiteSpace(legalName)), role));
|
||||
}
|
||||
|
||||
foreach (OpenLibraryAuthorResponse author in authors)
|
||||
Add(author.Name, author.PersonalName, "Author", MediaContributorRoleCategory.Author);
|
||||
Add(author.Name, author.PersonalName, MediaContributorRole.Author);
|
||||
foreach (string authorName in fallbackAuthors ?? [])
|
||||
Add(authorName, null, "Author", MediaContributorRoleCategory.Author);
|
||||
Add(authorName, null, MediaContributorRole.Author);
|
||||
|
||||
foreach (string contribution in contributions ?? [])
|
||||
{
|
||||
Match match = ContributorPattern().Match(contribution);
|
||||
string name = match.Success ? match.Groups["name"].Value.Trim() : contribution.Trim();
|
||||
string role = match.Success ? match.Groups["role"].Value.Trim() : "Contributor";
|
||||
Add(name, null, role, ContributorCategory(role));
|
||||
string role = match.Success ? match.Groups["role"].Value.Trim() : string.Empty;
|
||||
Add(name, null, ContributorRole(role));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -505,24 +503,24 @@ internal static partial class OpenLibraryMapper
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Maps a contribution role into the canonical category of the role.
|
||||
/// Maps a contribution role into the canonical role.
|
||||
/// </summary>
|
||||
/// <param name="role">The role to categorize.</param>
|
||||
/// <returns>The canonical category of the role.</returns>
|
||||
private static MediaContributorRoleCategory ContributorCategory(string role)
|
||||
/// <param name="role">The role to map.</param>
|
||||
/// <returns>The canonical role.</returns>
|
||||
private static MediaContributorRole ContributorRole(string role)
|
||||
{
|
||||
if (role.Contains("illustr", StringComparison.OrdinalIgnoreCase) ||
|
||||
role.Contains("artist", StringComparison.OrdinalIgnoreCase))
|
||||
return MediaContributorRoleCategory.Illustrator;
|
||||
return MediaContributorRole.Illustrator;
|
||||
if (role.Contains("translat", StringComparison.OrdinalIgnoreCase))
|
||||
return MediaContributorRoleCategory.Translator;
|
||||
return MediaContributorRole.Translator;
|
||||
if (role.Contains("narrat", StringComparison.OrdinalIgnoreCase))
|
||||
return MediaContributorRoleCategory.Narrator;
|
||||
return MediaContributorRole.Narrator;
|
||||
if (role.Contains("edit", StringComparison.OrdinalIgnoreCase) ||
|
||||
role.Contains("author", StringComparison.OrdinalIgnoreCase) ||
|
||||
role.Contains("writer", StringComparison.OrdinalIgnoreCase))
|
||||
return MediaContributorRoleCategory.Author;
|
||||
return MediaContributorRoleCategory.Other;
|
||||
return MediaContributorRole.Author;
|
||||
return MediaContributorRole.Other;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -65,75 +65,15 @@ internal sealed class OpenLibraryBookMetadataProvider : IMetadataProvider<BookMe
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(bookMetadataLookup.Isbn) || !string.IsNullOrWhiteSpace(bookMetadataLookup.OpenLibraryId))
|
||||
{
|
||||
AddBookRequest? exactBookRequestMatch = await GetBookAsync(bookMetadataLookup, cancellationToken).ConfigureAwait(false);
|
||||
return exactBookRequestMatch is null ? [] : [new BookMetadataDto(
|
||||
exactBookRequestMatch.Metadata?.Title,
|
||||
exactBookRequestMatch.Metadata?.OriginalTitle,
|
||||
exactBookRequestMatch.Metadata?.Description,
|
||||
exactBookRequestMatch.Metadata?.ReleaseInfo,
|
||||
exactBookRequestMatch.Metadata?.Genres,
|
||||
exactBookRequestMatch.Metadata?.Tags,
|
||||
exactBookRequestMatch.Metadata?.Language,
|
||||
exactBookRequestMatch.Metadata?.OriginalLanguage,
|
||||
exactBookRequestMatch.Metadata?.Publisher,
|
||||
exactBookRequestMatch.Metadata?.PageCount,
|
||||
exactBookRequestMatch.Format,
|
||||
exactBookRequestMatch.Edition,
|
||||
exactBookRequestMatch.VolumeNumber,
|
||||
exactBookRequestMatch.Series,
|
||||
exactBookRequestMatch.ASIN,
|
||||
exactBookRequestMatch.GoodreadsId,
|
||||
exactBookRequestMatch.LCCN,
|
||||
exactBookRequestMatch.OCLCNumber,
|
||||
exactBookRequestMatch.OpenLibraryId,
|
||||
exactBookRequestMatch.LibraryThingId,
|
||||
exactBookRequestMatch.GoogleBooksId,
|
||||
exactBookRequestMatch.BarnesAndNobleId,
|
||||
exactBookRequestMatch.AppleBooksId,
|
||||
exactBookRequestMatch.ISBNs,
|
||||
exactBookRequestMatch.Contributors,
|
||||
exactBookRequestMatch.Ratings,
|
||||
CoverImagePath: null
|
||||
)];
|
||||
BookMetadataDto? exactBookMatch = await GetBookAsync(bookMetadataLookup, cancellationToken).ConfigureAwait(false);
|
||||
return exactBookMatch is null ? [] : [exactBookMatch];
|
||||
}
|
||||
|
||||
IReadOnlyList<OpenLibrarySearchDocumentResponse> openLibrarySearchDocuments = await _openLibraryHttpClient.SearchAsync(bookMetadataLookup, settings.SearchResultLimit, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
return [.. openLibrarySearchDocuments
|
||||
.Where(openLibrarySearchDocument => !string.IsNullOrWhiteSpace(openLibrarySearchDocument.Title))
|
||||
.Select(openLibrarySearchDocument =>
|
||||
{
|
||||
AddBookRequest addBookRequest = OpenLibraryMapper.MapSearchCandidate(bookMetadataLookup, openLibrarySearchDocument);
|
||||
return new BookMetadataDto(
|
||||
addBookRequest.Metadata?.Title,
|
||||
addBookRequest.Metadata?.OriginalTitle,
|
||||
addBookRequest.Metadata?.Description,
|
||||
addBookRequest.Metadata?.ReleaseInfo,
|
||||
addBookRequest.Metadata?.Genres,
|
||||
addBookRequest.Metadata?.Tags,
|
||||
addBookRequest.Metadata?.Language,
|
||||
addBookRequest.Metadata?.OriginalLanguage,
|
||||
addBookRequest.Metadata?.Publisher,
|
||||
addBookRequest.Metadata?.PageCount,
|
||||
addBookRequest.Format,
|
||||
addBookRequest.Edition,
|
||||
addBookRequest.VolumeNumber,
|
||||
addBookRequest.Series,
|
||||
addBookRequest.ASIN,
|
||||
addBookRequest.GoodreadsId,
|
||||
addBookRequest.LCCN,
|
||||
addBookRequest.OCLCNumber,
|
||||
addBookRequest.OpenLibraryId,
|
||||
addBookRequest.LibraryThingId,
|
||||
addBookRequest.GoogleBooksId,
|
||||
addBookRequest.BarnesAndNobleId,
|
||||
addBookRequest.AppleBooksId,
|
||||
addBookRequest.ISBNs,
|
||||
addBookRequest.Contributors,
|
||||
addBookRequest.Ratings,
|
||||
CoverImagePath: null
|
||||
);
|
||||
})];
|
||||
.Select(openLibrarySearchDocument => OpenLibraryMapper.MapSearchCandidate(bookMetadataLookup, openLibrarySearchDocument))];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -144,45 +84,16 @@ internal sealed class OpenLibraryBookMetadataProvider : IMetadataProvider<BookMe
|
||||
/// <returns>The metadata of the media item, or <see langword="null"/> when no metadata was found.</returns>
|
||||
public async Task<BookMetadataDto?> GetMetadataAsync(BookMetadataLookupDto bookMetadataLookup, CancellationToken cancellationToken)
|
||||
{
|
||||
AddBookRequest? exactBookRequestMatch = await GetBookAsync(bookMetadataLookup, cancellationToken).ConfigureAwait(false);
|
||||
return exactBookRequestMatch is null ? null : new BookMetadataDto(
|
||||
exactBookRequestMatch.Metadata?.Title,
|
||||
exactBookRequestMatch.Metadata?.OriginalTitle,
|
||||
exactBookRequestMatch.Metadata?.Description,
|
||||
exactBookRequestMatch.Metadata?.ReleaseInfo,
|
||||
exactBookRequestMatch.Metadata?.Genres,
|
||||
exactBookRequestMatch.Metadata?.Tags,
|
||||
exactBookRequestMatch.Metadata?.Language,
|
||||
exactBookRequestMatch.Metadata?.OriginalLanguage,
|
||||
exactBookRequestMatch.Metadata?.Publisher,
|
||||
exactBookRequestMatch.Metadata?.PageCount,
|
||||
exactBookRequestMatch.Format,
|
||||
exactBookRequestMatch.Edition,
|
||||
exactBookRequestMatch.VolumeNumber,
|
||||
exactBookRequestMatch.Series,
|
||||
exactBookRequestMatch.ASIN,
|
||||
exactBookRequestMatch.GoodreadsId,
|
||||
exactBookRequestMatch.LCCN,
|
||||
exactBookRequestMatch.OCLCNumber,
|
||||
exactBookRequestMatch.OpenLibraryId,
|
||||
exactBookRequestMatch.LibraryThingId,
|
||||
exactBookRequestMatch.GoogleBooksId,
|
||||
exactBookRequestMatch.BarnesAndNobleId,
|
||||
exactBookRequestMatch.AppleBooksId,
|
||||
exactBookRequestMatch.ISBNs,
|
||||
exactBookRequestMatch.Contributors,
|
||||
exactBookRequestMatch.Ratings,
|
||||
CoverImagePath: null
|
||||
);
|
||||
return await GetBookAsync(bookMetadataLookup, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resolves the lookup into a full book request by combining edition, work, author, and rating data from Open Library.
|
||||
/// Resolves the lookup into full book metadata by combining edition, work, author, and rating data from Open Library.
|
||||
/// </summary>
|
||||
/// <param name="bookMetadataLookup">The lookup describing the book to resolve.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>The resolved book request, or <see langword="null"/> when no matching book was found.</returns>
|
||||
public async Task<AddBookRequest?> GetBookAsync(BookMetadataLookupDto bookMetadataLookup, CancellationToken cancellationToken = default)
|
||||
/// <returns>The resolved book metadata, or <see langword="null"/> when no matching book was found.</returns>
|
||||
public async Task<BookMetadataDto?> GetBookAsync(BookMetadataLookupDto bookMetadataLookup, CancellationToken cancellationToken = default)
|
||||
{
|
||||
ValidateLookup(bookMetadataLookup);
|
||||
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
|
||||
|
||||
/// <summary>
|
||||
/// Lightweight read model of an album, containing only the fields needed to display the album in a card-based grid or a list.
|
||||
/// </summary>
|
||||
public sealed record AlbumLiteRow
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Id of the album.
|
||||
/// </summary>
|
||||
public required Guid Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the title of the album.
|
||||
/// </summary>
|
||||
public required string Title { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of tracks of the release.
|
||||
/// </summary>
|
||||
public int TotalTracks { get; init; }
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
|
||||
|
||||
/// <summary>
|
||||
/// Lightweight read model of an artist, containing only the fields needed to display the artist in a card-based grid or a list.
|
||||
/// </summary>
|
||||
public sealed record ArtistLiteRow
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Id of the artist.
|
||||
/// </summary>
|
||||
public required Guid Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the artist.
|
||||
/// </summary>
|
||||
public required string Name { get; init; }
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
|
||||
|
||||
/// <summary>
|
||||
/// Lightweight read model of a track, containing only the fields needed to display the track in a list.
|
||||
/// </summary>
|
||||
public sealed record TrackLiteRow
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Id of the track.
|
||||
/// </summary>
|
||||
public required Guid Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the title of the track.
|
||||
/// </summary>
|
||||
public required string Title { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of the track on its disc.
|
||||
/// </summary>
|
||||
public int TrackNumber { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of the disc the track belongs to, if applicable.
|
||||
/// </summary>
|
||||
public int? DiscNumber { get; init; }
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DTO.MediaLibrary.WrittenContentLibrary.BookLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Lightweight read model of a book, containing only the fields needed to display the book in a card-based grid or a list.
|
||||
/// </summary>
|
||||
public sealed record BookLiteRow
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Id of the book.
|
||||
/// </summary>
|
||||
public required Guid Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the title of the book.
|
||||
/// </summary>
|
||||
public required string Title { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the release year of the book (re-release year, if available, or original release year), if known.
|
||||
/// </summary>
|
||||
public int? ReleaseYear { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path of the image representing the cover of the book, if available.
|
||||
/// </summary>
|
||||
public string? CoverPath { get; init; }
|
||||
}
|
||||
@@ -11,4 +11,4 @@ namespace Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
[DebuggerDisplay("Name: {Name}")]
|
||||
public record GenreEntity(
|
||||
string? Name
|
||||
);
|
||||
) : ISharedReferenceEntity;
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for a shared reference entity, whose identity is its name and whose rows are shared across the whole storage medium instead of being owned by a single parent.
|
||||
/// </summary>
|
||||
public interface ISharedReferenceEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name that identifies the shared reference.
|
||||
/// </summary>
|
||||
string? Name { get; }
|
||||
}
|
||||
@@ -11,4 +11,4 @@ namespace Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
[DebuggerDisplay("Name: {Name}")]
|
||||
public record TagEntity(
|
||||
string? Name
|
||||
);
|
||||
) : ISharedReferenceEntity;
|
||||
Loaded 100 of 1540 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user