Adds music page play affordances and shuffle playback

Adds play and shuffle actions to music library, artist, and album cards.

Adds the library play context and the uniform shuffle endpoint.

Expands the player bar with queue covers, now playing details, and release type.

Updates the bundled themes, API documentation, and the user manual.
This commit is contained in:
BinaryAlley committed 2026-10-19 17:49:00 +03:00
1 parent 93821a2776
commit 067e9a21d0
132 files changed
+2935 -715

No files matched your search

+3 -1
View File
@@ -69,10 +69,12 @@ Opening a music library shows a page with the library title, a search box, a sor
- **The alpha picker** jumps to names starting with a chosen character. It offers All, then the number and symbol keys, then A to Z. You can also press a letter key to filter, and press Escape to clear the filter.
- **Pagination** splits the list into pages when you have it enabled, with previous and next buttons and a page indicator. When it is off, the whole list is shown and the count is the total.
Each artist is a card; selecting it opens the artist's page, and the card's actions menu offers **View details** and **Delete**.
Each artist is a card; selecting it opens the artist's page, and the card's actions menu offers **View details**, **Play**, **Shuffle** and **Delete**.
The artist page is also where you edit the artist. It lists the artist's albums as cards, each leading to its own album page, followed by the artist's general information, contributors, ratings, genres, tags, aliases, areas and identifiers. The album page holds the album's information and its tracks, and the track page holds the track's details. The album page also shows the artwork Lumina stored for the album as a strip of thumbnails beside the main image, and selecting a thumbnail displays that image in place of the cover. Deleting an artist, album or track removes it from Lumina's catalogue; your files are not touched.
The music pages also play what they show. The artist page has a **Play all** control that plays the artist's releases in the order the page presents them, one release after another. The actions menu of a music library card on the home page, of an artist card, and of an album card offers **Play** and **Shuffle**. Play starts the library at its first artist and continues through the remaining artists in artist page order, starts the artist's discography in the order the artist page presents it, or starts the release in disc and track order. Shuffle starts the library, the artist's discography or the release with a list of up to 100 tracks sampled uniformly at random from every track of that scope, and continues in random order without repeating a track that is already queued. The album page has a **Play album** control that plays the release in disc and track order, and every track row has its own play control that plays just that track. The track page has a **Play track** control for the track it shows. Starting playback opens the player bar at the bottom of the window. It keeps playing while you move between pages, and the bar shows the track name, with the album name underneath when the track belongs to a named album, the progress of the current track and the volume, together with previous, play or pause, stop, next and repeat controls. When you expand it, it also shows the cover art, the current track name, the release type, the release name and year, the artist name, and a carousel of the album's stored artwork, next to the queue, where every entry carries its album cover, including when only one track is queued. Selecting an artwork in the carousel shows it as the main cover. The expanded queue moves the current track to the top whenever playback advances, so it stays visible even in a long list. The double chevron at the right points up to expand the bar and down to collapse it. Stop is the square control next to play or pause; in the condensed bar it stops playback and slides the bar out of view.
## Editing what is catalogued
Both book and music pages double as editors for the items that were scanned in. A book's details page groups its fields into general and release information, language and original language, genres, tags, identifiers, ISBNs, contributors and ratings, and lets you replace its cover. An artist's page lists the artist's albums first, then groups its fields into general information, contributors, ratings, genres, tags, aliases, areas and identifiers, and lets you replace the artist's cover. An album page groups its fields into general information, contributors, ratings, genres, tags, release types, release information, language and original language, and identifiers, and lets you replace the album's cover. A track page groups its fields into general information, contributors, ratings, genres, tags, moods, release information, language and original language, work, ISRCs, identifiers and audio properties. Saving sends the changes back to the server, and a confirmation or an error is shown in the corner of the screen.
@@ -296,6 +296,7 @@ POST api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b
{
"id": "e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f",
"artistId": "d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a",
"artistName": "Queen",
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
"metadata": {
"title": "A Night at the Opera",
@@ -561,6 +562,7 @@ GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-
{
"id": "e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f",
"artistId": "d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a",
"artistName": "Queen",
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
"metadata": {
"title": "A Night at the Opera",
@@ -865,6 +867,7 @@ GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-
{
"id": "e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f",
"artistId": "d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a",
"artistName": "Queen",
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
"metadata": {
"title": "A Night at the Opera",
@@ -1209,6 +1212,7 @@ PUT api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-
{
"id": "e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f",
"artistId": "d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a",
"artistName": "Queen",
"libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a",
"metadata": {
"title": "A Night at the Opera",
@@ -8,6 +8,9 @@
- [Get Track](#get-track)
- [Get Track Request](#get-track-request)
- [Get Track Response](#get-track-response)
- [Shuffle Tracks](#shuffle-tracks)
- [Shuffle Tracks Request](#shuffle-tracks-request)
- [Shuffle Tracks Response](#shuffle-tracks-response)
- [Stream Track](#stream-track)
- [Stream Track Request](#stream-track-request)
- [Stream Track Response](#stream-track-response)
@@ -321,6 +324,50 @@ GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-
```
### Shuffle Tracks
#### Shuffle Tracks Request
```js
POST api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/tracks/shuffle
```
```json
{
"count": 100,
"artistId": null,
"albumId": null,
"excludedTrackIds": [
"9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"
]
}
```
Returns a uniformly random selection of tracks from every track of the library, optionally scoped to one artist or one album, and excludes the tracks in `excludedTrackIds`. The database picks the rows at random, so the result is not limited to the albums or artists that happen to be stored or loaded first. `count` must be between 1 and 500. When `artistId` is present, only tracks whose album belongs to that artist are sampled; when `albumId` is present, only tracks of that album are sampled. The tracks are returned to an Admin, who can shuffle all libraries, or to the owner of the library.
#### Shuffle Tracks Response
```js
200 Ok
```
```json
[
{
"trackId": "9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f",
"title": "Bohemian Rhapsody",
"durationInSeconds": 354,
"albumId": "e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f",
"albumTitle": "A Night at the Opera",
"artistId": "d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a",
"coverPath": "\\media\\music\\music-3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a\\QUEEN\\Album\\A night at the opera-e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f\\cover.jpg"
}
]
```
The response holds at most `count` tracks, and fewer when the scope has fewer tracks that are not excluded. A repeated request returns a different random selection and a different order.
### Stream Track
#### Stream Track Request
@@ -0,0 +1,10 @@
POST {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/tracks/shuffle
Authorization: Bearer {{ACCESS_TOKEN}}
Content-Type: application/json
{
"count": 100,
"artistId": null,
"albumId": null,
"excludedTrackIds": []
}
+77 -21
View File
@@ -14,6 +14,7 @@ The web client of Lumina is a themed shell: every page is rendered inside the te
- [Template Resolution](#template-resolution)
- [The Layout Template (shared/layout)](#the-layout-template-sharedlayout)
- [The Audio Player Bar](#the-audio-player-bar)
- [Play Affordances on the Music Pages](#play-affordances-on-the-music-pages)
- [The audio player sub templates](#the-audio-player-sub-templates)
- [The Navigation Template (shared/nav-menu)](#the-navigation-template-sharednav-menu)
- [Page Templates](#page-templates)
@@ -231,17 +232,18 @@ The rendered page content, navigation and scripts are inserted unescaped with `{
Every authenticated page renders the audio player bar through the `audioPlayer` field of the layout model. The bar starts hidden, and the global audio player script shows it when playback starts, expands it and hides it again. The markup comes from the `shared/audio-player` template of the active theme; when the theme does not provide that template, the application renders its own fallback markup, so the player always has a bar to bind to.
The bar is fixed to the bottom of the viewport, so the theme owns the room reserved for it on the main content element. A layout must keep these element hooks, which the audio player drives (the two id controls are bound by the global site script, which routes them to the audio player):
The theme owns the position, orientation and size of the bar, and it owns the room reserved for it on the main content element. The application fallback happens to fix the bar to the bottom, but that is only the fallback layout: a theme can make it a vertical bar on a side, a horizontal bar at the bottom, or any other placement, and can expand its queue in any direction. A layout must keep these element hooks, which the audio player drives (the id control is bound by the global site script, which routes it to the audio player):
| Element | Hook | Meaning |
| --- | --- | --- |
| The bar container, with the `audio-player-container` class | `not-shown` class | The bar is hidden, and its height collapses. |
| The bar container | `full-height` class | The bar is expanded to its full height form. |
| The bar container, with the `audio-player-container` class | `not-shown` class | The bar is hidden. The theme decides how that state is presented and which space it releases. |
| The bar container | `expanded` class | The bar is expanded. This is the layout-neutral state a theme styles for its own layout. |
| The bar container | `inert` attribute | Set while the bar is hidden and removed when it is shown, so a collapsed bar keeps none of its focusable controls in the tab order. |
| The main content element | `audio-player-not-shown` class | The bar is hidden, so the content area uses the full height. |
| The main content element | `audio-player-full-height` class | The bar is expanded, so the content area gives it the full height. |
| The full height control | `id="audio-player-full-height-toggle"` | A focusable control, such as a `button`, that expands or collapses the bar. |
| The close control | `id="audio-player-close"` | A focusable control, such as a `button`, that stops playback and hides the bar while it is condensed. |
| The expanded area, with the `audio-player-expanded` class | Layout child of the bar container | The cover art, now playing details and queue of the expanded bar. Its position is theme-owned. The fallback stylesheet places it above the bar in a flex column, but the player does not require that layout. A theme that animates the area should keep it in the DOM while the transition runs. |
| The condensed bar, with the `audio-player-bar` class | Layout child of the bar container | The row of controls. Its position is theme-owned; the fallback stylesheet places it at the bottom edge of the container. |
| The main content element | `audio-player-not-shown` class | The bar is hidden, so the content area releases the room the theme reserved for the bar. |
| The main content element | `audio-player-bar-expanded` class | The bar is expanded. This is the layout-neutral state for the main content element's own adjustment. |
| The expand and collapse control | `id="audio-player-expand-toggle"` | A focusable control, such as a `button`, that expands or collapses the bar. Its label may describe the action in the theme's own layout. |
The `shared/audio-player` template receives the following model:
@@ -251,9 +253,9 @@ The `shared/audio-player` template receives the following model:
| `assetBase` | The base URL of the theme assets, used by the theme template to reference its own assets. |
| `queueItemTemplate` | The raw source of the `shared/audio-player/queue-item` sub template, inlined by the application into a plain text script element. |
| `playlistItemTemplate` | The raw source of the `shared/audio-player/playlist-item` sub template, inlined by the application into a plain text script element. |
| `strings` | The localized strings of the bar, keyed by their resource names. A shell template uses `toggleFullHeight`, `toggleVisibility`, `previous`, `next`, `shuffle`, `shuffleOff`, `shuffleRelease`, `shuffleArtist`, `shuffleLibrary`, `repeat`, `repeatOff`, `repeatAll`, `repeatOne` and `queue` for its controls; the player reads the play, pause, mute, unmute, volume, seek and buffering labels from the global scripts configuration instead, so a themed shell does not need to render them. |
| `strings` | The localized strings of the bar, keyed by their resource names. A shell template uses `toggleExpanded`, `previous`, `next`, `stop`, `repeat`, `repeatOff`, `repeatAll`, `repeatOne`, `queue` and `albumArtwork` for its controls; the player reads the play, pause, mute, unmute, volume, seek and buffering labels from the global scripts configuration instead, so a themed shell does not need to render them. |
A theme must reserve the space for the bar itself, as the bundled themes do:
The bundled themes reserve the room for their bottom bar like this. It is an example of a bottom layout, not a required layout:
```css
main {
@@ -265,24 +267,25 @@ main.audio-player-not-shown {
bottom: 0;
}
main.audio-player-full-height {
bottom: calc(100% - 22px); /* full height minus the menu height */
main.audio-player-bar-expanded {
bottom: calc(100% - 22px); /* expanded height, less the menu height */
}
```
The application fallback layout, which renders when the active theme cannot be loaded, reserves the room itself, because the application stylesheet does not position the content area of a theme. A theme that omits the rules above leaves the fixed bar overlapping the bottom of the page.
A theme with a vertical bar instead reserves a side column, a theme with a bar on top reserves top space, and a theme whose expanded bar overlays the content reserves no space at all. The application fallback layout reserves the room itself, because the application stylesheet does not position the content area of a theme. A theme that omits its own space reservation leaves its bar overlapping its content.
The markup inside the bar exposes the hook attributes the audio player script binds. A theme that replaces the bar markup must keep all of them; the part of the bar whose hook is missing stays inert. The play affordances of the pages use the `data-audio-player-play` trigger attribute, and a play next affordance uses `data-audio-player-play-next`; both read the same descriptor attributes. A track trigger must supply `libraryId`, `trackId`, `albumId` and `artistId`, because the playback manifest route needs all four Ids. An album context trigger supplies `libraryId`, `albumId` and `artistId`, and an artist context trigger supplies `libraryId` and `artistId`. The deprecated `queuechange` event keeps its ordered descriptor array payload for older theme scripts; new code must use `queuestatechange`, whose payload is the compact queue summary.
The flex column used by the application fallback is also only a default. The player toggles the state classes and never reads the geometry of the bar, so a theme can lay the container out in any direction, place the expanded area to the left, right, above or below the condensed bar, and make the queue scroll vertically or horizontally. The player's only layout-dependent behavior is scrolling the `data-audio-player-queue` element so the current entry aligns to its start on both axes.
A theme that restyles the fallback transition can set `--audio-player-expanded-duration` on `.audio-player-container` to keep its height, fade and padding transitions on the same duration. The bundled themes set it to `1s`, matching their own height transition; the application fallback uses `0.4s`. A theme that uses a different transition can ignore the property.
The markup inside the bar exposes the hook attributes the audio player script binds. A theme that replaces the bar markup must keep all of them; the part of the bar whose hook is missing stays inert. The deprecated `queuechange` event keeps its ordered descriptor array payload for older theme scripts; new code must use `queuestatechange`, whose payload is the compact queue summary.
| Hook attribute | Meaning |
| --- | --- |
| `data-audio-player-play-pause` | The play and pause control. The player adds the `is-playing` class to it while a track plays. |
| `data-audio-player-stop` | The stop control. Clicking it stops playback; a condensed bar then slides out of view, while an expanded bar stays on screen. |
| `data-audio-player-previous` | The previous control. It either returns to the previous queue entry or restarts the current track, following the navigation history. |
| `data-audio-player-next` | The next control. It starts the next queue entry and loads another shuffle or autoplay batch when the queue is at its end. The player sets `disabled` and the `is-disabled` class when there is no next entry. |
| `data-audio-player-shuffle-control` | The wrapper of the shuffle toggle and its scope menu, so the player can position the menu and close it on an outside click. The player adds `is-menu-open` to the bar container while the menu is open, so a theme can let the menu overflow the bar. |
| `data-audio-player-shuffle` | The shuffle menu button when a scope menu is present: clicking it always opens the menu, the player sets `aria-haspopup="menu"`, `aria-expanded`, and the `is-active` class while shuffle is on, and it does not set `aria-pressed`. Without a scope menu the control is a plain toggle that exposes `aria-pressed` instead. |
| `data-audio-player-shuffle-menu` | The shuffle scope menu, hidden with the `hidden` attribute while it is closed. |
| `data-audio-player-shuffle-scope` | A scope item inside the menu, with the value `off`, `release`, `artist` or `library`. The player toggles `aria-checked` and the `is-selected` class on it; the `off` item is selected while shuffle is off. A scope whose required Ids cannot be resolved from the current queue is disabled with `disabled`, `aria-disabled="true"` and the `is-disabled` class. |
| `data-audio-player-repeat` | The repeat toggle. The player writes `data-audio-player-repeat-mode` (`off`, `all` or `one`), toggles `aria-pressed`, the `is-active` class and, for one, the `is-one` class. |
| `data-audio-player-progress` | The progress bar, a `role="slider"` element with `tabindex="0"` that the player scrubs and whose ARIA value attributes it writes. It carries `data-audio-player-progress-state` (`idle`, `ready` or `buffering`) and the `is-buffering` class while it loads. |
| `data-audio-player-progress-played` | The played layer of the bar. The player publishes its start and width as the custom properties `--audio-player-progress-played-start` and `--audio-player-progress-played-width`. |
@@ -291,14 +294,67 @@ The markup inside the bar exposes the hook attributes the audio player script bi
| `data-audio-player-current-time` | The current position, written as `m:ss`. |
| `data-audio-player-total-time` | The duration, written as `m:ss`, or `--:--` while it is unknown. |
| `data-audio-player-track-name` | The track name. |
| `data-audio-player-cover-thumbnail`, `data-audio-player-cover-image` | The cover art of the condensed bar and of the expanded bar. |
| `data-audio-player-album-name` | The album name, shown underneath the track name. The player leaves it empty when the descriptor has no album title, including when the title is the stored `Unknown Album` placeholder, so a track without an album shows only its name. |
| `data-audio-player-now-playing-title` | The current track name of the expanded player, under its cover. |
| `data-audio-player-now-playing-release-type` | The release type of the current track's album, such as Album, Live or EP. Multiple types are joined with commas. It is left empty when the album has no release type. |
| `data-audio-player-now-playing-release` | The release name of the current track's album in the expanded player. It is left empty when the album has no displayable title. |
| `data-audio-player-now-playing-year` | The release year of the current track's album in the expanded player. It is left empty when the year is not known. |
| `data-audio-player-now-playing-artist` | The artist name of the current track's album in the expanded player. It is left empty until the album details are available. |
| `data-audio-player-artwork-carousel` | The carousel of the stored artwork of the current track's album. The player appends one `button.artwork-carousel-item` per stored image, carrying `data-artwork-path`, and toggles the `selected` class and `aria-pressed` on the chosen item. The element is hidden with the `hidden` attribute while the album has no stored artwork. |
| `data-audio-player-cover-thumbnail`, `data-audio-player-cover-image` | The cover art of the condensed bar and of the expanded bar. Choosing an album artwork in the carousel replaces both images until the next track. |
| `data-audio-player-volume` | The volume slider, a `role="slider"` element with `tabindex="0"` that the player scrubs and whose ARIA value attributes it writes. The fill is published as `--audio-player-volume-start` and `--audio-player-volume-width`. |
| `data-audio-player-volume-level` | The volume fill. It carries no geometry of its own: the stylesheet drives it from the custom properties above. |
| `data-audio-player-mute` | The mute toggle. The player toggles the `is-muted` class and the `aria-pressed` state on it. |
| `data-audio-player-queue` | The queue list of the expanded bar. The player writes `data-audio-player-queue-entry-id` on every rendered item root, whether it comes from the theme sub template or from the built-in markup, and makes the root focusable, so clicking an item or pressing Enter or Space on it starts that entry. |
| `data-audio-player-queue` | The queue list of the expanded bar. The player writes `data-audio-player-queue-entry-id` on every rendered item root, whether it comes from the theme sub template or from the built-in markup, and makes the root focusable, so clicking an item or pressing Enter or Space on it starts that entry. The element must stay the scroll container of the list, because the player scrolls the current entry to the start of whichever axis the theme makes scrollable when playback advances or the bar expands. |
Each progress layer also carries `data-audio-player-progress-layer` (`played`, `downloaded` or `undownloaded`) in the markup, so a theme can select a layer by its state as well as by its class. The player writes no inline geometry on any of the bar elements: it publishes the geometry of each state as the custom properties above, which the application stylesheet consumes, so a theme restyles or reorients either bar by consuming the same properties.
#### Play Affordances on the Music Pages
The artist page, the album page and the track page render play triggers, and the card actions menus render play and shuffle triggers, all handled by the global audio player script through event delegation. The music library cards on the home page, the artist cards and the album cards offer both actions, so the whole library, an artist or a release can be started in order or shuffled. A theme template that replaces one of those pages or menus opts in by rendering the same trigger attributes: the player binds one listener on the document, so a trigger works anywhere in the swapped page content and the page needs no script of its own.
The trigger attributes are:
| Attribute | Meaning |
| --- | --- |
| `data-audio-player-play` | Marks the element as a play trigger. Clicking it replaces the queue with the described context and starts playback. |
| `data-audio-player-play-next` | Marks the element as a play next trigger. While something is current, clicking it inserts the described track or context after the current entry without starting playback and discards the pending autoplay continuation. When nothing is current, the player starts the described context instead, because there is no entry to queue after. |
| `data-audio-player-play-shuffled` | Marks the element as a shuffled play trigger. Clicking it starts the described context and turns shuffle on for the scope in `data-audio-player-shuffle-scope`. |
| `data-audio-player-play-library` | Marks the element as a library play trigger. Clicking it starts the whole library named by `data-library-id` in artist page order, without needing a track, album or artist context. |
| `data-audio-player-play-library-shuffled` | Marks the element as a library shuffle trigger. Clicking it starts a shuffled playback of the whole library named by `data-library-id`, without needing a track, album or artist context. |
| `data-audio-player-shuffle-scope` | The scope of a shuffled play trigger: `release`, `artist` or `library`. A shuffled play trigger without this attribute shuffles the release it started. |
All triggers read the play descriptor from the same `data-*` attributes:
| Attribute | Meaning |
| --- | --- |
| `data-library-id` | The Id of the media library the context belongs to. Required by every trigger. |
| `data-track-id` | The Id of the track. Required by a track trigger. |
| `data-album-id` | The Id of the album. Required by a track trigger and by an album context trigger. |
| `data-artist-id` | The Id of the artist. Required by a track trigger, an album context trigger and an artist context trigger. |
| `data-title` | The display title of the track or context, shown in the bar while the context loads. Optional. |
| `data-album-title` | The display title of the album the track belongs to, shown under the track name in the bar. Optional, and meaningful on a track trigger. An album context already uses its `data-title` as the album title while the context loads, so it does not need this attribute. |
| `data-duration` | The duration of the track in seconds. Optional, and meaningful on a track trigger. |
| `data-cover-art-path` | The artwork path of the cover, relative to the API server base, exactly like the artwork path the album page uses. Optional. |
| `data-cover-art-url` | An absolute cover art URL, or a relative artwork path. Optional, and used in preference to `data-cover-art-path` when both are present. |
The context a trigger describes decides the required parameters and the queue it builds:
| Trigger | Required attributes | Queue |
| --- | --- | --- |
| Track | `data-library-id`, `data-track-id`, `data-album-id`, `data-artist-id` | The single track. |
| Album | `data-library-id`, `data-album-id`, `data-artist-id` | The tracks of the release, in disc and then track number order. |
| Artist | `data-library-id`, `data-artist-id` | Every release of the artist in the order the artist page presents them, each in disc and track number order. |
| Library | `data-library-id` | Every track of the first artist of the library that has tracks, in artist page order, followed by the remaining artists in the same order. |
The album queue is read through `api-get-tracks`, the artist queue through `api-get-albums` and then `api-get-tracks`, and a track trigger uses the descriptor alone. A library trigger reads `api-get-artists` to find the first artist that has tracks and then builds that artist's queue; when playback reaches the end, the continuation walks the remaining artists in library order. The queue script documents these endpoints and their order in full.
An album or artist trigger carries its effective cover into the entries it queues. A `data-cover-art-url` is kept as the resolved cover URL of the context, so a theme that supplies only that attribute does not lose the cover when the queue is built. An album trigger falls back to the context cover for a release without one. An artist trigger falls back to the artist cover, and a library trigger falls back to the cover of the artist the release belongs to, so a release with its own cover always keeps that cover. The `data-cover-art-path` is kept on every entry for artwork matching, even when the trigger supplies a cover URL.
Each page exposes the values its own triggers need. The album page provides `artistId`, `albumId`, `libraryId`, `albumTitle`, `albumCoverPath` and `albumHasTracks` for the album trigger. Its per-track triggers are rendered from the track rows the page loads from `tracksUrl`, which returns the `id`, `title`, `trackNumber`, `discNumber` and `durationInSeconds` of each track; `albumJson` carries the album model the template script starts from, and `trackUrl` is the template of a track page route. The artist page provides `artistId`, `libraryId`, `artistName`, `artistCoverPath` and `artistHasReleases` for the play all trigger, and `albumsUrl` and `albumUrl` for the release list and its cards. The release rows returned by `albumsUrl` carry the `id`, `title` and `coverPath` used by the album card Play and Shuffle actions. The track page provides `artistId`, `albumId`, `trackId`, `libraryId`, `trackTitle`, `trackDurationInSeconds`, `albumTitle` and `albumCoverPath` for its trigger. The artist index page provides `libraryId` and `itemsUrl` for its artist cards, and each row of `itemsUrl` carries the `id`, `name` and `coverPath` used by the artist card Play and Shuffle actions. The home page library cards are application markup, and each music library card uses the library `id` for its Play and Shuffle actions. A theme template that changes these pages uses the same values and endpoints to render equivalent triggers.
The application fallback templates render the triggers on the existing `confirm-button` controls: the page-level controls carry their localized label, and the per-track control carries a text play glyph with an accessible label. The card actions menus of music libraries, artists and albums render Play and Shuffle; the album card menu also keeps Remove beside them. A theme may use any markup and classes; only the trigger and descriptor attributes are required, and a trigger must be a focusable element, such as a `button`. The bundled themes render these triggers on the pages and card menus they provide, so a custom theme that replaces one of those templates must render them again to keep playback and shuffle reachable from that page.
#### The audio player sub templates
Like the file system browser, the audio player is split into a shell template and the sub templates of its dynamic content, all provided as mirrored files under `templates/shared/audio-player/`. The shell template inlines the raw source of each sub template into a plain text script element, so that the browser never parses the theme markup into live elements and requests their resources before the player renders them:
@@ -312,10 +368,10 @@ The sub templates are rendered client side by the audio player script with the s
| Template | Fields |
| --- | --- |
| `queue-item` | `entryId` (the identity of this occurrence in the queue), `index` (the one based position in the queue), `trackId`, `albumId`, `artistId`, `libraryId`, `title`, `duration` (the formatted `m:ss` duration), `durationSeconds`, `coverArtUrl`, `isCurrent`, `isPlayed`, `isLast`, `isContinuation` (the entry was added by the autoplay continuation) and `isShuffled` (the entry was added by a shuffle batch). The item root must keep the `audio-player-queue-item` class, the stylesheet hook of a queue item: the player appends the rendered element as-is, so the class is what lets the theme style it. The built-in item also adds `is-current`, `is-played`, `is-continuation` and `is-shuffled` to the root. The player writes `data-audio-player-queue-entry-id` on the root itself, so a theme item does not need to render the identity. |
| `queue-item` | `entryId` (the identity of this occurrence in the queue), `index` (the one based position in the queue), `trackId`, `albumId`, `artistId`, `libraryId`, `title`, `duration` (the formatted `m:ss` duration), `durationSeconds`, `coverArtUrl` (the resolved cover art URL, which is the music placeholder when the entry has no artwork), `isCurrent`, `isPlayed`, `isLast`, `isContinuation` (the entry was added by the autoplay continuation) and `isShuffled` (the entry was added by a shuffle batch). The item root must keep the `audio-player-queue-item` class, the stylesheet hook of a queue item: the player appends the rendered element as-is, so the class is what lets the theme style it. The player writes `is-current`, `is-played`, `is-continuation` and `is-shuffled` on the root itself, so a theme item does not need to render those state classes, and it writes `data-audio-player-queue-entry-id`, so a theme item does not need to render the identity either. |
| `playlist-item` | `index`, `trackId`, `albumId`, `artistId`, `libraryId`, `title`, `duration`, `durationSeconds`, `coverArtUrl` and `isCurrent`. The item root must keep the `audio-player-playlist-item` class, the stylesheet hook of a playlist item. Saved playlists do not exist yet, so the shell inlines this sub template for theme authors, but nothing renders it yet; the playlist feature renders the entries of a playlist from it. |
A theme can omit either sub template: the player then renders that part with its own built-in markup. When a theme replaces the shell, it must keep the two plain text script element ids above, the element hooks of the bar, and the `audio-player-container`, `not-shown` and `full-height` classes the player toggles.
A theme can omit either sub template: the player then renders that part with its own built-in markup. When a theme replaces the shell, it must keep the two plain text script element ids above, the element hooks of the bar, and the `audio-player-container`, `not-shown` and `expanded` classes the player toggles.
Every field of the `queue-item` and `playlist-item` models is untrusted: titles and identifiers come from file metadata and the music endpoints. Render these fields with the escaped form, `{{field}}`. The template engine also supports the unescaped form `{{{field}}}`, but these models contain no trusted HTML, so unescaped tags must not be used for them. Escaping does not neutralise whitespace in an unquoted attribute, so every model value placed in an attribute must sit inside quoted attribute marks, for example `data-track-id="{{trackId}}"` and never `data-track-id={{trackId}}`.
@@ -0,0 +1,46 @@
#region ========================================================================= USING =====================================================================================
using System;
#endregion
namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Read model of a track returned by a randomized shuffle query, carrying everything the client needs to queue and play it.
/// </summary>
public sealed record ShuffleTrackRowDto
{
/// <summary>
/// Gets the Id of the track.
/// </summary>
public required Guid TrackId { get; init; }
/// <summary>
/// Gets the title of the track.
/// </summary>
public required string Title { get; init; }
/// <summary>
/// Gets the duration of the track in seconds.
/// </summary>
public int DurationInSeconds { get; init; }
/// <summary>
/// Gets the Id of the album the track belongs to.
/// </summary>
public required Guid AlbumId { get; init; }
/// <summary>
/// Gets the title of the album the track belongs to.
/// </summary>
public required string AlbumTitle { get; init; }
/// <summary>
/// Gets the Id of the artist the album belongs to.
/// </summary>
public required Guid ArtistId { get; init; }
/// <summary>
/// Gets the path of the cover of the album, if available.
/// </summary>
public string? CoverPath { get; init; }
}
@@ -49,6 +49,19 @@ public interface ITrackRepository : IRepository<TrackEntity>,
/// <returns>An <see cref="Result{TValue}"/> containing either a paginated result of <see cref="TrackLiteRow"/>, or an error.</returns>
Task<Result<PaginatedResultDto<TrackLiteRow>>> GetTracksLiteByAlbumIdAsync(Guid albumId, PaginationDataDto? paginationData, CancellationToken cancellationToken);
/// <summary>
/// Gets a uniformly random selection of tracks of the library identified by <paramref name="libraryId"/>, optionally scoped to
/// an artist or an album, excluding the tracks in <paramref name="excludedTrackIds"/>.
/// </summary>
/// <param name="libraryId">The Id of the library whose tracks are sampled.</param>
/// <param name="artistId">The Id of the artist whose tracks are sampled, or <see langword="null"/> for every artist of the library.</param>
/// <param name="albumId">The Id of the album whose tracks are sampled, or <see langword="null"/> for every album of the scope.</param>
/// <param name="excludedTrackIds">The tracks that must not be returned.</param>
/// <param name="count">The maximum number of tracks to return.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either a collection of <see cref="ShuffleTrackRowDto"/>, or an error.</returns>
Task<Result<IReadOnlyList<ShuffleTrackRowDto>>> GetShuffleTracksLiteAsync(Guid libraryId, Guid? artistId, Guid? albumId, IReadOnlyCollection<Guid> excludedTrackIds, int count, CancellationToken cancellationToken);
/// <summary>
/// Gets the track of the library identified by <paramref name="libraryId"/> that is stored at the provided <paramref name="path"/>.
/// </summary>
@@ -170,7 +170,7 @@ public static class AlbumEntityMapping
repositoryEntity.ReleaseCountry,
repositoryEntity.ReleaseVersion
);
// language and original language make sense only if their subproperties have values
// Language and original language make sense only if their subproperties have values.
LanguageInfoDto? languageInfo = !string.IsNullOrWhiteSpace(repositoryEntity.LanguageCode) ||
!string.IsNullOrWhiteSpace(repositoryEntity.LanguageName) ||
!string.IsNullOrWhiteSpace(repositoryEntity.LanguageNativeName)
@@ -207,6 +207,7 @@ public static class AlbumEntityMapping
return new AlbumResponse(
repositoryEntity.Id,
repositoryEntity.ArtistId,
repositoryEntity.Artist?.Name ?? string.Empty,
repositoryEntity.LibraryId,
metadata,
repositoryEntity.MediaFormat,
@@ -0,0 +1,41 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
using Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
using System.Collections.Generic;
using System.Linq;
#endregion
namespace Lumina.Application.Common.Mapping.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Extension methods for converting <see cref="ShuffleTrackRowDto"/>.
/// </summary>
public static class ShuffleTrackRowDtoMapping
{
/// <summary>
/// Converts <paramref name="readModel"/> to <see cref="ShuffleTrackResponse"/>.
/// </summary>
/// <param name="readModel">The read model to be converted.</param>
/// <returns>The converted response.</returns>
public static ShuffleTrackResponse ToResponse(this ShuffleTrackRowDto readModel)
{
return new ShuffleTrackResponse(
readModel.TrackId,
readModel.Title,
readModel.DurationInSeconds,
readModel.AlbumId,
readModel.AlbumTitle,
readModel.ArtistId,
readModel.CoverPath);
}
/// <summary>
/// Converts <paramref name="readModels"/> to a collection of <see cref="ShuffleTrackResponse"/>.
/// </summary>
/// <param name="readModels">The read models to be converted.</param>
/// <returns>The converted responses.</returns>
public static IReadOnlyList<ShuffleTrackResponse> ToResponses(this IEnumerable<ShuffleTrackRowDto> readModels)
{
return [.. readModels.Select(readModel => readModel.ToResponse())];
}
}
@@ -0,0 +1,28 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Queries.ShuffleTracks;
using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
#endregion
namespace Lumina.Application.Common.Mapping.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Extension methods for converting <see cref="ShuffleTracksRequest"/>.
/// </summary>
public static class ShuffleTracksRequestMapping
{
/// <summary>
/// Converts <paramref name="request"/> to <see cref="ShuffleTracksQuery"/>.
/// </summary>
/// <param name="request">The request to be converted.</param>
/// <param name="libraryId">The Id of the library the tracks are sampled from, taken from the route.</param>
/// <returns>The converted query.</returns>
public static ShuffleTracksQuery ToQuery(this ShuffleTracksRequest request, string? libraryId)
{
return new ShuffleTracksQuery(
libraryId,
request.Count,
request.ArtistId,
request.AlbumId,
request.ExcludedTrackIds);
}
}
@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.CQRS;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Queries.ShuffleTracks;
/// <summary>
/// Query for getting a random selection of tracks from a media library, an artist or an album.
/// </summary>
/// <param name="LibraryId">The unique identifier of the media library the tracks are sampled from, taken from the route.</param>
/// <param name="Count">The maximum number of tracks to return.</param>
/// <param name="ArtistId">The unique identifier of the artist whose tracks are sampled, if applicable.</param>
/// <param name="AlbumId">The unique identifier of the album whose tracks are sampled, if applicable.</param>
/// <param name="ExcludedTrackIds">The tracks that must not be returned, if any.</param>
[DebuggerDisplay("LibraryId: {LibraryId} Count: {Count}")]
public record ShuffleTracksQuery(
string? LibraryId,
int Count,
Guid? ArtistId,
Guid? AlbumId,
IReadOnlyList<Guid>? ExcludedTrackIds
) : IQuery;
@@ -0,0 +1,85 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.CQRS;
using Lumina.Application.Common.DataAccess.UoW;
using Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
using Lumina.Application.Common.Infrastructure.Authentication;
using Lumina.Application.Common.Infrastructure.Authorization;
using Lumina.Application.Common.Infrastructure.Authorization.Policies.LibraryOwnership;
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Application.Common.Mapping.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
using Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
using Lumina.Domain.Common.Errors;
using Lumina.Domain.Common.Primitives;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using ApplicationErrors = Lumina.Application.Common.Errors.Errors;
#endregion
namespace Lumina.Application.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Queries.ShuffleTracks;
/// <summary>
/// Handler for the query to draw a random selection of tracks from a media library, an artist or an album.
/// </summary>
public class ShuffleTracksQueryHandler : IQueryHandler<ShuffleTracksQuery, Result<IReadOnlyList<ShuffleTrackResponse>>>
{
private readonly IUnitOfWork _unitOfWork;
private readonly IAuthorizationService _authorizationService;
private readonly ICurrentUserService _currentUserService;
private readonly IValidator<ShuffleTracksQuery> _validator;
/// <summary>
/// Initializes a new instance of the <see cref="ShuffleTracksQueryHandler"/> class.
/// </summary>
/// <param name="unitOfWork">Injected unit of work for interacting with the data access layer repositories.</param>
/// <param name="authorizationService">Injected service for authorization related functionality.</param>
/// <param name="currentUserService">Injected service to retrieve the current user information.</param>
/// <param name="validator">Injected validator for application validation rules.</param>
public ShuffleTracksQueryHandler(IUnitOfWork unitOfWork, IAuthorizationService authorizationService, ICurrentUserService currentUserService, IValidator<ShuffleTracksQuery> validator)
{
_unitOfWork = unitOfWork;
_authorizationService = authorizationService;
_currentUserService = currentUserService;
_validator = validator;
}
/// <summary>
/// Handles the query to draw a random selection of tracks from a media library, an artist or an album.
/// </summary>
/// <param name="query">The query to be handled.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>
/// An <see cref="Result{TValue}"/> containing either a collection of <see cref="ShuffleTrackResponse"/>, or an error message.
/// </returns>
public async Task<Result<IReadOnlyList<ShuffleTrackResponse>>> HandleAsync(ShuffleTracksQuery query, CancellationToken cancellationToken)
{
List<Error> validationResult = _validator.Validate(query);
if (validationResult.Count > 0)
return validationResult;
// An authenticated request must always carry a user identity.
Guid? currentUserId = _currentUserService.UserId;
if (currentUserId is null)
return ApplicationErrors.Authorization.NotAuthorized;
Guid userId = currentUserId.Value;
// The validator guarantees that the route identifier is a non-empty Guid before this point.
Guid libraryId = Guid.Parse(query.LibraryId!);
// Admins can shuffle all libraries; for everyone else, only the libraries they own.
bool canAccessLibrary = await _authorizationService.EvaluatePolicyAsync<ILibraryOwnershipPolicy>(
userId, new LibraryOwnershipPolicyContext(libraryId), cancellationToken).ConfigureAwait(false);
if (!canAccessLibrary)
return ApplicationErrors.Authorization.NotAuthorized;
IReadOnlyCollection<Guid> excludedTrackIds = query.ExcludedTrackIds is null
? []
: [.. query.ExcludedTrackIds.Where(trackId => trackId != Guid.Empty).Distinct()];
Result<IReadOnlyList<ShuffleTrackRowDto>> shuffleTracksResult = await _unitOfWork.TrackRepository.GetShuffleTracksLiteAsync(
libraryId, query.ArtistId, query.AlbumId, excludedTrackIds, query.Count, cancellationToken).ConfigureAwait(false);
return shuffleTracksResult.Match(value => Result.From(value.ToResponses()), errors => errors);
}
}
@@ -0,0 +1,46 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.Infrastructure.Validation;
using Lumina.Domain.Common.Errors;
using System;
#endregion
namespace Lumina.Application.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Queries.ShuffleTracks;
/// <summary>
/// Validates the needed validation rules for <see cref="ShuffleTracksQuery"/>.
/// </summary>
public class ShuffleTracksQueryValidator : AbstractValidator<ShuffleTracksQuery>
{
/// <summary>
/// Initializes a new instance of the <see cref="ShuffleTracksQueryValidator"/> class.
/// </summary>
public ShuffleTracksQueryValidator()
{
// Validates the identifier of the media library whose tracks are sampled, taken from the route.
RuleFor(query => query.LibraryId)
.Must(libraryId => !string.IsNullOrEmpty(libraryId))
.WithError(Errors.Library.LibraryIdCannotBeEmpty);
RuleFor(query => query.LibraryId)
.Must(libraryId => Guid.TryParse(libraryId, out Guid parsedLibraryId) && parsedLibraryId != Guid.Empty)
.When(query => !string.IsNullOrEmpty(query.LibraryId))
.WithError(Errors.Library.LibraryIdCannotBeEmpty);
RuleFor(query => query.Count)
.Must(count => count > 0)
.WithError(Errors.Music.ShuffleTrackCountMustBeGreaterThanZero);
RuleFor(query => query.Count)
.Must(count => count <= 500)
.WithError(Errors.Music.ShuffleTrackCountMustBeAtMost500);
// The optional scoping identifiers must be real identifiers when they are present.
RuleFor(query => query.ArtistId)
.Must(artistId => !artistId.HasValue || artistId.Value != Guid.Empty)
.WithError(Errors.Music.ArtistIdCannotBeEmpty);
RuleFor(query => query.AlbumId)
.Must(albumId => !albumId.HasValue || albumId.Value != Guid.Empty)
.WithError(Errors.Music.AlbumIdCannotBeEmpty);
}
}
@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Represents a request to draw a random selection of tracks from a media library, an artist or an album.
/// </summary>
/// <param name="Count">The maximum number of tracks to return. Required.</param>
/// <param name="ArtistId">The unique identifier of the artist whose tracks are sampled. Optional.</param>
/// <param name="AlbumId">The unique identifier of the album whose tracks are sampled. Optional.</param>
/// <param name="ExcludedTrackIds">The tracks that must not be returned, usually the ones already in the queue. Optional.</param>
[DebuggerDisplay("Count: {Count}")]
public record ShuffleTracksRequest(
int Count,
Guid? ArtistId,
Guid? AlbumId,
List<Guid>? ExcludedTrackIds
);
@@ -17,6 +17,7 @@ namespace Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Albu
/// </summary>
/// <param name="Id">The Id of the album.</param>
/// <param name="ArtistId">The Id of the artist the album belongs to.</param>
/// <param name="ArtistName">The name of the artist the album belongs to.</param>
/// <param name="LibraryId">The Id of the media library this album belongs to.</param>
/// <param name="Metadata">The album metadata of the album.</param>
/// <param name="MediaFormat">The physical or digital medium of the album, if applicable.</param>
@@ -39,6 +40,7 @@ namespace Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Albu
public record AlbumResponse(
Guid Id,
Guid ArtistId,
string ArtistName,
Guid LibraryId,
MusicAlbumMetadataDto Metadata,
MusicMediaFormat? MediaFormat,
@@ -0,0 +1,27 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Represents a response for a track returned by a randomized shuffle query, carrying everything the client needs to queue and play it.
/// </summary>
/// <param name="TrackId">The Id of the track.</param>
/// <param name="Title">The title of the track.</param>
/// <param name="DurationInSeconds">The duration of the track in seconds.</param>
/// <param name="AlbumId">The Id of the album the track belongs to.</param>
/// <param name="AlbumTitle">The title of the album the track belongs to.</param>
/// <param name="ArtistId">The Id of the artist the album belongs to.</param>
/// <param name="CoverPath">The path of the cover of the album, if available.</param>
[DebuggerDisplay("Title: {Title}")]
public record ShuffleTrackResponse(
Guid TrackId,
string Title,
int DurationInSeconds,
Guid AlbumId,
string AlbumTitle,
Guid ArtistId,
string? CoverPath
);
@@ -8,6 +8,7 @@ using Lumina.DataAccess.Common.Persistence;
using Lumina.DataAccess.Core.UoW;
using Lumina.Domain.Common.Errors;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
using Microsoft.EntityFrameworkCore;
using System;
@@ -306,6 +307,53 @@ internal sealed class TrackRepository : ITrackRepository
};
}
/// <summary>
/// Gets a uniformly random selection of tracks of the library identified by <paramref name="libraryId"/>, optionally scoped to
/// an artist or an album, excluding the tracks in <paramref name="excludedTrackIds"/>.
/// </summary>
/// <param name="libraryId">The Id of the library whose tracks are sampled.</param>
/// <param name="artistId">The Id of the artist whose tracks are sampled, or <see langword="null"/> for every artist of the library.</param>
/// <param name="albumId">The Id of the album whose tracks are sampled, or <see langword="null"/> for every album of the scope.</param>
/// <param name="excludedTrackIds">The tracks that must not be returned.</param>
/// <param name="count">The maximum number of tracks to return.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="Result{TValue}"/> containing either a collection of <see cref="ShuffleTrackRowDto"/>, or an error.</returns>
public async Task<Result<IReadOnlyList<ShuffleTrackRowDto>>> GetShuffleTracksLiteAsync(Guid libraryId, Guid? artistId, Guid? albumId, IReadOnlyCollection<Guid> excludedTrackIds, int count, CancellationToken cancellationToken)
{
IQueryable<TrackEntity> query = _luminaDbContext.Tracks
.AsNoTracking()
.Where(track => track.LibraryId == libraryId);
if (artistId is not null)
query = query.Where(track => track.Album!.ArtistId == artistId.Value);
if (albumId is not null)
query = query.Where(track => track.AlbumId == albumId.Value);
// The exclusions are materialized as an array, so EF translates them the same way as the other Id collections it already parameterizes.
Guid[] excludedIds = excludedTrackIds is Guid[] ids ? ids : [.. excludedTrackIds];
if (excludedIds.Length > 0)
query = query.Where(track => !excludedIds.Contains(track.Id));
// SQLite randomizes the rows before the limit, so the result is a uniform sample of every matching track.
return await query
.OrderBy(_ => EF.Functions.Random())
.Take(count)
.Select(track => new ShuffleTrackRowDto
{
TrackId = track.Id,
Title = track.Title,
DurationInSeconds = track.DurationInSeconds,
AlbumId = track.AlbumId,
AlbumTitle = track.Album!.Title,
ArtistId = track.Album!.ArtistId,
// The cover is the cover artwork stored for the album, exactly like the album cards expose it.
CoverPath = _luminaDbContext.MusicArtwork
.Where(artwork => artwork.OwnerType == MusicArtworkOwnerType.Album && artwork.OwnerId == track.AlbumId && artwork.ArtworkType == ArtworkType.Cover)
.Select(artwork => artwork.FileName)
.FirstOrDefault()
})
.ToListAsync(cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Gets the track of the library identified by <paramref name="libraryId"/> that is stored at the provided <paramref name="path"/>.
/// </summary>
@@ -67,5 +67,7 @@ public static partial class Errors
public static Error IsniValueMustBeMaximum20CharactersLong => Error.Validation(description: nameof(IsniValueMustBeMaximum20CharactersLong));
public static Error WorkTitleCannotBeEmpty => Error.Validation(description: nameof(WorkTitleCannotBeEmpty));
public static Error CoverCannotBeNull => Error.Validation(description: nameof(CoverCannotBeNull));
public static Error ShuffleTrackCountMustBeGreaterThanZero => Error.Validation(description: nameof(ShuffleTrackCountMustBeGreaterThanZero));
public static Error ShuffleTrackCountMustBeAtMost500 => Error.Validation(description: nameof(ShuffleTrackCountMustBeAtMost500));
}
}
@@ -12,6 +12,7 @@ public static partial class ApiRoutes
{
public const string ADD_TRACK = "/libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks";
public const string GET_TRACK_BY_ID = "/libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}";
public const string SHUFFLE_TRACKS = "/libraries/{libraryId}/tracks/shuffle";
public const string UPDATE_TRACK = "/libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}";
public const string DELETE_TRACK = "/libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}";
public const string STREAM_TRACK = "/libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}/stream";
@@ -340,6 +340,7 @@ public class AddAlbumEndpointSummary : Summary<AddAlbumEndpoint, AddAlbumRequest
ResponseParam<AlbumResponse>(r => r.Id, "The Id of the album.");
ResponseParam<AlbumResponse>(r => r.ArtistId, "The Id of the artist the album belongs to.");
ResponseParam<AlbumResponse>(r => r.ArtistName, "The name of the artist the album belongs to.");
ResponseParam<AlbumResponse>(r => r.LibraryId, "The Id of the media library the album belongs to.");
ResponseParam<AlbumResponse>(r => r.Metadata!.Title, "The title of the album.");
ResponseParam<AlbumResponse>(r => r.Metadata!.OriginalTitle, "The original title of the album, if applicable.");
@@ -380,6 +381,7 @@ public class AddAlbumEndpointSummary : Summary<AddAlbumEndpoint, AddAlbumRequest
example: new AlbumResponse(
Id: albumId,
ArtistId: artistId,
ArtistName: "Queen",
LibraryId: libraryId,
Metadata: new(
Title: "A Night at the Opera",
@@ -32,6 +32,7 @@ public class GetAlbumEndpointSummary : Summary<GetAlbumEndpoint, EmptyRequest>
ResponseParam<AlbumResponse>(r => r.Id, "The Id of the album.");
ResponseParam<AlbumResponse>(r => r.ArtistId, "The Id of the artist the album belongs to.");
ResponseParam<AlbumResponse>(r => r.ArtistName, "The name of the artist the album belongs to.");
ResponseParam<AlbumResponse>(r => r.LibraryId, "The Id of the media library the album belongs to.");
ResponseParam<AlbumResponse>(r => r.Metadata!.Title, "The title of the album.");
ResponseParam<AlbumResponse>(r => r.Metadata!.OriginalTitle, "The original title of the album, if applicable.");
@@ -72,6 +73,7 @@ public class GetAlbumEndpointSummary : Summary<GetAlbumEndpoint, EmptyRequest>
example: new AlbumResponse(
Id: Guid.NewGuid(),
ArtistId: Guid.NewGuid(),
ArtistName: "Queen",
LibraryId: Guid.NewGuid(),
Metadata: new MusicAlbumMetadataDto(
Title: "A Night at the Opera",
@@ -144,6 +144,7 @@ public class UpdateAlbumEndpointSummary : Summary<UpdateAlbumEndpoint, UpdateAlb
ResponseParam<AlbumResponse>(r => r.Id, "The Id of the album.");
ResponseParam<AlbumResponse>(r => r.ArtistId, "The Id of the artist the album belongs to.");
ResponseParam<AlbumResponse>(r => r.ArtistName, "The name of the artist the album belongs to.");
ResponseParam<AlbumResponse>(r => r.LibraryId, "The Id of the media library the album belongs to.");
ResponseParam<AlbumResponse>(r => r.Metadata!.Title, "The title of the album.");
ResponseParam<AlbumResponse>(r => r.Metadata!.OriginalTitle, "The original title of the album, if applicable.");
@@ -184,6 +185,7 @@ public class UpdateAlbumEndpointSummary : Summary<UpdateAlbumEndpoint, UpdateAlb
example: new AlbumResponse(
Id: Guid.NewGuid(),
ArtistId: Guid.NewGuid(),
ArtistName: "Queen",
LibraryId: Guid.NewGuid(),
Metadata: new MusicAlbumMetadataDto(
Title: "A Night at the Opera",
@@ -549,6 +549,7 @@ public class AddArtistEndpointSummary : Summary<AddArtistEndpoint, AddArtistRequ
new(
Id: albumId,
ArtistId: artistId,
ArtistName: "Queen",
LibraryId: libraryId,
Metadata: new(
Title: "A Night at the Opera",
@@ -79,6 +79,7 @@ public class GetArtistEndpointSummary : Summary<GetArtistEndpoint, EmptyRequest>
new(
Id: Guid.NewGuid(),
ArtistId: Guid.NewGuid(),
ArtistName: "Queen",
LibraryId: Guid.NewGuid(),
Metadata: new(
Title: "A Night at the Opera",
@@ -32,6 +32,7 @@ public class GetArtistAlbumsEndpointSummary : Summary<GetArtistAlbumsEndpoint, E
ResponseParam<AlbumResponse>(r => r.Id, "The Id of the album.");
ResponseParam<AlbumResponse>(r => r.ArtistId, "The Id of the artist the album belongs to.");
ResponseParam<AlbumResponse>(r => r.ArtistName, "The name of the artist the album belongs to.");
ResponseParam<AlbumResponse>(r => r.LibraryId, "The Id of the media library the album belongs to.");
ResponseParam<AlbumResponse>(r => r.Metadata!.Title, "The title of the album.");
ResponseParam<AlbumResponse>(r => r.Metadata!.OriginalTitle, "The original title of the album, if applicable.");
@@ -74,6 +75,7 @@ public class GetArtistAlbumsEndpointSummary : Summary<GetArtistAlbumsEndpoint, E
new AlbumResponse(
Id: Guid.NewGuid(),
ArtistId: Guid.NewGuid(),
ArtistName: "Queen",
LibraryId: Guid.NewGuid(),
Metadata: new MusicAlbumMetadataDto(
Title: "A Night at the Opera",
@@ -249,6 +251,7 @@ public class GetArtistAlbumsEndpointSummary : Summary<GetArtistAlbumsEndpoint, E
new AlbumResponse(
Id: Guid.NewGuid(),
ArtistId: Guid.NewGuid(),
ArtistName: "Queen",
LibraryId: Guid.NewGuid(),
Metadata: new MusicAlbumMetadataDto(
Title: "The Works",
@@ -91,6 +91,7 @@ public class GetArtistsEndpointSummary : Summary<GetArtistsEndpoint, GetArtistsR
new(
Id: Guid.NewGuid(),
ArtistId: Guid.NewGuid(),
ArtistName: "Queen",
LibraryId: Guid.NewGuid(),
Metadata: new(
Title: "A Night at the Opera",
@@ -216,6 +217,7 @@ public class GetArtistsEndpointSummary : Summary<GetArtistsEndpoint, GetArtistsR
new(
Id: Guid.NewGuid(),
ArtistId: Guid.NewGuid(),
ArtistName: "Queen",
LibraryId: Guid.NewGuid(),
Metadata: new(
Title: "Heroes",
@@ -546,6 +546,7 @@ public class UpdateArtistEndpointSummary : Summary<UpdateArtistEndpoint, UpdateA
new AlbumResponse(
Id: albumId,
ArtistId: artistId,
ArtistName: "Queen",
LibraryId: libraryId,
Metadata: new MusicAlbumMetadataDto(
Title: "A Night at the Opera",
@@ -0,0 +1,58 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Application.Common.CQRS;
using Lumina.Application.Common.Mapping.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
using Lumina.Application.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Queries.ShuffleTracks;
using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
using Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
using Lumina.Domain.Common.Primitives;
using Lumina.Presentation.Api.Common.Routes.Library.AudioLibrary.MusicLibrary;
using Lumina.Presentation.Api.Core.Endpoints.Common;
using Microsoft.AspNetCore.Http;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Api.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.ShuffleTracks;
/// <summary>
/// API endpoint for the <c>/libraries/{libraryId}/tracks/shuffle</c> route.
/// </summary>
public class ShuffleTracksEndpoint : BaseEndpoint<ShuffleTracksRequest, IResult>
{
private readonly IQueryHandler<ShuffleTracksQuery, Result<IReadOnlyList<ShuffleTrackResponse>>> _shuffleTracksQueryHandler;
/// <summary>
/// Initializes a new instance of the <see cref="ShuffleTracksEndpoint"/> class.
/// </summary>
/// <param name="shuffleTracksQueryHandler">Injected service for handling shuffle tracks queries.</param>
public ShuffleTracksEndpoint(IQueryHandler<ShuffleTracksQuery, Result<IReadOnlyList<ShuffleTrackResponse>>> shuffleTracksQueryHandler)
{
_shuffleTracksQueryHandler = shuffleTracksQueryHandler;
}
/// <summary>
/// Configures the API endpoint.
/// </summary>
public override void Configure()
{
Verbs(Http.POST);
Routes(ApiRoutes.Tracks.SHUFFLE_TRACKS);
Version(1);
DontCatchExceptions();
}
/// <summary>
/// Draws a random selection of tracks of the library identified by the route.
/// </summary>
/// <param name="request">The request containing the selection size, the optional scope and the tracks to exclude.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(ShuffleTracksRequest request, CancellationToken cancellationToken)
{
// Take the unique identifier from the route.
string? libraryId = HttpContext.Request.RouteValues["libraryId"]?.ToString();
Result<IReadOnlyList<ShuffleTrackResponse>> result = await _shuffleTracksQueryHandler.HandleAsync(request.ToQuery(libraryId), cancellationToken).ConfigureAwait(false);
return result.Match(success => TypedResults.Ok(success), Problem);
}
}
@@ -0,0 +1,107 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
using Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Api.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.ShuffleTracks;
/// <summary>
/// Class used for providing a textual description for the <see cref="ShuffleTracksEndpoint"/> API endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class ShuffleTracksEndpointSummary : Summary<ShuffleTracksEndpoint, ShuffleTracksRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="ShuffleTracksEndpointSummary"/> class.
/// </summary>
public ShuffleTracksEndpointSummary()
{
Summary = "Draws a random selection of tracks from a media library, an artist or an album.";
Description = "Returns uniformly random tracks from every track of the whole library, of one artist, or of one album, selected by the database itself. The client can pass the tracks it already queued to exclude them, so consecutive batches of a shuffle do not repeat a track. The request is returned to an Admin, who can shuffle all libraries, or to the owner of the library.";
ExampleRequest = new ShuffleTracksRequest(
Count: 100,
ArtistId: null,
AlbumId: null,
ExcludedTrackIds: [Guid.NewGuid(), Guid.NewGuid()]
);
RequestParam(r => r.Count, "The maximum number of tracks to return, between 1 and 500.");
RequestParam(r => r.ArtistId, "The artist whose tracks are sampled. Optional.");
RequestParam(r => r.AlbumId, "The album whose tracks are sampled. Optional.");
RequestParam(r => r.ExcludedTrackIds, "The tracks that must not be returned. Optional.");
ResponseParam<ShuffleTrackResponse>(r => r.TrackId, "The Id of the track.");
ResponseParam<ShuffleTrackResponse>(r => r.Title, "The title of the track.");
ResponseParam<ShuffleTrackResponse>(r => r.DurationInSeconds, "The duration of the track in seconds.");
ResponseParam<ShuffleTrackResponse>(r => r.AlbumId, "The Id of the album the track belongs to.");
ResponseParam<ShuffleTrackResponse>(r => r.AlbumTitle, "The title of the album the track belongs to.");
ResponseParam<ShuffleTrackResponse>(r => r.ArtistId, "The Id of the artist the album belongs to.");
ResponseParam<ShuffleTrackResponse>(r => r.CoverPath, "The path of the cover of the album, if available.");
Response(200, "The random selection of tracks is returned.",
example: new List<ShuffleTrackResponse>
{
new(
TrackId: Guid.NewGuid(),
Title: "Bohemian Rhapsody",
DurationInSeconds: 354,
AlbumId: Guid.NewGuid(),
AlbumTitle: "A Night at the Opera",
ArtistId: Guid.NewGuid(),
CoverPath: "/music/queen/a-night-at-the-opera/cover.jpg"
)
}
);
Response(401, "Authentication required.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc7235#section-3.1",
status = 401,
title = "Unauthorized",
detail = "Authentication failed",
instance = $"/api/v1/libraries/{Guid.NewGuid()}/tracks/shuffle"
}
);
Response(403, "The request failed because the user making the request is not an Admin, or the owner of the media library.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc9110#section-15.5.4",
title = "General.Unauthorized",
status = 403,
detail = "NotAuthorized",
instance = $"/api/v1/libraries/{Guid.NewGuid()}/tracks/shuffle",
traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00"
}
);
Response(422, "The request did not pass validation checks.", "application/problem+json",
example: new
{
type = "https://tools.ietf.org/html/rfc4918#section-11.2",
title = "General.Validation",
status = 422,
detail = "OneOrMoreValidationErrorsOccurred",
instance = $"/api/v1/libraries/{Guid.NewGuid()}/tracks/shuffle",
errors = new Dictionary<string, string[]>
{
{
"General.Validation", new[]
{
"LibraryIdCannotBeEmpty",
"ShuffleTrackCountMustBeGreaterThanZero",
"ShuffleTrackCountMustBeAtMost500"
}
}
},
traceId = "00-2470be4248a2a5a0c6f70579975a6954-b9c3ba9544a03500-00"
}
);
}
}
@@ -26,6 +26,11 @@ public class MusicAlbumDto
/// </summary>
public Guid ArtistId { get; set; }
/// <summary>
/// Gets or sets the name of the artist the album belongs to.
/// </summary>
public string ArtistName { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the Id of the media library this album belongs to.
/// </summary>
@@ -0,0 +1,48 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary;
/// <summary>
/// Data transfer object for a track returned by a randomized shuffle query.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class MusicShuffleTrackDto
{
/// <summary>
/// Gets or sets the Id of the track.
/// </summary>
public Guid TrackId { get; set; }
/// <summary>
/// Gets or sets the title of the track.
/// </summary>
public string Title { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the duration of the track in seconds.
/// </summary>
public int DurationInSeconds { get; set; }
/// <summary>
/// Gets or sets the Id of the album the track belongs to.
/// </summary>
public Guid AlbumId { get; set; }
/// <summary>
/// Gets or sets the title of the album the track belongs to.
/// </summary>
public string AlbumTitle { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the Id of the artist the album belongs to.
/// </summary>
public Guid ArtistId { get; set; }
/// <summary>
/// Gets or sets the path of the cover of the album, if available.
/// </summary>
public string? CoverPath { get; set; }
}
@@ -0,0 +1,24 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Represents a request to draw a random selection of tracks from a media library, an artist or an album.
/// </summary>
/// <param name="LibraryId">The unique identifier of the media library the tracks are sampled from. Required.</param>
/// <param name="Count">The maximum number of tracks to return. Required.</param>
/// <param name="ArtistId">The unique identifier of the artist whose tracks are sampled. Optional.</param>
/// <param name="AlbumId">The unique identifier of the album whose tracks are sampled. Optional.</param>
/// <param name="ExcludedTrackIds">The tracks that must not be returned, usually the ones already in the queue. Optional.</param>
[DebuggerDisplay("LibraryId: {LibraryId} Count: {Count}")]
public record ShuffleTracksRequest(
Guid LibraryId,
int Count,
Guid? ArtistId,
Guid? AlbumId,
List<Guid>? ExcludedTrackIds
);
@@ -21,6 +21,7 @@ public static partial class ApiRoutes
public const string UPDATE_ALBUM_COVER = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}/cover";
public const string DELETE_ALBUM = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}";
public const string GET_ALBUM_TRACKS_LITE = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/lite";
public const string SHUFFLE_TRACKS = "libraries/{libraryId}/tracks/shuffle";
public const string GET_TRACK = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}";
public const string UPDATE_TRACK = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}";
public const string DELETE_TRACK = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}";
@@ -24,6 +24,7 @@ public static partial class WebRoutes
public const string UPDATE_ALBUM_COVER = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-update-cover";
public const string DELETE_ALBUM = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-delete-album";
public const string GET_ALBUM_TRACKS = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/api-get-tracks";
public const string SHUFFLE_TRACKS = "{culture}/library/audio-library/music-library/tracks/api-shuffle-tracks";
public const string TRACK = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}";
public const string GET_TRACK = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}/api-get-track";
public const string SAVE_TRACK = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}/api-save-track";
@@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Localization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading;
@@ -88,6 +89,13 @@ public class EditMusicAlbumViewEndpoint : BaseEndpoint<GetMusicAlbumViewRequest,
request = request with { AlbumId = Guid.TryParse(request.AlbumId, out Guid albumId) ? albumId.ToString() : Guid.Empty.ToString() };
MusicAlbumDto album = await _apiHttpClient.GetAsync<MusicAlbumDto>(ApiRoutes.Music.GET_ALBUM.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{artistId}", request.ArtistId).Replace("{albumId}", request.AlbumId), cancellationToken).ConfigureAwait(false);
string title = album.Metadata?.Title ?? string.Empty;
// The play album trigger presents the album, so it carries the same cover this page displays: the stored cover, or the first stored artwork when the album has no cover.
string albumCoverPath = album.CoverPath ?? string.Empty;
if (string.IsNullOrWhiteSpace(albumCoverPath))
albumCoverPath = (album.Artwork ?? []).FirstOrDefault(artwork => !string.IsNullOrWhiteSpace(artwork.Path))?.Path ?? string.Empty;
// A release the API already reported as empty has nothing to play, so the themed play trigger starts disabled. The
// release list the page loads later only refines this state, and a failed request never changes it.
bool albumHasTracks = (album.Tracks?.Count ?? 0) > 0;
// The themed view is a regular page that submits its own requests, so a fresh anti-forgery token must be issued for it.
AntiforgeryTokenSet antiforgeryTokens = _antiforgery.GetAndStoreTokens(HttpContext);
@@ -109,6 +117,9 @@ public class EditMusicAlbumViewEndpoint : BaseEndpoint<GetMusicAlbumViewRequest,
["trackUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.TRACK, new { artistId = default(Guid), albumId = default(Guid), trackId = default(Guid) }) ?? string.Empty,
["coverUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.UPDATE_ALBUM_COVER, new { artistId = default(Guid), albumId = default(Guid) }) ?? string.Empty,
["backUrl"] = (_urlService.GetAbsoluteUrl(WebRoutes.Music.ARTIST, new { artistId = album.ArtistId }) ?? string.Empty) + "?libraryId=" + album.LibraryId,
["albumTitle"] = title,
["albumCoverPath"] = albumCoverPath,
["albumHasTracks"] = albumHasTracks,
["albumJson"] = JsonSerializer.Serialize(album, s_camelCaseJsonOptions),
["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer),
["stringsJson"] = JsonSerializer.Serialize(ThemePageDataFactory.CreateLocalizedStrings(_localizer), s_camelCaseJsonOptions)
@@ -87,6 +87,9 @@ public class EditMusicArtistViewEndpoint : BaseEndpoint<GetMusicArtistViewReques
request = request with { ArtistId = Guid.TryParse(request.ArtistId, out Guid artistId) ? artistId.ToString() : Guid.Empty.ToString() };
MusicArtistDto artist = await _apiHttpClient.GetAsync<MusicArtistDto>(ApiRoutes.Music.GET_ARTIST.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{artistId}", request.ArtistId), cancellationToken).ConfigureAwait(false);
string title = artist.Metadata?.Name ?? string.Empty;
// An artist the API already reported without releases has nothing to play, so the themed play trigger starts disabled.
// The release list the page loads later only refines this state, and a failed request never changes it.
bool artistHasReleases = (artist.Albums?.Count ?? 0) > 0;
// The themed view is a regular page that submits its own requests, so a fresh anti-forgery token must be issued for it.
AntiforgeryTokenSet antiforgeryTokens = _antiforgery.GetAndStoreTokens(HttpContext);
@@ -108,6 +111,9 @@ public class EditMusicArtistViewEndpoint : BaseEndpoint<GetMusicArtistViewReques
["deleteAlbumUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.DELETE_ALBUM, new { artistId = default(Guid), albumId = default(Guid) }) ?? string.Empty,
["coverUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.UPDATE_ARTIST_COVER, new { artistId = default(Guid) }) ?? string.Empty,
["backUrl"] = (_urlService.GetAbsoluteUrl(WebRoutes.Music.ARTISTS_INDEX) ?? string.Empty) + "?libraryId=" + artist.LibraryId,
["artistName"] = title,
["artistCoverPath"] = artist.CoverPath ?? string.Empty,
["artistHasReleases"] = artistHasReleases,
["artistJson"] = JsonSerializer.Serialize(artist, s_camelCaseJsonOptions),
["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer),
["stringsJson"] = JsonSerializer.Serialize(ThemePageDataFactory.CreateLocalizedStrings(_localizer), s_camelCaseJsonOptions)
@@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Localization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading;
@@ -95,6 +96,12 @@ public class EditMusicTrackViewEndpoint : BaseEndpoint<GetMusicTrackViewRequest,
// The cover shown on the left of the track page is the cover of the album that holds the track, so the album is fetched alongside the track.
MusicAlbumDto album = await _apiHttpClient.GetAsync<MusicAlbumDto>(
ApiRoutes.Music.GET_ALBUM.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{artistId}", normalizedArtistId).Replace("{albumId}", normalizedAlbumId), cancellationToken).ConfigureAwait(false);
// The track page and its play trigger show the same cover the album page shows: the stored cover, or the first stored
// artwork when the album has no cover. It is resolved once and used for both the themed page data and the fallback view.
string albumCoverPath = album.CoverPath ?? string.Empty;
if (string.IsNullOrWhiteSpace(albumCoverPath))
albumCoverPath = (album.Artwork ?? []).FirstOrDefault(artwork => !string.IsNullOrWhiteSpace(artwork.Path))?.Path ?? string.Empty;
string albumTitle = album.Metadata?.Title ?? string.Empty;
// The themed view is a regular page that submits its own requests, so a fresh anti-forgery token must be issued for it.
AntiforgeryTokenSet antiforgeryTokens = _antiforgery.GetAndStoreTokens(HttpContext);
@@ -114,7 +121,10 @@ public class EditMusicTrackViewEndpoint : BaseEndpoint<GetMusicTrackViewRequest,
["saveUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.SAVE_TRACK, new { artistId = default(Guid), albumId = default(Guid), trackId = default(Guid) }) ?? string.Empty,
["deleteUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.DELETE_TRACK, new { artistId = default(Guid), albumId = default(Guid), trackId = default(Guid) }) ?? string.Empty,
["backUrl"] = (_urlService.GetAbsoluteUrl(WebRoutes.Music.ALBUM, new { artistId = normalizedArtistId, albumId = track.AlbumId }) ?? string.Empty) + "?libraryId=" + track.LibraryId,
["albumCoverPath"] = album.CoverPath ?? string.Empty,
["albumCoverPath"] = albumCoverPath,
["albumTitle"] = albumTitle,
["trackTitle"] = title,
["trackDurationInSeconds"] = track.Metadata?.DurationInSeconds,
["trackJson"] = JsonSerializer.Serialize(track, s_camelCaseJsonOptions),
["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer),
["stringsJson"] = JsonSerializer.Serialize(ThemePageDataFactory.CreateLocalizedStrings(_localizer), s_camelCaseJsonOptions)
@@ -127,7 +137,9 @@ public class EditMusicTrackViewEndpoint : BaseEndpoint<GetMusicTrackViewRequest,
Dictionary<string, object?> viewData = new()
{
["Title"] = title,
["AlbumCoverPath"] = album.CoverPath ?? string.Empty
["ArtistId"] = normalizedArtistId,
["AlbumCoverPath"] = albumCoverPath,
["AlbumTitle"] = albumTitle
};
return View("/Core/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.cshtml", track, viewData);
}
@@ -0,0 +1,67 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary;
using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.ShuffleTracks;
/// <summary>
/// API endpoint for the <c>/{culture}/library/audio-library/music-library/tracks/api-shuffle-tracks</c> route.
/// </summary>
public class ShuffleTracksEndpoint : BaseEndpoint<ShuffleTracksRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="ShuffleTracksEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public ShuffleTracksEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.POST);
Routes(WebRoutes.Music.SHUFFLE_TRACKS);
DontAutoTag();
Options(options => options.WithTags("Music"));
}
/// <summary>
/// Retrieves a random selection of tracks of the library identified in the request.
/// </summary>
/// <param name="request">The request containing the selection size, the optional scope and the tracks to exclude.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(ShuffleTracksRequest request, CancellationToken cancellationToken)
{
List<MusicShuffleTrackDto> response = await _apiHttpClient.PostAsync<List<MusicShuffleTrackDto>, ShuffleTracksRequest>(
BuildEndpoint(request.LibraryId), request, cancellationToken).ConfigureAwait(false);
return JsonSuccess(response);
}
/// <summary>
/// Builds the API endpoint used to retrieve a random selection of tracks.
/// </summary>
/// <param name="libraryId">The Id of the media library the tracks are sampled from.</param>
/// <returns>The API endpoint to which the retrieval request is sent.</returns>
private static string BuildEndpoint(Guid libraryId)
{
// The strongly typed Id is formatted as a Guid, so the substituted route value can never escape its URL segment.
return ApiRoutes.Music.SHUFFLE_TRACKS.Replace("{libraryId}", libraryId.ToString());
}
}
@@ -0,0 +1,36 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary;
using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks;
using System;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.ShuffleTracks;
/// <summary>
/// Class used for providing a textual description for the <see cref="ShuffleTracksEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class ShuffleTracksEndpointSummary : Summary<ShuffleTracksEndpoint, ShuffleTracksRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="ShuffleTracksEndpointSummary"/> class.
/// </summary>
public ShuffleTracksEndpointSummary()
{
Summary = "Draws a random selection of tracks from a media library, an artist or an album.";
Description = "Returns uniformly random tracks from the whole library, one artist, or one album, excluding the tracks the caller already queued. The tracks are selected by the API database, so a large library does not have to be enumerated by the browser.";
Response(200, "The random selection of tracks is returned.", example: new[] { new MusicShuffleTrackDto
{
TrackId = Guid.NewGuid(),
Title = "Bohemian Rhapsody",
DurationInSeconds = 354,
AlbumId = Guid.NewGuid(),
AlbumTitle = "A Night at the Opera",
ArtistId = Guid.NewGuid(),
CoverPath = "/music/queen/a-night-at-the-opera/cover.jpg"
}});
}
}
@@ -843,4 +843,10 @@
<data name="StreamingQualityCannotBeNull" xml:space="preserve">
<value>لا يمكن أن تكون جودة البث فارغة!</value>
</data>
<data name="ShuffleTrackCountMustBeGreaterThanZero" xml:space="preserve">
<value>يجب أن يكون عدد المقطوعات العشوائية أكبر من صفر!</value>
</data>
<data name="ShuffleTrackCountMustBeAtMost500" xml:space="preserve">
<value>يجب ألا يتجاوز عدد المقطوعات العشوائية 500!</value>
</data>
</root>
@@ -843,4 +843,10 @@
<data name="StreamingQualityCannotBeNull" xml:space="preserve">
<value>Die Streaming-Qualität darf nicht null sein!</value>
</data>
<data name="ShuffleTrackCountMustBeGreaterThanZero" xml:space="preserve">
<value>Die Anzahl der Shuffle-Titel muss größer als null sein!</value>
</data>
<data name="ShuffleTrackCountMustBeAtMost500" xml:space="preserve">
<value>Die Anzahl der Shuffle-Titel darf höchstens 500 betragen!</value>
</data>
</root>
@@ -843,4 +843,10 @@
<data name="StreamingQualityCannotBeNull" xml:space="preserve">
<value>The streaming quality cannot be null!</value>
</data>
<data name="ShuffleTrackCountMustBeGreaterThanZero" xml:space="preserve">
<value>The shuffle track count must be greater than zero!</value>
</data>
<data name="ShuffleTrackCountMustBeAtMost500" xml:space="preserve">
<value>The shuffle track count must be at most 500!</value>
</data>
</root>
@@ -843,4 +843,10 @@
<data name="StreamingQualityCannotBeNull" xml:space="preserve">
<value>¡La calidad de transmisión no puede ser nula!</value>
</data>
<data name="ShuffleTrackCountMustBeGreaterThanZero" xml:space="preserve">
<value>¡La cantidad de pistas de reproducción aleatoria debe ser mayor que cero!</value>
</data>
<data name="ShuffleTrackCountMustBeAtMost500" xml:space="preserve">
<value>¡La cantidad de pistas de reproducción aleatoria no debe superar 500!</value>
</data>
</root>
@@ -843,4 +843,10 @@
<data name="StreamingQualityCannotBeNull" xml:space="preserve">
<value>La qualité de diffusion ne peut pas être nulle !</value>
</data>
<data name="ShuffleTrackCountMustBeGreaterThanZero" xml:space="preserve">
<value>Le nombre de pistes du shuffle doit être supérieur à zéro !</value>
</data>
<data name="ShuffleTrackCountMustBeAtMost500" xml:space="preserve">
<value>Le nombre de pistes du shuffle ne doit pas dépasser 500 !</value>
</data>
</root>
@@ -843,4 +843,10 @@
<data name="StreamingQualityCannotBeNull" xml:space="preserve">
<value>La qualità dello streaming non può essere nulla!</value>
</data>
<data name="ShuffleTrackCountMustBeGreaterThanZero" xml:space="preserve">
<value>Il numero di brani dello shuffle deve essere maggiore di zero!</value>
</data>
<data name="ShuffleTrackCountMustBeAtMost500" xml:space="preserve">
<value>Il numero di brani dello shuffle non può superare 500!</value>
</data>
</root>
@@ -843,4 +843,10 @@
<data name="StreamingQualityCannotBeNull" xml:space="preserve">
<value>ストリーミング品質は null にできません。</value>
</data>
<data name="ShuffleTrackCountMustBeGreaterThanZero" xml:space="preserve">
<value>シャッフルするトラック数は 0 より大きい必要があります。</value>
</data>
<data name="ShuffleTrackCountMustBeAtMost500" xml:space="preserve">
<value>シャッフルするトラック数は 500 以下である必要があります。</value>
</data>
</root>
@@ -843,4 +843,10 @@
<data name="StreamingQualityCannotBeNull" xml:space="preserve">
<value>The streaming quality cannot be null!</value>
</data>
<data name="ShuffleTrackCountMustBeGreaterThanZero" xml:space="preserve">
<value>The shuffle track count must be greater than zero!</value>
</data>
<data name="ShuffleTrackCountMustBeAtMost500" xml:space="preserve">
<value>The shuffle track count must be at most 500!</value>
</data>
</root>
@@ -843,4 +843,10 @@
<data name="StreamingQualityCannotBeNull" xml:space="preserve">
<value>Calitatea fluxului nu poate fi nulă!</value>
</data>
<data name="ShuffleTrackCountMustBeGreaterThanZero" xml:space="preserve">
<value>Numărul de piste pentru redare aleatorie trebuie să fie mai mare decât zero!</value>
</data>
<data name="ShuffleTrackCountMustBeAtMost500" xml:space="preserve">
<value>Numărul de piste pentru redare aleatorie nu poate depăși 500!</value>
</data>
</root>
@@ -843,4 +843,10 @@
<data name="StreamingQualityCannotBeNull" xml:space="preserve">
<value>Якість потокового передавання не може бути порожньою!</value>
</data>
<data name="ShuffleTrackCountMustBeGreaterThanZero" xml:space="preserve">
<value>Кількість треків для перемішування має бути більшою за нуль!</value>
</data>
<data name="ShuffleTrackCountMustBeAtMost500" xml:space="preserve">
<value>Кількість треків для перемішування не може перевищувати 500!</value>
</data>
</root>
@@ -843,4 +843,10 @@
<data name="StreamingQualityCannotBeNull" xml:space="preserve">
<value>流媒体质量不能为空!</value>
</data>
<data name="ShuffleTrackCountMustBeGreaterThanZero" xml:space="preserve">
<value>随机播放曲目数必须大于零!</value>
</data>
<data name="ShuffleTrackCountMustBeAtMost500" xml:space="preserve">
<value>随机播放曲目数不能超过 500!</value>
</data>
</root>
@@ -120,4 +120,13 @@
<data name="NoLibraries" xml:space="preserve">
<value>لا توجد مكتبات</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>تشغيل عشوائي</value>
</data>
<data name="Play" xml:space="preserve">
<value>تشغيل</value>
</data>
<data name="Actions" xml:space="preserve">
<value>الإجراءات</value>
</data>
</root>
@@ -120,4 +120,13 @@
<data name="NoLibraries" xml:space="preserve">
<value>Keine Bibliotheken</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Zufällige Wiedergabe</value>
</data>
<data name="Play" xml:space="preserve">
<value>Abspielen</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Aktionen</value>
</data>
</root>
@@ -120,4 +120,13 @@
<data name="NoLibraries" xml:space="preserve">
<value>No libraries</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Shuffle</value>
</data>
<data name="Play" xml:space="preserve">
<value>Play</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Actions</value>
</data>
</root>
@@ -120,4 +120,13 @@
<data name="NoLibraries" xml:space="preserve">
<value>Sin bibliotecas</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Aleatorio</value>
</data>
<data name="Play" xml:space="preserve">
<value>Reproducir</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Acciones</value>
</data>
</root>
@@ -120,4 +120,13 @@
<data name="NoLibraries" xml:space="preserve">
<value>Aucune bibliothèque</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Lecture aléatoire</value>
</data>
<data name="Play" xml:space="preserve">
<value>Lecture</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Actions</value>
</data>
</root>
@@ -120,4 +120,13 @@
<data name="NoLibraries" xml:space="preserve">
<value>Nessuna libreria</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Riproduzione casuale</value>
</data>
<data name="Play" xml:space="preserve">
<value>Riproduci</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Azioni</value>
</data>
</root>
@@ -120,4 +120,13 @@
<data name="NoLibraries" xml:space="preserve">
<value>ライブラリがありません</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>シャッフル</value>
</data>
<data name="Play" xml:space="preserve">
<value>再生</value>
</data>
<data name="Actions" xml:space="preserve">
<value>操作</value>
</data>
</root>
@@ -120,4 +120,13 @@
<data name="NoLibraries" xml:space="preserve">
<value>No libraries</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Shuffle</value>
</data>
<data name="Play" xml:space="preserve">
<value>Play</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Actions</value>
</data>
</root>
@@ -120,4 +120,13 @@
<data name="NoLibraries" xml:space="preserve">
<value>Nicio bibliotecă</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Aleatoriu</value>
</data>
<data name="Play" xml:space="preserve">
<value>Redare</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Acțiuni</value>
</data>
</root>
@@ -120,4 +120,13 @@
<data name="NoLibraries" xml:space="preserve">
<value>Немає бібліотек</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Перемішати</value>
</data>
<data name="Play" xml:space="preserve">
<value>Відтворити</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Дії</value>
</data>
</root>
@@ -120,4 +120,13 @@
<data name="NoLibraries" xml:space="preserve">
<value>无库</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>随机播放</value>
</data>
<data name="Play" xml:space="preserve">
<value>播放</value>
</data>
<data name="Actions" xml:space="preserve">
<value>操作</value>
</data>
</root>
@@ -1506,4 +1506,10 @@
<data name="Identifiers" xml:space="preserve">
<value>المعرّفات</value>
</data>
<data name="PlayAlbum" xml:space="preserve">
<value>تشغيل الألبوم</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>تشغيل المقطع</value>
</data>
</root>
@@ -1506,4 +1506,10 @@
<data name="Identifiers" xml:space="preserve">
<value>Kennungen</value>
</data>
<data name="PlayAlbum" xml:space="preserve">
<value>Album abspielen</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Titel abspielen</value>
</data>
</root>
@@ -1506,4 +1506,10 @@
<data name="Identifiers" xml:space="preserve">
<value>Identifiers</value>
</data>
<data name="PlayAlbum" xml:space="preserve">
<value>Play album</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Play track</value>
</data>
</root>
@@ -1506,4 +1506,10 @@
<data name="Identifiers" xml:space="preserve">
<value>Identificadores</value>
</data>
<data name="PlayAlbum" xml:space="preserve">
<value>Reproducir el álbum</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Reproducir la pista</value>
</data>
</root>
@@ -1506,4 +1506,10 @@
<data name="Identifiers" xml:space="preserve">
<value>Identifiants</value>
</data>
<data name="PlayAlbum" xml:space="preserve">
<value>Lire l'album</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Lire la piste</value>
</data>
</root>
@@ -1506,4 +1506,10 @@
<data name="Identifiers" xml:space="preserve">
<value>Identificatori</value>
</data>
<data name="PlayAlbum" xml:space="preserve">
<value>Riproduci l'album</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Riproduci il brano</value>
</data>
</root>
@@ -1506,4 +1506,10 @@
<data name="Identifiers" xml:space="preserve">
<value>識別子</value>
</data>
<data name="PlayAlbum" xml:space="preserve">
<value>アルバムを再生</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>トラックを再生</value>
</data>
</root>
@@ -1506,4 +1506,10 @@
<data name="Identifiers" xml:space="preserve">
<value>Identifiers</value>
</data>
<data name="PlayAlbum" xml:space="preserve">
<value>Play album</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Play track</value>
</data>
</root>
@@ -1506,4 +1506,10 @@
<data name="Identifiers" xml:space="preserve">
<value>Identificatori</value>
</data>
<data name="PlayAlbum" xml:space="preserve">
<value>Redă albumul</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Redă piesa</value>
</data>
</root>
@@ -1506,4 +1506,10 @@
<data name="Identifiers" xml:space="preserve">
<value>Ідентифікатори</value>
</data>
<data name="PlayAlbum" xml:space="preserve">
<value>Відтворити альбом</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Відтворити трек</value>
</data>
</root>
@@ -1506,4 +1506,10 @@
<data name="Identifiers" xml:space="preserve">
<value>标识符</value>
</data>
<data name="PlayAlbum" xml:space="preserve">
<value>播放专辑</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>播放曲目</value>
</data>
</root>
@@ -57,4 +57,13 @@
<data name="DeleteFailed" xml:space="preserve">
<value>تعذر حذف العنصر.</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>تشغيل عشوائي</value>
</data>
<data name="Play" xml:space="preserve">
<value>تشغيل</value>
</data>
<data name="Actions" xml:space="preserve">
<value>الإجراءات</value>
</data>
</root>
@@ -57,4 +57,13 @@
<data name="DeleteFailed" xml:space="preserve">
<value>Das Element konnte nicht gelöscht werden.</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Zufällige Wiedergabe</value>
</data>
<data name="Play" xml:space="preserve">
<value>Abspielen</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Aktionen</value>
</data>
</root>
@@ -57,4 +57,13 @@
<data name="DeleteFailed" xml:space="preserve">
<value>The item could not be deleted.</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Shuffle</value>
</data>
<data name="Play" xml:space="preserve">
<value>Play</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Actions</value>
</data>
</root>
@@ -57,4 +57,13 @@
<data name="DeleteFailed" xml:space="preserve">
<value>No se ha podido eliminar el elemento.</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Aleatorio</value>
</data>
<data name="Play" xml:space="preserve">
<value>Reproducir</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Acciones</value>
</data>
</root>
@@ -57,4 +57,13 @@
<data name="DeleteFailed" xml:space="preserve">
<value>L'élément n'a pas pu être supprimé.</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Lecture aléatoire</value>
</data>
<data name="Play" xml:space="preserve">
<value>Lecture</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Actions</value>
</data>
</root>
@@ -57,4 +57,13 @@
<data name="DeleteFailed" xml:space="preserve">
<value>Non è stato possibile eliminare l'elemento.</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Riproduzione casuale</value>
</data>
<data name="Play" xml:space="preserve">
<value>Riproduci</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Azioni</value>
</data>
</root>
@@ -57,4 +57,13 @@
<data name="DeleteFailed" xml:space="preserve">
<value>項目を削除できませんでした。</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>シャッフル</value>
</data>
<data name="Play" xml:space="preserve">
<value>再生</value>
</data>
<data name="Actions" xml:space="preserve">
<value>操作</value>
</data>
</root>
@@ -57,4 +57,13 @@
<data name="DeleteFailed" xml:space="preserve">
<value>The item could not be deleted.</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Shuffle</value>
</data>
<data name="Play" xml:space="preserve">
<value>Play</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Actions</value>
</data>
</root>
@@ -57,4 +57,13 @@
<data name="DeleteFailed" xml:space="preserve">
<value>Elementul nu a putut fi șters.</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Aleatoriu</value>
</data>
<data name="Play" xml:space="preserve">
<value>Redare</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Acțiuni</value>
</data>
</root>
@@ -57,4 +57,13 @@
<data name="DeleteFailed" xml:space="preserve">
<value>Не вдалося видалити елемент.</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Перемішати</value>
</data>
<data name="Play" xml:space="preserve">
<value>Відтворити</value>
</data>
<data name="Actions" xml:space="preserve">
<value>Дії</value>
</data>
</root>
@@ -57,4 +57,13 @@
<data name="DeleteFailed" xml:space="preserve">
<value>无法删除该项目。</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>随机播放</value>
</data>
<data name="Play" xml:space="preserve">
<value>播放</value>
</data>
<data name="Actions" xml:space="preserve">
<value>操作</value>
</data>
</root>
@@ -1083,4 +1083,13 @@
<data name="AddIsni" xml:space="preserve">
<value>إضافة ISNI</value>
</data>
<data name="PlayAll" xml:space="preserve">
<value>تشغيل الكل</value>
</data>
<data name="Play" xml:space="preserve">
<value>تشغيل</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>تشغيل عشوائي</value>
</data>
</root>
@@ -1083,4 +1083,13 @@
<data name="AddIsni" xml:space="preserve">
<value>ISNI hinzufügen</value>
</data>
<data name="PlayAll" xml:space="preserve">
<value>Alle abspielen</value>
</data>
<data name="Play" xml:space="preserve">
<value>Abspielen</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Zufällige Wiedergabe</value>
</data>
</root>
@@ -1083,4 +1083,13 @@
<data name="AddIsni" xml:space="preserve">
<value>Add ISNI</value>
</data>
<data name="PlayAll" xml:space="preserve">
<value>Play all</value>
</data>
<data name="Play" xml:space="preserve">
<value>Play</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Shuffle</value>
</data>
</root>
@@ -1083,4 +1083,13 @@
<data name="AddIsni" xml:space="preserve">
<value>Añadir ISNI</value>
</data>
<data name="PlayAll" xml:space="preserve">
<value>Reproducir todo</value>
</data>
<data name="Play" xml:space="preserve">
<value>Reproducir</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Aleatorio</value>
</data>
</root>
@@ -1083,4 +1083,13 @@
<data name="AddIsni" xml:space="preserve">
<value>Ajouter un ISNI</value>
</data>
<data name="PlayAll" xml:space="preserve">
<value>Tout lire</value>
</data>
<data name="Play" xml:space="preserve">
<value>Lire</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Lecture aléatoire</value>
</data>
</root>
@@ -1083,4 +1083,13 @@
<data name="AddIsni" xml:space="preserve">
<value>Aggiungi ISNI</value>
</data>
<data name="PlayAll" xml:space="preserve">
<value>Riproduci tutto</value>
</data>
<data name="Play" xml:space="preserve">
<value>Riproduci</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Riproduzione casuale</value>
</data>
</root>
@@ -1083,4 +1083,13 @@
<data name="AddIsni" xml:space="preserve">
<value>ISNI を追加</value>
</data>
<data name="PlayAll" xml:space="preserve">
<value>すべて再生</value>
</data>
<data name="Play" xml:space="preserve">
<value>再生</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>シャッフル</value>
</data>
</root>
@@ -1083,4 +1083,13 @@
<data name="AddIsni" xml:space="preserve">
<value>Add ISNI</value>
</data>
<data name="PlayAll" xml:space="preserve">
<value>Play all</value>
</data>
<data name="Play" xml:space="preserve">
<value>Play</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Shuffle</value>
</data>
</root>
@@ -1083,4 +1083,13 @@
<data name="AddIsni" xml:space="preserve">
<value>Adaugă ISNI</value>
</data>
<data name="PlayAll" xml:space="preserve">
<value>Redă tot</value>
</data>
<data name="Play" xml:space="preserve">
<value>Redă</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Aleatoriu</value>
</data>
</root>
@@ -1083,4 +1083,13 @@
<data name="AddIsni" xml:space="preserve">
<value>Додати ISNI</value>
</data>
<data name="PlayAll" xml:space="preserve">
<value>Відтворити все</value>
</data>
<data name="Play" xml:space="preserve">
<value>Відтворити</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>Перемішати</value>
</data>
</root>
@@ -1083,4 +1083,13 @@
<data name="AddIsni" xml:space="preserve">
<value>添加 ISNI</value>
</data>
<data name="PlayAll" xml:space="preserve">
<value>全部播放</value>
</data>
<data name="Play" xml:space="preserve">
<value>播放</value>
</data>
<data name="Shuffle" xml:space="preserve">
<value>随机播放</value>
</data>
</root>
@@ -1179,4 +1179,7 @@
<data name="AddWorkIswc" xml:space="preserve">
<value>إضافة ISWC</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>تشغيل المقطع</value>
</data>
</root>
@@ -1179,4 +1179,7 @@
<data name="AddWorkIswc" xml:space="preserve">
<value>ISWC hinzufügen</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Titel abspielen</value>
</data>
</root>
@@ -1179,4 +1179,7 @@
<data name="AddWorkIswc" xml:space="preserve">
<value>Add ISWC</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Play track</value>
</data>
</root>
@@ -1179,4 +1179,7 @@
<data name="AddWorkIswc" xml:space="preserve">
<value>Añadir ISWC</value>
</data>
<data name="PlayTrack" xml:space="preserve">
<value>Reproducir la pista</value>
</data>
</root>
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff. Show more