diff --git a/docs/manual/using-lumina/index.md b/docs/manual/using-lumina/index.md
index bcdc3981..e7cdfd01 100644
--- a/docs/manual/using-lumina/index.md
+++ b/docs/manual/using-lumina/index.md
@@ -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.
diff --git a/docs/technical/api/library/audio-library/music-library/Api.Albums.md b/docs/technical/api/library/audio-library/music-library/Api.Albums.md
index 571214d8..c69b3693 100644
--- a/docs/technical/api/library/audio-library/music-library/Api.Albums.md
+++ b/docs/technical/api/library/audio-library/music-library/Api.Albums.md
@@ -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",
diff --git a/docs/technical/api/library/audio-library/music-library/Api.Tracks.md b/docs/technical/api/library/audio-library/music-library/Api.Tracks.md
index 4c5a0b53..6e8fe848 100644
--- a/docs/technical/api/library/audio-library/music-library/Api.Tracks.md
+++ b/docs/technical/api/library/audio-library/music-library/Api.Tracks.md
@@ -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
diff --git a/docs/technical/requests/library/audio-library/music-library/tracks/ShuffleTracks.http b/docs/technical/requests/library/audio-library/music-library/tracks/ShuffleTracks.http
new file mode 100644
index 00000000..4cdb383c
--- /dev/null
+++ b/docs/technical/requests/library/audio-library/music-library/tracks/ShuffleTracks.http
@@ -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": []
+}
diff --git a/docs/technical/theming/Theming.md b/docs/technical/theming/Theming.md
index 5122a2a7..3163df87 100644
--- a/docs/technical/theming/Theming.md
+++ b/docs/technical/theming/Theming.md
@@ -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}}`.
diff --git a/src/Lumina.Application/Common/DTO/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTrackRowDto.cs b/src/Lumina.Application/Common/DTO/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTrackRowDto.cs
new file mode 100644
index 00000000..d2cf7182
--- /dev/null
+++ b/src/Lumina.Application/Common/DTO/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTrackRowDto.cs
@@ -0,0 +1,46 @@
+#region ========================================================================= USING =====================================================================================
+using System;
+#endregion
+
+namespace Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
+
+///
+/// Read model of a track returned by a randomized shuffle query, carrying everything the client needs to queue and play it.
+///
+public sealed record ShuffleTrackRowDto
+{
+ ///
+ /// Gets the Id of the track.
+ ///
+ public required Guid TrackId { get; init; }
+
+ ///
+ /// Gets the title of the track.
+ ///
+ public required string Title { get; init; }
+
+ ///
+ /// Gets the duration of the track in seconds.
+ ///
+ public int DurationInSeconds { get; init; }
+
+ ///
+ /// Gets the Id of the album the track belongs to.
+ ///
+ public required Guid AlbumId { get; init; }
+
+ ///
+ /// Gets the title of the album the track belongs to.
+ ///
+ public required string AlbumTitle { get; init; }
+
+ ///
+ /// Gets the Id of the artist the album belongs to.
+ ///
+ public required Guid ArtistId { get; init; }
+
+ ///
+ /// Gets the path of the cover of the album, if available.
+ ///
+ public string? CoverPath { get; init; }
+}
diff --git a/src/Lumina.Application/Common/DataAccess/Repositories/MusicLibrary/ITrackRepository.cs b/src/Lumina.Application/Common/DataAccess/Repositories/MusicLibrary/ITrackRepository.cs
index 8b7d42ce..3e651d1f 100644
--- a/src/Lumina.Application/Common/DataAccess/Repositories/MusicLibrary/ITrackRepository.cs
+++ b/src/Lumina.Application/Common/DataAccess/Repositories/MusicLibrary/ITrackRepository.cs
@@ -49,6 +49,19 @@ public interface ITrackRepository : IRepository,
/// An containing either a paginated result of , or an error.
Task>> GetTracksLiteByAlbumIdAsync(Guid albumId, PaginationDataDto? paginationData, CancellationToken cancellationToken);
+ ///
+ /// Gets a uniformly random selection of tracks of the library identified by , optionally scoped to
+ /// an artist or an album, excluding the tracks in .
+ ///
+ /// The Id of the library whose tracks are sampled.
+ /// The Id of the artist whose tracks are sampled, or for every artist of the library.
+ /// The Id of the album whose tracks are sampled, or for every album of the scope.
+ /// The tracks that must not be returned.
+ /// The maximum number of tracks to return.
+ /// Cancellation token that can be used to stop the execution.
+ /// An containing either a collection of , or an error.
+ Task>> GetShuffleTracksLiteAsync(Guid libraryId, Guid? artistId, Guid? albumId, IReadOnlyCollection excludedTrackIds, int count, CancellationToken cancellationToken);
+
///
/// Gets the track of the library identified by that is stored at the provided .
///
diff --git a/src/Lumina.Application/Common/Mapping/MediaLibrary/AudioLibrary/MusicLibrary/Albums/AlbumEntityMapping.cs b/src/Lumina.Application/Common/Mapping/MediaLibrary/AudioLibrary/MusicLibrary/Albums/AlbumEntityMapping.cs
index 887dcb2c..105cc548 100644
--- a/src/Lumina.Application/Common/Mapping/MediaLibrary/AudioLibrary/MusicLibrary/Albums/AlbumEntityMapping.cs
+++ b/src/Lumina.Application/Common/Mapping/MediaLibrary/AudioLibrary/MusicLibrary/Albums/AlbumEntityMapping.cs
@@ -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,
diff --git a/src/Lumina.Application/Common/Mapping/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTrackRowDtoMapping.cs b/src/Lumina.Application/Common/Mapping/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTrackRowDtoMapping.cs
new file mode 100644
index 00000000..1850f39f
--- /dev/null
+++ b/src/Lumina.Application/Common/Mapping/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTrackRowDtoMapping.cs
@@ -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;
+
+///
+/// Extension methods for converting .
+///
+public static class ShuffleTrackRowDtoMapping
+{
+ ///
+ /// Converts to .
+ ///
+ /// The read model to be converted.
+ /// The converted response.
+ public static ShuffleTrackResponse ToResponse(this ShuffleTrackRowDto readModel)
+ {
+ return new ShuffleTrackResponse(
+ readModel.TrackId,
+ readModel.Title,
+ readModel.DurationInSeconds,
+ readModel.AlbumId,
+ readModel.AlbumTitle,
+ readModel.ArtistId,
+ readModel.CoverPath);
+ }
+
+ ///
+ /// Converts to a collection of .
+ ///
+ /// The read models to be converted.
+ /// The converted responses.
+ public static IReadOnlyList ToResponses(this IEnumerable readModels)
+ {
+ return [.. readModels.Select(readModel => readModel.ToResponse())];
+ }
+}
diff --git a/src/Lumina.Application/Common/Mapping/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTracksRequestMapping.cs b/src/Lumina.Application/Common/Mapping/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTracksRequestMapping.cs
new file mode 100644
index 00000000..83e1fd5d
--- /dev/null
+++ b/src/Lumina.Application/Common/Mapping/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTracksRequestMapping.cs
@@ -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;
+
+///
+/// Extension methods for converting .
+///
+public static class ShuffleTracksRequestMapping
+{
+ ///
+ /// Converts to .
+ ///
+ /// The request to be converted.
+ /// The Id of the library the tracks are sampled from, taken from the route.
+ /// The converted query.
+ public static ShuffleTracksQuery ToQuery(this ShuffleTracksRequest request, string? libraryId)
+ {
+ return new ShuffleTracksQuery(
+ libraryId,
+ request.Count,
+ request.ArtistId,
+ request.AlbumId,
+ request.ExcludedTrackIds);
+ }
+}
diff --git a/src/Lumina.Application/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Queries/ShuffleTracks/ShuffleTracksQuery.cs b/src/Lumina.Application/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Queries/ShuffleTracks/ShuffleTracksQuery.cs
new file mode 100644
index 00000000..9056c01d
--- /dev/null
+++ b/src/Lumina.Application/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Queries/ShuffleTracks/ShuffleTracksQuery.cs
@@ -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;
+
+///
+/// Query for getting a random selection of tracks from a media library, an artist or an album.
+///
+/// The unique identifier of the media library the tracks are sampled from, taken from the route.
+/// The maximum number of tracks to return.
+/// The unique identifier of the artist whose tracks are sampled, if applicable.
+/// The unique identifier of the album whose tracks are sampled, if applicable.
+/// The tracks that must not be returned, if any.
+[DebuggerDisplay("LibraryId: {LibraryId} Count: {Count}")]
+public record ShuffleTracksQuery(
+ string? LibraryId,
+ int Count,
+ Guid? ArtistId,
+ Guid? AlbumId,
+ IReadOnlyList? ExcludedTrackIds
+) : IQuery;
diff --git a/src/Lumina.Application/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Queries/ShuffleTracks/ShuffleTracksQueryHandler.cs b/src/Lumina.Application/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Queries/ShuffleTracks/ShuffleTracksQueryHandler.cs
new file mode 100644
index 00000000..6514ab72
--- /dev/null
+++ b/src/Lumina.Application/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Queries/ShuffleTracks/ShuffleTracksQueryHandler.cs
@@ -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;
+
+///
+/// Handler for the query to draw a random selection of tracks from a media library, an artist or an album.
+///
+public class ShuffleTracksQueryHandler : IQueryHandler>>
+{
+ private readonly IUnitOfWork _unitOfWork;
+ private readonly IAuthorizationService _authorizationService;
+ private readonly ICurrentUserService _currentUserService;
+ private readonly IValidator _validator;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Injected unit of work for interacting with the data access layer repositories.
+ /// Injected service for authorization related functionality.
+ /// Injected service to retrieve the current user information.
+ /// Injected validator for application validation rules.
+ public ShuffleTracksQueryHandler(IUnitOfWork unitOfWork, IAuthorizationService authorizationService, ICurrentUserService currentUserService, IValidator validator)
+ {
+ _unitOfWork = unitOfWork;
+ _authorizationService = authorizationService;
+ _currentUserService = currentUserService;
+ _validator = validator;
+ }
+
+ ///
+ /// Handles the query to draw a random selection of tracks from a media library, an artist or an album.
+ ///
+ /// The query to be handled.
+ /// Cancellation token that can be used to stop the execution.
+ ///
+ /// An containing either a collection of , or an error message.
+ ///
+ public async Task>> HandleAsync(ShuffleTracksQuery query, CancellationToken cancellationToken)
+ {
+ List 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(
+ userId, new LibraryOwnershipPolicyContext(libraryId), cancellationToken).ConfigureAwait(false);
+ if (!canAccessLibrary)
+ return ApplicationErrors.Authorization.NotAuthorized;
+
+ IReadOnlyCollection excludedTrackIds = query.ExcludedTrackIds is null
+ ? []
+ : [.. query.ExcludedTrackIds.Where(trackId => trackId != Guid.Empty).Distinct()];
+
+ Result> 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);
+ }
+}
diff --git a/src/Lumina.Application/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Queries/ShuffleTracks/ShuffleTracksQueryValidator.cs b/src/Lumina.Application/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Queries/ShuffleTracks/ShuffleTracksQueryValidator.cs
new file mode 100644
index 00000000..8aa816a9
--- /dev/null
+++ b/src/Lumina.Application/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Queries/ShuffleTracks/ShuffleTracksQueryValidator.cs
@@ -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;
+
+///
+/// Validates the needed validation rules for .
+///
+public class ShuffleTracksQueryValidator : AbstractValidator
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ 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);
+ }
+}
diff --git a/src/Lumina.Contracts/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTracksRequest.cs b/src/Lumina.Contracts/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTracksRequest.cs
new file mode 100644
index 00000000..7812883d
--- /dev/null
+++ b/src/Lumina.Contracts/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTracksRequest.cs
@@ -0,0 +1,22 @@
+#region ========================================================================= USING =====================================================================================
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+#endregion
+
+namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
+
+///
+/// Represents a request to draw a random selection of tracks from a media library, an artist or an album.
+///
+/// The maximum number of tracks to return. Required.
+/// The unique identifier of the artist whose tracks are sampled. Optional.
+/// The unique identifier of the album whose tracks are sampled. Optional.
+/// The tracks that must not be returned, usually the ones already in the queue. Optional.
+[DebuggerDisplay("Count: {Count}")]
+public record ShuffleTracksRequest(
+ int Count,
+ Guid? ArtistId,
+ Guid? AlbumId,
+ List? ExcludedTrackIds
+);
diff --git a/src/Lumina.Contracts/Responses/MediaLibrary/AudioLibrary/MusicLibrary/Albums/AlbumResponse.cs b/src/Lumina.Contracts/Responses/MediaLibrary/AudioLibrary/MusicLibrary/Albums/AlbumResponse.cs
index cd72e94a..4cc1f354 100644
--- a/src/Lumina.Contracts/Responses/MediaLibrary/AudioLibrary/MusicLibrary/Albums/AlbumResponse.cs
+++ b/src/Lumina.Contracts/Responses/MediaLibrary/AudioLibrary/MusicLibrary/Albums/AlbumResponse.cs
@@ -17,6 +17,7 @@ namespace Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Albu
///
/// The Id of the album.
/// The Id of the artist the album belongs to.
+/// The name of the artist the album belongs to.
/// The Id of the media library this album belongs to.
/// The album metadata of the album.
/// The physical or digital medium of the album, if applicable.
@@ -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,
diff --git a/src/Lumina.Contracts/Responses/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTrackResponse.cs b/src/Lumina.Contracts/Responses/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTrackResponse.cs
new file mode 100644
index 00000000..d8a930ce
--- /dev/null
+++ b/src/Lumina.Contracts/Responses/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/ShuffleTrackResponse.cs
@@ -0,0 +1,27 @@
+#region ========================================================================= USING =====================================================================================
+using System;
+using System.Diagnostics;
+#endregion
+
+namespace Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
+
+///
+/// Represents a response for a track returned by a randomized shuffle query, carrying everything the client needs to queue and play it.
+///
+/// The Id of the track.
+/// The title of the track.
+/// The duration of the track in seconds.
+/// The Id of the album the track belongs to.
+/// The title of the album the track belongs to.
+/// The Id of the artist the album belongs to.
+/// The path of the cover of the album, if available.
+[DebuggerDisplay("Title: {Title}")]
+public record ShuffleTrackResponse(
+ Guid TrackId,
+ string Title,
+ int DurationInSeconds,
+ Guid AlbumId,
+ string AlbumTitle,
+ Guid ArtistId,
+ string? CoverPath
+);
diff --git a/src/Lumina.DataAccess/Core/Repositories/MusicLibrary/TrackRepository.cs b/src/Lumina.DataAccess/Core/Repositories/MusicLibrary/TrackRepository.cs
index 54f35802..4c440d02 100644
--- a/src/Lumina.DataAccess/Core/Repositories/MusicLibrary/TrackRepository.cs
+++ b/src/Lumina.DataAccess/Core/Repositories/MusicLibrary/TrackRepository.cs
@@ -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
};
}
+ ///
+ /// Gets a uniformly random selection of tracks of the library identified by , optionally scoped to
+ /// an artist or an album, excluding the tracks in .
+ ///
+ /// The Id of the library whose tracks are sampled.
+ /// The Id of the artist whose tracks are sampled, or for every artist of the library.
+ /// The Id of the album whose tracks are sampled, or for every album of the scope.
+ /// The tracks that must not be returned.
+ /// The maximum number of tracks to return.
+ /// Cancellation token that can be used to stop the execution.
+ /// An containing either a collection of , or an error.
+ public async Task>> GetShuffleTracksLiteAsync(Guid libraryId, Guid? artistId, Guid? albumId, IReadOnlyCollection excludedTrackIds, int count, CancellationToken cancellationToken)
+ {
+ IQueryable 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);
+ }
+
///
/// Gets the track of the library identified by that is stored at the provided .
///
diff --git a/src/Lumina.Domain/Common/Errors/Errors.Music.cs b/src/Lumina.Domain/Common/Errors/Errors.Music.cs
index a0724fde..f3031651 100644
--- a/src/Lumina.Domain/Common/Errors/Errors.Music.cs
+++ b/src/Lumina.Domain/Common/Errors/Errors.Music.cs
@@ -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));
}
}
diff --git a/src/Lumina.Presentation.Api/Common/Routes/Library/AudioLibrary/MusicLibrary/ApiRoutes.Tracks.cs b/src/Lumina.Presentation.Api/Common/Routes/Library/AudioLibrary/MusicLibrary/ApiRoutes.Tracks.cs
index 963c3c17..a61fb46c 100644
--- a/src/Lumina.Presentation.Api/Common/Routes/Library/AudioLibrary/MusicLibrary/ApiRoutes.Tracks.cs
+++ b/src/Lumina.Presentation.Api/Common/Routes/Library/AudioLibrary/MusicLibrary/ApiRoutes.Tracks.cs
@@ -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";
diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/AddAlbum/AddAlbumEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/AddAlbum/AddAlbumEndpointSummary.cs
index 1aeb6945..b7e28e68 100644
--- a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/AddAlbum/AddAlbumEndpointSummary.cs
+++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/AddAlbum/AddAlbumEndpointSummary.cs
@@ -340,6 +340,7 @@ public class AddAlbumEndpointSummary : Summary(r => r.Id, "The Id of the album.");
ResponseParam(r => r.ArtistId, "The Id of the artist the album belongs to.");
+ ResponseParam(r => r.ArtistName, "The name of the artist the album belongs to.");
ResponseParam(r => r.LibraryId, "The Id of the media library the album belongs to.");
ResponseParam(r => r.Metadata!.Title, "The title of the album.");
ResponseParam(r => r.Metadata!.OriginalTitle, "The original title of the album, if applicable.");
@@ -380,6 +381,7 @@ public class AddAlbumEndpointSummary : Summary
ResponseParam(r => r.Id, "The Id of the album.");
ResponseParam(r => r.ArtistId, "The Id of the artist the album belongs to.");
+ ResponseParam(r => r.ArtistName, "The name of the artist the album belongs to.");
ResponseParam(r => r.LibraryId, "The Id of the media library the album belongs to.");
ResponseParam(r => r.Metadata!.Title, "The title of the album.");
ResponseParam(r => r.Metadata!.OriginalTitle, "The original title of the album, if applicable.");
@@ -72,6 +73,7 @@ public class GetAlbumEndpointSummary : Summary
example: new AlbumResponse(
Id: Guid.NewGuid(),
ArtistId: Guid.NewGuid(),
+ ArtistName: "Queen",
LibraryId: Guid.NewGuid(),
Metadata: new MusicAlbumMetadataDto(
Title: "A Night at the Opera",
diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbum/UpdateAlbumEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbum/UpdateAlbumEndpointSummary.cs
index 7a73847a..9bec963c 100644
--- a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbum/UpdateAlbumEndpointSummary.cs
+++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbum/UpdateAlbumEndpointSummary.cs
@@ -144,6 +144,7 @@ public class UpdateAlbumEndpointSummary : Summary(r => r.Id, "The Id of the album.");
ResponseParam(r => r.ArtistId, "The Id of the artist the album belongs to.");
+ ResponseParam(r => r.ArtistName, "The name of the artist the album belongs to.");
ResponseParam(r => r.LibraryId, "The Id of the media library the album belongs to.");
ResponseParam(r => r.Metadata!.Title, "The title of the album.");
ResponseParam(r => r.Metadata!.OriginalTitle, "The original title of the album, if applicable.");
@@ -184,6 +185,7 @@ public class UpdateAlbumEndpointSummary : Summary
new(
Id: Guid.NewGuid(),
ArtistId: Guid.NewGuid(),
+ ArtistName: "Queen",
LibraryId: Guid.NewGuid(),
Metadata: new(
Title: "A Night at the Opera",
diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetArtistAlbums/GetArtistAlbumsEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetArtistAlbums/GetArtistAlbumsEndpointSummary.cs
index 0bf63d72..56419539 100644
--- a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetArtistAlbums/GetArtistAlbumsEndpointSummary.cs
+++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetArtistAlbums/GetArtistAlbumsEndpointSummary.cs
@@ -32,6 +32,7 @@ public class GetArtistAlbumsEndpointSummary : Summary(r => r.Id, "The Id of the album.");
ResponseParam(r => r.ArtistId, "The Id of the artist the album belongs to.");
+ ResponseParam(r => r.ArtistName, "The name of the artist the album belongs to.");
ResponseParam(r => r.LibraryId, "The Id of the media library the album belongs to.");
ResponseParam(r => r.Metadata!.Title, "The title of the album.");
ResponseParam(r => r.Metadata!.OriginalTitle, "The original title of the album, if applicable.");
@@ -74,6 +75,7 @@ public class GetArtistAlbumsEndpointSummary : Summary
+/// API endpoint for the /libraries/{libraryId}/tracks/shuffle route.
+///
+public class ShuffleTracksEndpoint : BaseEndpoint
+{
+ private readonly IQueryHandler>> _shuffleTracksQueryHandler;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Injected service for handling shuffle tracks queries.
+ public ShuffleTracksEndpoint(IQueryHandler>> shuffleTracksQueryHandler)
+ {
+ _shuffleTracksQueryHandler = shuffleTracksQueryHandler;
+ }
+
+ ///
+ /// Configures the API endpoint.
+ ///
+ public override void Configure()
+ {
+ Verbs(Http.POST);
+ Routes(ApiRoutes.Tracks.SHUFFLE_TRACKS);
+ Version(1);
+ DontCatchExceptions();
+ }
+
+ ///
+ /// Draws a random selection of tracks of the library identified by the route.
+ ///
+ /// The request containing the selection size, the optional scope and the tracks to exclude.
+ /// Cancellation token that can be used to stop the execution.
+ public override async Task ExecuteAsync(ShuffleTracksRequest request, CancellationToken cancellationToken)
+ {
+ // Take the unique identifier from the route.
+ string? libraryId = HttpContext.Request.RouteValues["libraryId"]?.ToString();
+ Result> result = await _shuffleTracksQueryHandler.HandleAsync(request.ToQuery(libraryId), cancellationToken).ConfigureAwait(false);
+ return result.Match(success => TypedResults.Ok(success), Problem);
+ }
+}
diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/ShuffleTracks/ShuffleTracksEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/ShuffleTracks/ShuffleTracksEndpointSummary.cs
new file mode 100644
index 00000000..cfba7759
--- /dev/null
+++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/ShuffleTracks/ShuffleTracksEndpointSummary.cs
@@ -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;
+
+///
+/// Class used for providing a textual description for the API endpoint, for OpenAPI.
+///
+[ExcludeFromCodeCoverage]
+public class ShuffleTracksEndpointSummary : Summary
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ 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(r => r.TrackId, "The Id of the track.");
+ ResponseParam(r => r.Title, "The title of the track.");
+ ResponseParam(r => r.DurationInSeconds, "The duration of the track in seconds.");
+ ResponseParam(r => r.AlbumId, "The Id of the album the track belongs to.");
+ ResponseParam(r => r.AlbumTitle, "The title of the album the track belongs to.");
+ ResponseParam(r => r.ArtistId, "The Id of the artist the album belongs to.");
+ ResponseParam(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
+ {
+ 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
+ {
+ {
+ "General.Validation", new[]
+ {
+ "LibraryIdCannotBeEmpty",
+ "ShuffleTrackCountMustBeGreaterThanZero",
+ "ShuffleTrackCountMustBeAtMost500"
+ }
+ }
+ },
+ traceId = "00-2470be4248a2a5a0c6f70579975a6954-b9c3ba9544a03500-00"
+ }
+ );
+ }
+}
diff --git a/src/Lumina.Presentation.Api/Core/Themes/Bundled/editorial-paper.zip b/src/Lumina.Presentation.Api/Core/Themes/Bundled/editorial-paper.zip
index 0888cd02..eb65b3e3 100644
Binary files a/src/Lumina.Presentation.Api/Core/Themes/Bundled/editorial-paper.zip and b/src/Lumina.Presentation.Api/Core/Themes/Bundled/editorial-paper.zip differ
diff --git a/src/Lumina.Presentation.Api/Core/Themes/Bundled/lumina-default.zip b/src/Lumina.Presentation.Api/Core/Themes/Bundled/lumina-default.zip
index a83a55bb..7570f747 100644
Binary files a/src/Lumina.Presentation.Api/Core/Themes/Bundled/lumina-default.zip and b/src/Lumina.Presentation.Api/Core/Themes/Bundled/lumina-default.zip differ
diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumDto.cs
index 00e59bb0..19b856ae 100644
--- a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumDto.cs
+++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumDto.cs
@@ -26,6 +26,11 @@ public class MusicAlbumDto
///
public Guid ArtistId { get; set; }
+ ///
+ /// Gets or sets the name of the artist the album belongs to.
+ ///
+ public string ArtistName { get; set; } = string.Empty;
+
///
/// Gets or sets the Id of the media library this album belongs to.
///
diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicShuffleTrackDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicShuffleTrackDto.cs
new file mode 100644
index 00000000..022de5cc
--- /dev/null
+++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicShuffleTrackDto.cs
@@ -0,0 +1,48 @@
+#region ========================================================================= USING =====================================================================================
+using System;
+using System.Diagnostics;
+#endregion
+
+namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary;
+
+///
+/// Data transfer object for a track returned by a randomized shuffle query.
+///
+[DebuggerDisplay("Title: {Title}")]
+public class MusicShuffleTrackDto
+{
+ ///
+ /// Gets or sets the Id of the track.
+ ///
+ public Guid TrackId { get; set; }
+
+ ///
+ /// Gets or sets the title of the track.
+ ///
+ public string Title { get; set; } = string.Empty;
+
+ ///
+ /// Gets or sets the duration of the track in seconds.
+ ///
+ public int DurationInSeconds { get; set; }
+
+ ///
+ /// Gets or sets the Id of the album the track belongs to.
+ ///
+ public Guid AlbumId { get; set; }
+
+ ///
+ /// Gets or sets the title of the album the track belongs to.
+ ///
+ public string AlbumTitle { get; set; } = string.Empty;
+
+ ///
+ /// Gets or sets the Id of the artist the album belongs to.
+ ///
+ public Guid ArtistId { get; set; }
+
+ ///
+ /// Gets or sets the path of the cover of the album, if available.
+ ///
+ public string? CoverPath { get; set; }
+}
diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/ShuffleTracksRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/ShuffleTracksRequest.cs
new file mode 100644
index 00000000..08df127f
--- /dev/null
+++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/ShuffleTracksRequest.cs
@@ -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;
+
+///
+/// Represents a request to draw a random selection of tracks from a media library, an artist or an album.
+///
+/// The unique identifier of the media library the tracks are sampled from. Required.
+/// The maximum number of tracks to return. Required.
+/// The unique identifier of the artist whose tracks are sampled. Optional.
+/// The unique identifier of the album whose tracks are sampled. Optional.
+/// The tracks that must not be returned, usually the ones already in the queue. Optional.
+[DebuggerDisplay("LibraryId: {LibraryId} Count: {Count}")]
+public record ShuffleTracksRequest(
+ Guid LibraryId,
+ int Count,
+ Guid? ArtistId,
+ Guid? AlbumId,
+ List? ExcludedTrackIds
+);
diff --git a/src/Lumina.Presentation.Web/Common/Routes/ApiRoutes.Music.cs b/src/Lumina.Presentation.Web/Common/Routes/ApiRoutes.Music.cs
index 01222527..59622a18 100644
--- a/src/Lumina.Presentation.Web/Common/Routes/ApiRoutes.Music.cs
+++ b/src/Lumina.Presentation.Web/Common/Routes/ApiRoutes.Music.cs
@@ -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}";
diff --git a/src/Lumina.Presentation.Web/Common/Routes/WebRoutes.Music.cs b/src/Lumina.Presentation.Web/Common/Routes/WebRoutes.Music.cs
index d320d927..1279314c 100644
--- a/src/Lumina.Presentation.Web/Common/Routes/WebRoutes.Music.cs
+++ b/src/Lumina.Presentation.Web/Common/Routes/WebRoutes.Music.cs
@@ -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";
diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpoint.cs
index 0a491be2..d07f4259 100644
--- a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpoint.cs
+++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpoint.cs
@@ -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(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(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(
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 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);
}
diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/ShuffleTracks/ShuffleTracksEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/ShuffleTracks/ShuffleTracksEndpoint.cs
new file mode 100644
index 00000000..82301af5
--- /dev/null
+++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/ShuffleTracks/ShuffleTracksEndpoint.cs
@@ -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;
+
+///
+/// API endpoint for the /{culture}/library/audio-library/music-library/tracks/api-shuffle-tracks route.
+///
+public class ShuffleTracksEndpoint : BaseEndpoint
+{
+ private readonly IApiHttpClient _apiHttpClient;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Injected service for interactions with the API.
+ public ShuffleTracksEndpoint(IApiHttpClient apiHttpClient)
+ {
+ _apiHttpClient = apiHttpClient;
+ }
+
+ ///
+ /// Configures the endpoint.
+ ///
+ public override void Configure()
+ {
+ base.Configure();
+ Verbs(Http.POST);
+ Routes(WebRoutes.Music.SHUFFLE_TRACKS);
+ DontAutoTag();
+ Options(options => options.WithTags("Music"));
+ }
+
+ ///
+ /// Retrieves a random selection of tracks of the library identified in the request.
+ ///
+ /// The request containing the selection size, the optional scope and the tracks to exclude.
+ /// Cancellation token that can be used to stop the execution.
+ public override async Task ExecuteAsync(ShuffleTracksRequest request, CancellationToken cancellationToken)
+ {
+ List response = await _apiHttpClient.PostAsync, ShuffleTracksRequest>(
+ BuildEndpoint(request.LibraryId), request, cancellationToken).ConfigureAwait(false);
+ return JsonSuccess(response);
+ }
+
+ ///
+ /// Builds the API endpoint used to retrieve a random selection of tracks.
+ ///
+ /// The Id of the media library the tracks are sampled from.
+ /// The API endpoint to which the retrieval request is sent.
+ 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());
+ }
+}
diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/ShuffleTracks/ShuffleTracksEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/ShuffleTracks/ShuffleTracksEndpointSummary.cs
new file mode 100644
index 00000000..8887c215
--- /dev/null
+++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/ShuffleTracks/ShuffleTracksEndpointSummary.cs
@@ -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;
+
+///
+/// Class used for providing a textual description for the endpoint, for OpenAPI.
+///
+[ExcludeFromCodeCoverage]
+public class ShuffleTracksEndpointSummary : Summary
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ 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"
+ }});
+ }
+}
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.ar-SA.resx
index d2251bd8..9507368f 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.ar-SA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.ar-SA.resx
@@ -843,4 +843,10 @@
لا يمكن أن تكون جودة البث فارغة!
+
+ يجب أن يكون عدد المقطوعات العشوائية أكبر من صفر!
+
+
+ يجب ألا يتجاوز عدد المقطوعات العشوائية 500!
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.de-DE.resx
index 36820a5d..75c5e379 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.de-DE.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.de-DE.resx
@@ -843,4 +843,10 @@
Die Streaming-Qualität darf nicht null sein!
+
+ Die Anzahl der Shuffle-Titel muss größer als null sein!
+
+
+ Die Anzahl der Shuffle-Titel darf höchstens 500 betragen!
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.en-US.resx
index 93aaeaaa..a44449dd 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.en-US.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.en-US.resx
@@ -843,4 +843,10 @@
The streaming quality cannot be null!
+
+ The shuffle track count must be greater than zero!
+
+
+ The shuffle track count must be at most 500!
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.es-ES.resx
index d7c88159..c75cb36a 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.es-ES.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.es-ES.resx
@@ -843,4 +843,10 @@
¡La calidad de transmisión no puede ser nula!
+
+ ¡La cantidad de pistas de reproducción aleatoria debe ser mayor que cero!
+
+
+ ¡La cantidad de pistas de reproducción aleatoria no debe superar 500!
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.fr-FR.resx
index 4cb0b921..3667444c 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.fr-FR.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.fr-FR.resx
@@ -843,4 +843,10 @@
La qualité de diffusion ne peut pas être nulle !
+
+ Le nombre de pistes du shuffle doit être supérieur à zéro !
+
+
+ Le nombre de pistes du shuffle ne doit pas dépasser 500 !
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.it-IT.resx
index 065a0846..304bb6e9 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.it-IT.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.it-IT.resx
@@ -843,4 +843,10 @@
La qualità dello streaming non può essere nulla!
+
+ Il numero di brani dello shuffle deve essere maggiore di zero!
+
+
+ Il numero di brani dello shuffle non può superare 500!
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.ja-JP.resx
index 44d8928f..cf3b999d 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.ja-JP.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.ja-JP.resx
@@ -843,4 +843,10 @@
ストリーミング品質は null にできません。
+
+ シャッフルするトラック数は 0 より大きい必要があります。
+
+
+ シャッフルするトラック数は 500 以下である必要があります。
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.resx b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.resx
index 922d0096..f993b119 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.resx
@@ -843,4 +843,10 @@
The streaming quality cannot be null!
+
+ The shuffle track count must be greater than zero!
+
+
+ The shuffle track count must be at most 500!
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.ro-RO.resx
index 4eb8295a..e097d831 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.ro-RO.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.ro-RO.resx
@@ -843,4 +843,10 @@
Calitatea fluxului nu poate fi nulă!
+
+ Numărul de piste pentru redare aleatorie trebuie să fie mai mare decât zero!
+
+
+ Numărul de piste pentru redare aleatorie nu poate depăși 500!
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.uk-UA.resx
index 4743fff4..0a2027c5 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.uk-UA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.uk-UA.resx
@@ -843,4 +843,10 @@
Якість потокового передавання не може бути порожньою!
+
+ Кількість треків для перемішування має бути більшою за нуль!
+
+
+ Кількість треків для перемішування не може перевищувати 500!
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.zh-CN.resx
index 9045e36d..ba17cabc 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.zh-CN.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Common/Middlewares/ExceptionHandlingMiddleware.zh-CN.resx
@@ -843,4 +843,10 @@
流媒体质量不能为空!
+
+ 随机播放曲目数必须大于零!
+
+
+ 随机播放曲目数不能超过 500!
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.ar-SA.resx
index 5eeb7c13..a133070f 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.ar-SA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.ar-SA.resx
@@ -120,4 +120,13 @@
لا توجد مكتبات
+
+ تشغيل عشوائي
+
+
+ تشغيل
+
+
+ الإجراءات
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.de-DE.resx
index 45dca514..825274d7 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.de-DE.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.de-DE.resx
@@ -120,4 +120,13 @@
Keine Bibliotheken
+
+ Zufällige Wiedergabe
+
+
+ Abspielen
+
+
+ Aktionen
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.en-US.resx
index d3883307..415dbe8a 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.en-US.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.en-US.resx
@@ -120,4 +120,13 @@
No libraries
+
+ Shuffle
+
+
+ Play
+
+
+ Actions
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.es-ES.resx
index 5eb2e603..a870c71c 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.es-ES.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.es-ES.resx
@@ -120,4 +120,13 @@
Sin bibliotecas
+
+ Aleatorio
+
+
+ Reproducir
+
+
+ Acciones
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.fr-FR.resx
index 4fb27e5a..9a0c1dd5 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.fr-FR.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.fr-FR.resx
@@ -120,4 +120,13 @@
Aucune bibliothèque
+
+ Lecture aléatoire
+
+
+ Lecture
+
+
+ Actions
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.it-IT.resx
index a018f86d..14f23a6c 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.it-IT.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.it-IT.resx
@@ -120,4 +120,13 @@
Nessuna libreria
+
+ Riproduzione casuale
+
+
+ Riproduci
+
+
+ Azioni
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.ja-JP.resx
index b826da97..cc46497a 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.ja-JP.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.ja-JP.resx
@@ -120,4 +120,13 @@
ライブラリがありません
+
+ シャッフル
+
+
+ 再生
+
+
+ æ“作
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.resx
index 5bc23ade..323d25af 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.resx
@@ -120,4 +120,13 @@
No libraries
+
+ Shuffle
+
+
+ Play
+
+
+ Actions
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.ro-RO.resx
index c44563bc..ab599e63 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.ro-RO.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.ro-RO.resx
@@ -120,4 +120,13 @@
Nicio bibliotecă
+
+ Aleatoriu
+
+
+ Redare
+
+
+ Acțiuni
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.uk-UA.resx
index 0af25ca8..e97e6a6e 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.uk-UA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.uk-UA.resx
@@ -120,4 +120,13 @@
Немає бібліотек
+
+ Перемішати
+
+
+ Відтворити
+
+
+ Дії
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.zh-CN.resx
index 9552d9c3..31dde401 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.zh-CN.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Home/Index.zh-CN.resx
@@ -120,4 +120,13 @@
无库
+
+ 随机播放
+
+
+ 播放
+
+
+ æ“作
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ar-SA.resx
index b7449ba6..48af1259 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ar-SA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ar-SA.resx
@@ -1506,4 +1506,10 @@
المعرّفات
+
+ تشغيل الألبوم
+
+
+ تشغيل المقطع
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.de-DE.resx
index 15e1f3f3..deec8e3a 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.de-DE.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.de-DE.resx
@@ -1506,4 +1506,10 @@
Kennungen
+
+ Album abspielen
+
+
+ Titel abspielen
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.en-US.resx
index 880ed67d..fb3a061d 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.en-US.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.en-US.resx
@@ -1506,4 +1506,10 @@
Identifiers
+
+ Play album
+
+
+ Play track
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.es-ES.resx
index 1259fd1d..a2a79c84 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.es-ES.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.es-ES.resx
@@ -1506,4 +1506,10 @@
Identificadores
+
+ Reproducir el álbum
+
+
+ Reproducir la pista
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.fr-FR.resx
index 0b38058a..4b061200 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.fr-FR.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.fr-FR.resx
@@ -1506,4 +1506,10 @@
Identifiants
+
+ Lire l'album
+
+
+ Lire la piste
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.it-IT.resx
index 80112399..d0880c8b 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.it-IT.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.it-IT.resx
@@ -1506,4 +1506,10 @@
Identificatori
+
+ Riproduci l'album
+
+
+ Riproduci il brano
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ja-JP.resx
index 8dff23f1..09d32b4a 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ja-JP.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ja-JP.resx
@@ -1506,4 +1506,10 @@
識別子
+
+ アルバムを再生
+
+
+ トラックを再生
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.resx
index 880ed67d..fb3a061d 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.resx
@@ -1506,4 +1506,10 @@
Identifiers
+
+ Play album
+
+
+ Play track
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ro-RO.resx
index 68b6915d..d5b4450e 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ro-RO.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ro-RO.resx
@@ -1506,4 +1506,10 @@
Identificatori
+
+ Redă albumul
+
+
+ Redă piesa
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.uk-UA.resx
index 45d369f7..d6047140 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.uk-UA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.uk-UA.resx
@@ -1506,4 +1506,10 @@
Ідентифікатори
+
+ Відтворити альбом
+
+
+ Відтворити трек
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.zh-CN.resx
index f215465e..22ed5241 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.zh-CN.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.zh-CN.resx
@@ -1506,4 +1506,10 @@
标识符
+
+ 播放专辑
+
+
+ 播放曲目
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ar-SA.resx
index d99952cb..52e403e4 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ar-SA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ar-SA.resx
@@ -57,4 +57,13 @@
تعذر حذف العنصر.
+
+ تشغيل عشوائي
+
+
+ تشغيل
+
+
+ الإجراءات
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.de-DE.resx
index f0b0fab2..a9e22ebf 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.de-DE.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.de-DE.resx
@@ -57,4 +57,13 @@
Das Element konnte nicht gelöscht werden.
+
+ Zufällige Wiedergabe
+
+
+ Abspielen
+
+
+ Aktionen
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.en-US.resx
index 1120e9db..5bb671ad 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.en-US.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.en-US.resx
@@ -57,4 +57,13 @@
The item could not be deleted.
+
+ Shuffle
+
+
+ Play
+
+
+ Actions
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.es-ES.resx
index 58ceea6a..09d9f795 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.es-ES.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.es-ES.resx
@@ -57,4 +57,13 @@
No se ha podido eliminar el elemento.
+
+ Aleatorio
+
+
+ Reproducir
+
+
+ Acciones
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.fr-FR.resx
index 7d497880..86a4cea3 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.fr-FR.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.fr-FR.resx
@@ -57,4 +57,13 @@
L'élément n'a pas pu être supprimé.
+
+ Lecture aléatoire
+
+
+ Lecture
+
+
+ Actions
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.it-IT.resx
index cfbcec6f..a3769c02 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.it-IT.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.it-IT.resx
@@ -57,4 +57,13 @@
Non è stato possibile eliminare l'elemento.
+
+ Riproduzione casuale
+
+
+ Riproduci
+
+
+ Azioni
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ja-JP.resx
index 16875e52..0fa05bb3 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ja-JP.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ja-JP.resx
@@ -57,4 +57,13 @@
項目を削除できませんでした。
+
+ シャッフル
+
+
+ 再生
+
+
+ æ“作
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.resx
index 1120e9db..5bb671ad 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.resx
@@ -57,4 +57,13 @@
The item could not be deleted.
+
+ Shuffle
+
+
+ Play
+
+
+ Actions
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ro-RO.resx
index 8ec59558..eb374db2 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ro-RO.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ro-RO.resx
@@ -57,4 +57,13 @@
Elementul nu a putut fi șters.
+
+ Aleatoriu
+
+
+ Redare
+
+
+ Acțiuni
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.uk-UA.resx
index be1c4469..cca619da 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.uk-UA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.uk-UA.resx
@@ -57,4 +57,13 @@
Не вдалося видалити елемент.
+
+ Перемішати
+
+
+ Відтворити
+
+
+ Дії
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.zh-CN.resx
index 35ed518d..7358fdc9 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.zh-CN.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.zh-CN.resx
@@ -57,4 +57,13 @@
无法删除该项目。
+
+ 随机播放
+
+
+ 播放
+
+
+ æ“作
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ar-SA.resx
index 14698b57..1823197b 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ar-SA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ar-SA.resx
@@ -1083,4 +1083,13 @@
إضافة ISNI
+
+ تشغيل الكل
+
+
+ تشغيل
+
+
+ تشغيل عشوائي
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.de-DE.resx
index 58bf363f..29afa2e5 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.de-DE.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.de-DE.resx
@@ -1083,4 +1083,13 @@
ISNI hinzufügen
+
+ Alle abspielen
+
+
+ Abspielen
+
+
+ Zufällige Wiedergabe
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.en-US.resx
index bbf79a82..0162f675 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.en-US.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.en-US.resx
@@ -1083,4 +1083,13 @@
Add ISNI
+
+ Play all
+
+
+ Play
+
+
+ Shuffle
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.es-ES.resx
index e9476462..0841e7e3 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.es-ES.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.es-ES.resx
@@ -1083,4 +1083,13 @@
Añadir ISNI
+
+ Reproducir todo
+
+
+ Reproducir
+
+
+ Aleatorio
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.fr-FR.resx
index 08fe26ea..d397e238 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.fr-FR.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.fr-FR.resx
@@ -1083,4 +1083,13 @@
Ajouter un ISNI
+
+ Tout lire
+
+
+ Lire
+
+
+ Lecture aléatoire
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.it-IT.resx
index e2bf7d51..02f7ebb3 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.it-IT.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.it-IT.resx
@@ -1083,4 +1083,13 @@
Aggiungi ISNI
+
+ Riproduci tutto
+
+
+ Riproduci
+
+
+ Riproduzione casuale
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ja-JP.resx
index 490821f4..4078e895 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ja-JP.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ja-JP.resx
@@ -1083,4 +1083,13 @@
ISNI を追加
+
+ すべて再生
+
+
+ 再生
+
+
+ シャッフル
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.resx
index bbf79a82..0162f675 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.resx
@@ -1083,4 +1083,13 @@
Add ISNI
+
+ Play all
+
+
+ Play
+
+
+ Shuffle
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ro-RO.resx
index 6f23f468..66dd4b7f 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ro-RO.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ro-RO.resx
@@ -1083,4 +1083,13 @@
Adaugă ISNI
+
+ Redă tot
+
+
+ Redă
+
+
+ Aleatoriu
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.uk-UA.resx
index 5bbfe32d..c7e9c341 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.uk-UA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.uk-UA.resx
@@ -1083,4 +1083,13 @@
Додати ISNI
+
+ Відтворити все
+
+
+ Відтворити
+
+
+ Перемішати
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.zh-CN.resx
index e1f06152..5994d041 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.zh-CN.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.zh-CN.resx
@@ -1083,4 +1083,13 @@
添加 ISNI
+
+ 全部播放
+
+
+ 播放
+
+
+ 随机播放
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ar-SA.resx
index 2bf6599a..3a2af1dd 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ar-SA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ar-SA.resx
@@ -1179,4 +1179,7 @@
إضافة ISWC
+
+ تشغيل المقطع
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.de-DE.resx
index 43c6973b..225c4a88 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.de-DE.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.de-DE.resx
@@ -1179,4 +1179,7 @@
ISWC hinzufügen
+
+ Titel abspielen
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.en-US.resx
index 252da4a1..5ee84d3a 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.en-US.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.en-US.resx
@@ -1179,4 +1179,7 @@
Add ISWC
+
+ Play track
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.es-ES.resx
index a431f4cd..c05e7939 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.es-ES.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.es-ES.resx
@@ -1179,4 +1179,7 @@
Añadir ISWC
+
+ Reproducir la pista
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.fr-FR.resx
index 8734fe07..33308539 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.fr-FR.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.fr-FR.resx
@@ -1179,4 +1179,7 @@
Ajouter un ISWC
+
+ Lire la piste
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.it-IT.resx
index b3163394..4caf389b 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.it-IT.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.it-IT.resx
@@ -1179,4 +1179,7 @@
Aggiungi ISWC
+
+ Riproduci il brano
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ja-JP.resx
index 9a91da4d..21ab31ce 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ja-JP.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ja-JP.resx
@@ -1179,4 +1179,7 @@
ISWC を追加
+
+ トラックを再生
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.resx
index 252da4a1..5ee84d3a 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.resx
@@ -1179,4 +1179,7 @@
Add ISWC
+
+ Play track
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ro-RO.resx
index 58f0296d..8f46cfe9 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ro-RO.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ro-RO.resx
@@ -1179,4 +1179,7 @@
Adaugă ISWC
+
+ Redă piesa
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.uk-UA.resx
index e18711ea..a63764fb 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.uk-UA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.uk-UA.resx
@@ -1179,4 +1179,7 @@
Додати ISWC
+
+ Відтворити трек
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.zh-CN.resx
index ba893c16..a1bfcbb1 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.zh-CN.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.zh-CN.resx
@@ -1179,4 +1179,7 @@
添加 ISWC
+
+ 播放曲目
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.ar-SA.resx
index d8756a71..a722b98c 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.ar-SA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.ar-SA.resx
@@ -168,8 +168,8 @@
إعادة المحاولة
-
- تبديل الارتفاع الكامل
+
+ توسيع المشغل أو طيهتبديل الرؤية
@@ -216,4 +216,10 @@
تشغيل عشوائي متوقف
+
+ إيقاف
+
+
+ أعمال فنية للألبوم
+
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.de-DE.resx
index 2f81b8b7..5fddf232 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.de-DE.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.de-DE.resx
@@ -168,8 +168,8 @@
Wiederholen
-
- Vollhöhe Umschalten
+
+ Player ein- oder ausklappenSichtbarkeit Umschalten
@@ -216,4 +216,10 @@
Zufallswiedergabe aus
+
+ Stopp
+
+
+ Albumcover
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.en-US.resx
index ce26252c..dc6bfb30 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.en-US.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.en-US.resx
@@ -168,8 +168,8 @@
Retry
-
- Toggle Full Height
+
+ Expand or collapse playerToggle Visibility
@@ -216,4 +216,10 @@
Shuffle off
+
+ Stop
+
+
+ Album artwork
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.es-ES.resx
index b4ca5eb8..5a566876 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.es-ES.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.es-ES.resx
@@ -168,8 +168,8 @@
Reintentar
-
- Alternar Altura Completa
+
+ Expandir o contraer el reproductorAlternar Visibilidad
@@ -216,4 +216,10 @@
Reproducción aleatoria desactivada
+
+ Detener
+
+
+ Ilustraciones del álbum
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.fr-FR.resx
index 6c76035b..b8949e55 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.fr-FR.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.fr-FR.resx
@@ -168,8 +168,8 @@
Réessayer
-
- Basculer Hauteur Complète
+
+ Développer ou réduire le lecteurBasculer Visibilité
@@ -216,4 +216,10 @@
Lecture aléatoire désactivée
+
+ Arrêter
+
+
+ Illustrations de l'album
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.it-IT.resx
index b743bc30..d2df229a 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.it-IT.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.it-IT.resx
@@ -168,8 +168,8 @@
Riprova
-
- Attiva/Disattiva Altezza Piena
+
+ Espandi o comprimi il lettoreAttiva/Disattiva Visibilità
@@ -216,4 +216,10 @@
Riproduzione casuale disattivata
+
+ Ferma
+
+
+ Illustrazioni dell'album
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.ja-JP.resx
index 301beb9a..df5802a7 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.ja-JP.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.ja-JP.resx
@@ -168,8 +168,8 @@
再試行
-
- 全高表示切替
+
+ プレーヤーを展開または折りたたむ表示切替
@@ -216,4 +216,10 @@
シャッフルなし
+
+ 停止
+
+
+ アルバムアートワーク
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.resx
index ce26252c..dc6bfb30 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.resx
@@ -168,8 +168,8 @@
Retry
-
- Toggle Full Height
+
+ Expand or collapse playerToggle Visibility
@@ -216,4 +216,10 @@
Shuffle off
+
+ Stop
+
+
+ Album artwork
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.ro-RO.resx
index 6fe040f3..eed34890 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.ro-RO.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.ro-RO.resx
@@ -168,8 +168,8 @@
Reîncercare
-
- Comutare Înălțime Completă
+
+ Extinde sau restrânge playerulComutare Vizibilitate
@@ -216,4 +216,10 @@
Redare aleatorie oprită
+
+ Oprește
+
+
+ Ilustrații album
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.uk-UA.resx
index 747b667d..67f13815 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.uk-UA.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.uk-UA.resx
@@ -168,8 +168,8 @@
Повторити
-
- Перемкнути Повну Висоту
+
+ Розгорнути або згорнути плеєрПеремкнути Видимість
@@ -216,4 +216,10 @@
Перемішування вимкнено
+
+ Зупинити
+
+
+ Обкладинки альбому
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.zh-CN.resx
index 63ae135a..caddd33e 100644
--- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.zh-CN.resx
+++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.zh-CN.resx
@@ -168,8 +168,8 @@
重试
-
- 切换全高
+
+ 展开或折叠播放器切换可见性
@@ -216,4 +216,10 @@
关闭随机播放
+
+ 停止
+
+
+ 专辑插图
+
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Core/Themes/ThemeAudioPlayerBuilder.cs b/src/Lumina.Presentation.Web/Core/Themes/ThemeAudioPlayerBuilder.cs
index 5abe0da3..0bc98252 100644
--- a/src/Lumina.Presentation.Web/Core/Themes/ThemeAudioPlayerBuilder.cs
+++ b/src/Lumina.Presentation.Web/Core/Themes/ThemeAudioPlayerBuilder.cs
@@ -41,20 +41,16 @@ public sealed class ThemeAudioPlayerBuilder
{
Dictionary strings = new()
{
- ["toggleFullHeight"] = Localize("ToggleFullHeight"),
- ["toggleVisibility"] = Localize("ToggleVisibility"),
+ ["toggleExpanded"] = Localize("ToggleExpanded"),
["previous"] = Localize("AudioPlayerPrevious"),
["next"] = Localize("AudioPlayerNext"),
- ["shuffle"] = Localize("AudioPlayerShuffle"),
- ["shuffleOff"] = Localize("AudioPlayerShuffleOff"),
- ["shuffleRelease"] = Localize("AudioPlayerShuffleRelease"),
- ["shuffleArtist"] = Localize("AudioPlayerShuffleArtist"),
- ["shuffleLibrary"] = Localize("AudioPlayerShuffleLibrary"),
+ ["stop"] = Localize("AudioPlayerStop"),
["repeat"] = Localize("AudioPlayerRepeat"),
["repeatOff"] = Localize("AudioPlayerRepeatOff"),
["repeatAll"] = Localize("AudioPlayerRepeatAll"),
["repeatOne"] = Localize("AudioPlayerRepeatOne"),
- ["queue"] = Localize("AudioPlayerQueue")
+ ["queue"] = Localize("AudioPlayerQueue"),
+ ["albumArtwork"] = Localize("AudioPlayerAlbumArtwork")
};
return new ThemeAudioPlayerDto(
diff --git a/src/Lumina.Presentation.Web/Core/Views/Home/Index.cshtml b/src/Lumina.Presentation.Web/Core/Views/Home/Index.cshtml
index 25a7aee3..c219bd18 100644
--- a/src/Lumina.Presentation.Web/Core/Views/Home/Index.cshtml
+++ b/src/Lumina.Presentation.Web/Core/Views/Home/Index.cshtml
@@ -59,6 +59,123 @@
const librariesContainer = document.getElementById('libraries-container');
const noLibrariesMessage = document.getElementById('no-libraries');
+ const jsLocalizedStrings = {
+ actions: @Json.Serialize(_localizer["Actions"].Value),
+ play: @Json.Serialize(_localizer["Play"].Value),
+ shuffle: @Json.Serialize(_localizer["Shuffle"].Value)
+ };
+
+ // Closes the actions menus of all the music library cards.
+ function closeCardMenus() {
+ librariesContainer.querySelectorAll('.media-card.open').forEach(card => {
+ card.classList.remove('open');
+ const menu = card.querySelector('.card-actions-menu');
+ if (menu)
+ menu.classList.remove('open');
+ });
+ }
+
+ // Toggles the actions menu of a music library card, opening it with its top left corner at the given viewport position.
+ function toggleCardMenu(card, anchor) {
+ const wasOpen = card.classList.contains('open');
+ closeCardMenus();
+ if (wasOpen)
+ return;
+ card.classList.add('open');
+ const menu = card.querySelector('.card-actions-menu');
+ if (menu) {
+ menu.classList.add('open');
+ positionActionsMenu(menu, anchor);
+ }
+ }
+
+ // Resolves the viewport point where the card actions menu opens.
+ function resolveMenuAnchor(event) {
+ if (event.clientX !== 0 || event.clientY !== 0)
+ return { x: event.clientX, y: event.clientY };
+ const triggerRect = event.currentTarget.getBoundingClientRect();
+ return { x: triggerRect.left, y: triggerRect.bottom };
+ }
+
+ // Places the card actions menu with its top left corner at the requested viewport point.
+ function positionActionsMenu(menu, anchor) {
+ const margin = 4;
+ const maxLeft = Math.max(margin, window.innerWidth - menu.offsetWidth - margin);
+ const maxTop = Math.max(margin, window.innerHeight - menu.offsetHeight - margin);
+ menu.style.position = 'fixed';
+ menu.style.left = `${Math.min(Math.max(margin, anchor.x), maxLeft)}px`;
+ menu.style.top = `${Math.min(Math.max(margin, anchor.y), maxTop)}px`;
+ }
+
+ // Closes the actions menus when clicking or pressing a key outside them.
+ function handleCardMenuDismiss(event) {
+ if (event.type === 'keydown' && event.key !== 'Escape')
+ return;
+ if (event.type === 'click' && event.target.closest('.card-actions-menu, .card-actions-trigger'))
+ return;
+ closeCardMenus();
+ }
+
+ // Adds the actions menu of a music library card, with the play and shuffle actions that start the whole library.
+ function createMusicLibraryMenu(card, library) {
+ const libraryCoverPath = library.coverImage
+ ? `/media/libraries/${library.id}/${library.coverImage.substring(library.coverImage.lastIndexOf('cover.'))}`
+ : '';
+ const trigger = document.createElement('button');
+ trigger.type = 'button';
+ trigger.className = 'card-actions-trigger';
+ trigger.setAttribute('aria-haspopup', 'menu');
+ trigger.setAttribute('aria-label', jsLocalizedStrings.actions);
+ trigger.addEventListener('click', event => {
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ toggleCardMenu(card, resolveMenuAnchor(event));
+ });
+
+ const menu = document.createElement('nav');
+ menu.className = 'card-actions-menu';
+ menu.setAttribute('role', 'menu');
+
+ const playAction = document.createElement('a');
+ playAction.setAttribute('role', 'menuitem');
+ playAction.href = '#';
+ playAction.className = 'card-action-play';
+ playAction.textContent = jsLocalizedStrings.play;
+ playAction.setAttribute('data-audio-player-play-library', '');
+ playAction.dataset.libraryId = library.id;
+ playAction.dataset.title = library.title || '';
+ if (libraryCoverPath)
+ playAction.dataset.coverArtPath = libraryCoverPath;
+ menu.appendChild(playAction);
+
+ const shuffleAction = document.createElement('a');
+ shuffleAction.setAttribute('role', 'menuitem');
+ shuffleAction.href = '#';
+ shuffleAction.className = 'card-action-shuffle';
+ shuffleAction.textContent = jsLocalizedStrings.shuffle;
+ shuffleAction.setAttribute('data-audio-player-play-library-shuffled', '');
+ shuffleAction.dataset.libraryId = library.id;
+ menu.appendChild(shuffleAction);
+
+ menu.addEventListener('click', event => {
+ // The global audio player delegation handles the play and shuffle actions; the menu only closes here.
+ if (event.target.closest('.card-action-play, .card-action-shuffle'))
+ closeCardMenus();
+ });
+
+ card.appendChild(trigger);
+ card.appendChild(menu);
+ card.addEventListener('contextmenu', event => {
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ toggleCardMenu(card, resolveMenuAnchor(event));
+ });
+ card.addEventListener('click', event => {
+ if (card.classList.contains('open') && !event.target.closest('.card-actions-menu'))
+ closeCardMenus();
+ });
+ }
+
async function InitializeAsync() {
if (isInitialized)
return;
@@ -95,7 +212,15 @@
${library.title}
`;
- librariesContainer.appendChild(libraryElement);
+ // A music library gets a card actions menu with the play and shuffle actions for the whole library.
+ if (library.libraryType === 'Music') {
+ const card = document.createElement('div');
+ card.className = 'media-card';
+ card.appendChild(libraryElement);
+ createMusicLibraryMenu(card, library);
+ librariesContainer.appendChild(card);
+ } else
+ librariesContainer.appendChild(libraryElement);
});
// Bind the AJAX navigation behavior to the library links, which were created after the initial navigation binding.
bindNavigationLinks();
@@ -107,10 +232,14 @@
}
// Add listeners.
+ document.addEventListener('click', handleCardMenuDismiss);
+ document.addEventListener('keydown', handleCardMenuDismiss);
document.addEventListener('DOMContentLoaded', InitializeAsync);
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
+ document.removeEventListener('click', handleCardMenuDismiss);
+ document.removeEventListener('keydown', handleCardMenuDismiss);
document.removeEventListener('DOMContentLoaded', InitializeAsync);
});
diff --git a/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.cshtml b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.cshtml
index 731f9935..afa06ed2 100644
--- a/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.cshtml
+++ b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.cshtml
@@ -8,6 +8,10 @@
The tracks of the album are NOT edited inline: they are listed as cards that navigate to their own pages,
and the update request never changes the tracks.
+ The album header and every track row the script renders expose a play trigger for the global audio player. The player
+ handles those triggers by event delegation, so this view binds no playback listener; the trigger attribute contract
+ lives in docs/technical/theming/Theming.md.
+
To change the behavior of the page, edit this script (and the theme template, when present). To restyle
the page, edit the theme files. This fallback keeps every feature working without styling, so that a
broken theme is obvious to the user while the page still functions.
@@ -73,6 +77,13 @@
})
.ToList();
var artworkItemsJson = System.Text.Json.JsonSerializer.Serialize(artworkItems);
+ // The cover the play affordances hand to the player, resolved exactly like the cover this page displays: the stored cover, or the first stored artwork when the album has no cover.
+ var playCoverPath = Model.CoverPath;
+ if (string.IsNullOrWhiteSpace(playCoverPath))
+ playCoverPath = (Model.Artwork ?? []).FirstOrDefault(artwork => !string.IsNullOrWhiteSpace(artwork.Path))?.Path ?? string.Empty;
+ // The play album trigger starts disabled when the album is already known to hold no tracks, so an empty release cannot be
+ // clicked before the track list request resolves. A failed request never changes this state.
+ var hasTracks = (Model.Tracks?.Count ?? 0) > 0;
}
@inject IViewLocalizer _localizer
@@ -88,6 +99,16 @@
+
+
@_localizer["EditAlbum"]
@@ -112,6 +133,7 @@
+
@@ -589,6 +611,7 @@
const artistId = '@artistId';
const albumId = '@albumId';
+ const albumTitle = @Json.Serialize(metadata?.Title ?? string.Empty);
const libraryId = '@libraryId';
const saveUrl = '@_urlService.GetAbsoluteUrl(WebRoutes.Music.SAVE_ALBUM, new { artistId = default(Guid), albumId = default(Guid) })'.replace('/@(default(Guid))', `/${artistId}`).replace('/@(default(Guid))', `/${albumId}`);
const deleteUrl = '@_urlService.GetAbsoluteUrl(WebRoutes.Music.DELETE_ALBUM, new { artistId = default(Guid), albumId = default(Guid) })'.replace('/@(default(Guid))', `/${artistId}`).replace('/@(default(Guid))', `/${albumId}`);
@@ -601,6 +624,7 @@
const btnBackToArtist = document.getElementById('btn-back-to-artist');
const btnSaveAlbum = document.getElementById('btn-save-album');
const btnDeleteAlbum = document.getElementById('btn-delete-album');
+ const btnPlayAlbum = document.getElementById('btn-play-album');
const btnAddCatalogNumber = document.getElementById('btn-add-catalog-number');
const btnAddReleaseType = document.getElementById('btn-add-release-type');
const btnAddGenre = document.getElementById('btn-add-genre');
@@ -633,9 +657,34 @@
noCover: @Json.Serialize(_localizer["NoCover"].Value),
coverSaved: @Json.Serialize(_localizer["CoverSaved"].Value),
coverUploadFailed: @Json.Serialize(_localizer["CoverUploadFailed"].Value),
+ playTrack: @Json.Serialize(_localizer["PlayTrack"].Value),
remove: @Json.Serialize(_localizer["Remove"].Value)
};
+ // Normalizes a cover path with the same rule the server uses: a missing or whitespace only path means no artwork.
+ function normalizeCoverPath(coverPath) {
+ return typeof coverPath === 'string' ? coverPath.trim() : '';
+ }
+
+ // The cover path the play affordances hand to the player, kept in step with the artwork the page currently displays.
+ let currentCoverPath = normalizeCoverPath(@Json.Serialize(playCoverPath ?? string.Empty));
+
+ // Writes the cover of a play descriptor onto a trigger, dropping the attribute when the context has no artwork.
+ function applyDescriptorCover(trigger, coverPath) {
+ const normalizedCoverPath = normalizeCoverPath(coverPath);
+ if (normalizedCoverPath)
+ trigger.dataset.coverArtPath = normalizedCoverPath;
+ else
+ delete trigger.dataset.coverArtPath;
+ }
+
+ // Hands every play trigger the cover the page currently displays, so a play started after choosing or uploading an artwork shows that artwork in the player bar.
+ function applyPlayAffordanceCover(coverPath) {
+ currentCoverPath = normalizeCoverPath(coverPath);
+ applyDescriptorCover(btnPlayAlbum, currentCoverPath);
+ tracksBody.querySelectorAll('[data-audio-player-play]').forEach(trigger => applyDescriptorCover(trigger, currentCoverPath));
+ }
+
// Reads the trimmed value of the element with the provided id.
function readValue(id) {
const element = document.getElementById(id);
@@ -898,20 +947,51 @@
return `${minutes}:${paddedSeconds}`;
}
- // Renders a row of the tracks table per track, or shows the empty message when the album has no tracks.
+ // Renders a row of the tracks table per track, or shows the empty message when the album has no tracks. A failed
+ // request returns undefined, which is not an empty album: it leaves the existing rows and the play album state intact.
function renderTracks(response) {
+ if (!response || !Array.isArray(response.data))
+ return;
tracksBody.innerHTML = '';
- const tracks = response && response.data ? response.data : [];
+ const tracks = response.data;
noTracksMessage.classList.toggle('hidden', tracks.length !== 0);
+ // Only a successful empty list disables the play album trigger. The player can still build the queue itself when
+ // the track list could not be loaded.
+ btnPlayAlbum.disabled = tracks.length === 0;
tracks.forEach(track => tracksBody.appendChild(createTrackRow(track)));
bindNavigationLinks();
}
- // Creates a row of the tracks table, with the name of the track linking to its own page.
+ // Creates the play trigger of a track row. It describes a track context, so the player plays exactly this track.
+ function createTrackPlayButton(track) {
+ const button = document.createElement('button');
+ button.type = 'button';
+ button.className = 'confirm-button';
+ button.setAttribute('data-audio-player-play', '');
+ button.dataset.libraryId = libraryId;
+ button.dataset.trackId = track.id;
+ button.dataset.albumId = albumId;
+ button.dataset.artistId = artistId;
+ button.dataset.title = track.title || '';
+ button.dataset.albumTitle = albumTitle;
+ button.dataset.duration = String(track.durationInSeconds || '');
+ applyDescriptorCover(button, currentCoverPath);
+ // The button carries no visible text, so its accessible name names both the action and the track it plays.
+ const label = `${jsLocalizedStrings.playTrack}: ${track.title || ''}`;
+ button.setAttribute('aria-label', label);
+ button.title = label;
+ button.textContent = '\u25B6';
+ return button;
+ }
+
+ // Creates a row of the tracks table, with the play trigger, the number, the name of the track linking to its own page and the duration.
function createTrackRow(track) {
const row = document.createElement('tr');
row.className = 'track-row';
+ const playCell = document.createElement('td');
+ playCell.appendChild(createTrackPlayButton(track));
+
const numberCell = document.createElement('td');
numberCell.textContent = track.trackNumber;
@@ -925,6 +1005,7 @@
const durationCell = document.createElement('td');
durationCell.textContent = formatDuration(track.durationInSeconds);
+ row.appendChild(playCell);
row.appendChild(numberCell);
row.appendChild(nameCell);
row.appendChild(durationCell);
@@ -1007,6 +1088,8 @@
coverImage.dataset.coverPath = storedPath;
coverPathLabel.textContent = storedPath ? storedPath : jsLocalizedStrings.noCover;
coverPathLabel.title = storedPath;
+ // The player shows the cover the page displays, so the uploaded cover is handed to the play triggers too.
+ applyPlayAffordanceCover(storedPath);
};
reader.readAsDataURL(file);
notificationService.show(jsLocalizedStrings.coverSaved, NotificationType.SUCCESS);
@@ -1042,12 +1125,14 @@
artworkCarousel.querySelectorAll('.artwork-carousel-item').forEach(item => {
item.classList.toggle('selected', item.dataset.artworkPath === artworkPath);
});
+ // The play affordances hand the player the cover the page currently displays, so a play started after choosing an artwork shows that artwork in the player bar.
+ applyPlayAffordanceCover(artworkPath);
}
// Shows the cover image of the album, or the first stored artwork when there is no cover, or a placeholder when the album has neither.
function showCover() {
- const coverPath = coverImage.dataset.coverPath || '';
- const artworkPath = coverPath || (artworkItems.length > 0 ? artworkItems[0].path : '');
+ const coverPath = normalizeCoverPath(coverImage.dataset.coverPath);
+ const artworkPath = coverPath || (artworkItems.length > 0 ? normalizeCoverPath(artworkItems[0].path) : '');
if (artworkPath) {
selectArtwork(artworkPath);
} else {
diff --git a/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.cshtml b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.cshtml
index 968984d8..1b46d90e 100644
--- a/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.cshtml
+++ b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.cshtml
@@ -110,6 +110,9 @@
sortAscending: '@_localizer["SortAscending"]',
sortDescending: '@_localizer["SortDescending"]',
viewDetails: '@_localizer["ViewDetails"]',
+ actions: '@_localizer["Actions"]',
+ play: '@_localizer["Play"]',
+ shuffle: '@_localizer["Shuffle"]',
deleteItem: '@_localizer["Delete"]',
deleteConfirm: '@_localizer["DeleteConfirm"]',
deleteFailed: '@_localizer["DeleteFailed"]'
@@ -208,7 +211,7 @@
trigger.type = 'button';
trigger.className = 'card-actions-trigger';
trigger.setAttribute('aria-haspopup', 'menu');
- trigger.setAttribute('aria-label', jsLocalizedStrings.viewDetails);
+ trigger.setAttribute('aria-label', jsLocalizedStrings.actions);
trigger.addEventListener('click', event => {
event.preventDefault();
event.stopImmediatePropagation();
@@ -218,11 +221,54 @@
const menu = document.createElement('nav');
menu.className = 'card-actions-menu';
menu.setAttribute('role', 'menu');
- menu.innerHTML = `
- ${jsLocalizedStrings.viewDetails}
- ${jsLocalizedStrings.deleteItem}`;
+
+ const detailsAction = document.createElement('a');
+ detailsAction.setAttribute('role', 'menuitem');
+ detailsAction.href = artistUrl;
+ detailsAction.textContent = jsLocalizedStrings.viewDetails;
+
+ const playAction = document.createElement('a');
+ playAction.setAttribute('role', 'menuitem');
+ playAction.href = '#';
+ playAction.className = 'card-action-play';
+ playAction.textContent = jsLocalizedStrings.play;
+ playAction.setAttribute('data-audio-player-play', '');
+ playAction.dataset.libraryId = libraryId;
+ playAction.dataset.artistId = artist.id;
+ playAction.dataset.title = artist.name || '';
+ if (artist.coverPath)
+ playAction.dataset.coverArtPath = artist.coverPath;
+
+ const shuffleAction = document.createElement('a');
+ shuffleAction.setAttribute('role', 'menuitem');
+ shuffleAction.href = '#';
+ shuffleAction.className = 'card-action-shuffle';
+ shuffleAction.textContent = jsLocalizedStrings.shuffle;
+ shuffleAction.setAttribute('data-audio-player-play-shuffled', '');
+ shuffleAction.setAttribute('data-audio-player-shuffle-scope', 'artist');
+ shuffleAction.dataset.libraryId = libraryId;
+ shuffleAction.dataset.artistId = artist.id;
+ shuffleAction.dataset.title = artist.name || '';
+ if (artist.coverPath)
+ shuffleAction.dataset.coverArtPath = artist.coverPath;
+
+ const deleteAction = document.createElement('a');
+ deleteAction.setAttribute('role', 'menuitem');
+ deleteAction.href = '#';
+ deleteAction.className = 'card-action-delete';
+ deleteAction.textContent = jsLocalizedStrings.deleteItem;
+
+ menu.appendChild(detailsAction);
+ menu.appendChild(playAction);
+ menu.appendChild(shuffleAction);
+ menu.appendChild(deleteAction);
menu.addEventListener('click', async event => {
+ // The global audio player delegation handles the play and shuffle actions; the menu only closes here.
+ if (event.target.closest('.card-action-play, .card-action-shuffle')) {
+ closeCardMenus();
+ return;
+ }
const deleteItem = event.target.closest('.card-action-delete');
const menuItem = event.target.closest('a[role="menuitem"]');
if (!menuItem)
diff --git a/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.cshtml b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.cshtml
index 10142b94..79c976ad 100644
--- a/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.cshtml
+++ b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.cshtml
@@ -9,6 +9,9 @@
The albums of the artist are NOT edited inline: they are listed as cards that navigate to their own pages,
and the update request only round-trips the albums unchanged, so that updating the artist never drops them.
+ The artist header exposes a play all trigger for the global audio player. The player handles the trigger by event
+ delegation, so this view binds no playback listener; the trigger attribute contract lives in docs/technical/theming/Theming.md.
+
To change the behavior of the page, edit this script (and the theme template, when present). To restyle
the page, edit the theme files. This fallback keeps every feature working without styling, so that a
broken theme is obvious to the user while the page still functions.
@@ -36,6 +39,9 @@
var aliases = metadata?.Aliases ?? [];
var contributors = Model.Contributors ?? [];
var ratings = Model.Ratings ?? [];
+ // The play all trigger starts disabled when the artist is already known to hold no releases, so an empty discography
+ // cannot be clicked before the release list request resolves. A failed request never changes this state.
+ var hasReleases = (Model.Albums?.Count ?? 0) > 0;
var genres = metadata?.Genres ?? [];
var tags = metadata?.Tags ?? [];
var area = metadata?.Area;
@@ -110,6 +116,15 @@
+
+
@_localizer["EditArtist"]
@@ -624,6 +639,7 @@
const btnBackToArtists = document.getElementById('btn-back-to-artists');
const btnSaveArtist = document.getElementById('btn-save-artist');
const btnDeleteArtist = document.getElementById('btn-delete-artist');
+ const btnPlayArtist = document.getElementById('btn-play-artist');
const btnAddAlias = document.getElementById('btn-add-alias');
const btnAddIpi = document.getElementById('btn-add-ipi');
const btnAddIsni = document.getElementById('btn-add-isni');
@@ -656,6 +672,8 @@
noCover: @Json.Serialize(_localizer["NoCover"].Value),
coverSaved: @Json.Serialize(_localizer["CoverSaved"].Value),
coverUploadFailed: @Json.Serialize(_localizer["CoverUploadFailed"].Value),
+ play: @Json.Serialize(_localizer["Play"].Value),
+ shuffle: @Json.Serialize(_localizer["Shuffle"].Value),
remove: @Json.Serialize(_localizer["Remove"].Value)
};
@@ -932,6 +950,28 @@
return deleteAlbumUrlTemplate.replace('/@(default(Guid))', `/${artistId}`).replace('/@(default(Guid))', `/${albumId}`) + `?libraryId=${libraryId}`;
}
+ // Writes the play descriptor of an album onto an album card menu action.
+ function applyAlbumPlayDescriptor(trigger, album) {
+ trigger.dataset.libraryId = libraryId;
+ trigger.dataset.artistId = artistId;
+ trigger.dataset.albumId = album.id;
+ trigger.dataset.title = album.title || '';
+ if (album.coverPath)
+ trigger.dataset.coverArtPath = album.coverPath;
+ else
+ delete trigger.dataset.coverArtPath;
+ }
+
+ // Creates an action of the album card actions menu.
+ function createAlbumMenuAction(label, className) {
+ const action = document.createElement('a');
+ action.setAttribute('role', 'menuitem');
+ action.href = '#';
+ action.className = className;
+ action.textContent = label;
+ return action;
+ }
+
// The localized labels of the release types, keyed by their canonical enum name.
const releaseTypeLabels = {
'Album': '@_localizer["Album"].Value',
@@ -962,11 +1002,16 @@
renderReleases(response);
}
- // Renders the releases of the artist, grouped by their primary release type, each group ordered by release year.
+ // Renders the releases of the artist, grouped by their primary release type, each group ordered by release year. A
+ // failed request returns undefined, which is not an empty discography: it leaves the existing list and play state intact.
function renderReleases(response) {
+ if (!response || !Array.isArray(response.data))
+ return;
albumsContainer.querySelectorAll('.release-group').forEach(group => group.remove());
- const releases = response && response.data ? response.data : [];
+ const releases = response.data;
noAlbumsMessage.classList.toggle('hidden', releases.length !== 0);
+ // Only a successful empty list disables the play all trigger. The player can still build the queue itself when the release list could not be loaded.
+ btnPlayArtist.disabled = releases.length === 0;
// The releases are grouped by their first release type, falling back to "Other" when the type is not known.
const groups = new Map();
@@ -1072,8 +1117,28 @@
const menu = document.createElement('nav');
menu.className = 'card-actions-menu';
menu.setAttribute('role', 'menu');
- menu.innerHTML = `${jsLocalizedStrings.remove}`;
+
+ const playAction = createAlbumMenuAction(jsLocalizedStrings.play, 'card-action-play');
+ playAction.setAttribute('data-audio-player-play', '');
+ applyAlbumPlayDescriptor(playAction, album);
+
+ const shuffleAction = createAlbumMenuAction(jsLocalizedStrings.shuffle, 'card-action-shuffle');
+ shuffleAction.setAttribute('data-audio-player-play-shuffled', '');
+ shuffleAction.setAttribute('data-audio-player-shuffle-scope', 'release');
+ applyAlbumPlayDescriptor(shuffleAction, album);
+
+ const deleteAction = createAlbumMenuAction(jsLocalizedStrings.remove, 'card-action-delete');
+
+ menu.appendChild(playAction);
+ menu.appendChild(shuffleAction);
+ menu.appendChild(deleteAction);
+
menu.addEventListener('click', async event => {
+ // Play and shuffle are handled by the global audio player delegation, so the menu only closes here.
+ if (event.target.closest('.card-action-play, .card-action-shuffle')) {
+ closeCardMenus();
+ return;
+ }
const deleteItem = event.target.closest('.card-action-delete');
if (!deleteItem)
return;
@@ -1237,6 +1302,11 @@
coverImage.dataset.coverPath = storedPath;
coverPathLabel.textContent = storedPath ? storedPath : jsLocalizedStrings.noCover;
coverPathLabel.title = storedPath;
+ // The player shows the cover the page displays, so the uploaded cover is handed to the play trigger too.
+ if (storedPath)
+ btnPlayArtist.dataset.coverArtPath = storedPath;
+ else
+ delete btnPlayArtist.dataset.coverArtPath;
};
reader.readAsDataURL(file);
notificationService.show(jsLocalizedStrings.coverSaved, NotificationType.SUCCESS);
diff --git a/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.cshtml b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.cshtml
index 976870a1..5ef63c9f 100644
--- a/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.cshtml
+++ b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.cshtml
@@ -10,6 +10,9 @@
The audio properties, the release information, the language and original language, the work, the
contributors, the ratings, the moods and the ISRCs are all editable, and they are all round-tripped on save.
+ The track header exposes a play trigger for the global audio player. The player handles the trigger by event
+ delegation, so this view binds no playback listener; the trigger attribute contract lives in docs/technical/theming/Theming.md.
+
To change the behavior of the page, edit this script (and the theme template, when present). To restyle
the page, edit the theme files. This fallback keeps every feature working without styling, so that a
broken theme is obvious to the user while the page still functions.
@@ -35,8 +38,10 @@
var libraryId = Model.LibraryId.ToString();
// The cover shown on the left is the cover of the album the track belongs to, passed in by the endpoint.
var albumCoverPath = ViewData["AlbumCoverPath"]?.ToString() ?? string.Empty;
- // The track DTO does not carry the Id of its artist, so it is taken from the route that rendered the view.
- var artistId = Context.Request.RouteValues["artistId"]?.ToString() ?? string.Empty;
+ var albumTitle = ViewData["AlbumTitle"]?.ToString() ?? string.Empty;
+ // The track DTO does not carry the Id of its artist, so the endpoint passes the normalized route value it used to load
+ // the track and its album. Both render paths therefore hand the player the same artist Id.
+ var artistId = ViewData["ArtistId"]?.ToString() ?? string.Empty;
var metadata = Model.Metadata;
var work = Model.Work;
var releaseInfo = metadata?.ReleaseInfo;
@@ -82,6 +87,19 @@
+
+
@_localizer["EditTrack"]
diff --git a/src/Lumina.Presentation.Web/Core/Views/Shared/_AudioPlayer.cshtml b/src/Lumina.Presentation.Web/Core/Views/Shared/_AudioPlayer.cshtml
index f2e864f0..193a433a 100644
--- a/src/Lumina.Presentation.Web/Core/Views/Shared/_AudioPlayer.cshtml
+++ b/src/Lumina.Presentation.Web/Core/Views/Shared/_AudioPlayer.cshtml
@@ -1,4 +1,4 @@
-@using Microsoft.Extensions.Localization
+@using Microsoft.Extensions.Localization
@inject IStringLocalizerFactory _stringLocalizerFactory
@@ -20,27 +20,25 @@
The DOM contract a theme must preserve is:
- The container element with the 'audio-player-container' class, carrying 'not-shown' while the bar is hidden,
- and 'full-height' while it is expanded. The audio player toggles both classes. While the bar is hidden the
- player also sets the 'inert' attribute on it, and removes it when the bar is shown, so a collapsed bar keeps
- none of its focusable controls in the tab order.
- - The main content element, carrying 'audio-player-not-shown' while the bar is hidden, and 'audio-player-full-height'
- while it is expanded. The audio player toggles both classes on it as well.
- - The elements with the ids 'audio-player-full-height-toggle' and 'audio-player-close', which the global site script
- binds and routes to the audio player.
- - The hook attributes the audio player binds: 'data-audio-player-play-pause', '-previous', '-next', '-shuffle',
- '-shuffle-control', '-shuffle-menu', '-repeat', '-progress', '-progress-played', '-progress-downloaded',
- '-progress-undownloaded', '-current-time', '-total-time', '-track-name', '-cover-thumbnail', '-cover-image',
- '-volume', '-volume-level', '-mute' and '-queue'. The volume fill element ('-volume-level') is a styling hook the
- stylesheet drives from the custom properties below, not one the script writes to.
- - The shuffle scope items carry 'data-audio-player-shuffle-scope' ('off', 'release', 'artist' or 'library'), inside
- the menu element carrying 'data-audio-player-shuffle-menu'. The shuffle control carries 'data-audio-player-shuffle'
- and is wrapped by 'data-audio-player-shuffle-control', so the player can open the menu near it and close it on an
- outside click. It is a menu button: it carries 'aria-haspopup' and 'aria-expanded', gets the 'is-active' class while
- shuffle is on, and does not carry 'aria-pressed'. The scope items get 'aria-checked' and the 'is-selected' class, and
- the 'off' item is selected while shuffle is off. The repeat toggle carries 'data-audio-player-repeat' and the player
- writes 'data-audio-player-repeat-mode' ('off', 'all' or 'one') and toggles the 'is-active' and 'is-one' classes on it.
+ and 'expanded' while it is expanded. The audio player toggles both classes. While the bar is hidden the player
+ also sets the 'inert' attribute on it, and removes it when the bar is shown, so a collapsed bar keeps none of
+ its focusable controls in the tab order. The position and orientation of the container are entirely theme-owned:
+ this fallback stylesheet uses a flex column with the bar at the bottom, but a theme may place the bar vertically
+ on a side and expand its queue horizontally.
+ - The main content element, carrying 'audio-player-not-shown' while the bar is hidden, and
+ 'audio-player-bar-expanded' while it is expanded. The audio player toggles these classes on it as well.
+ - The element with the id 'audio-player-expand-toggle', which the global site script binds and routes to the audio player.
+ - The hook attributes the audio player binds: 'data-audio-player-play-pause', '-stop', '-previous', '-next', '-repeat',
+ '-progress', '-progress-played', '-progress-downloaded', '-progress-undownloaded', '-current-time', '-total-time',
+ '-track-name', '-album-name', '-now-playing-title', '-now-playing-release-type', '-now-playing-release',
+ '-now-playing-year', '-now-playing-artist', '-artwork-carousel', '-cover-thumbnail', '-cover-image', '-volume', '-volume-level', '-mute' and '-queue'.
+ The volume fill element ('-volume-level') is a styling hook the stylesheet drives from the custom properties below,
+ not one the script writes to. The repeat toggle carries 'data-audio-player-repeat' and the player writes
+ 'data-audio-player-repeat-mode' ('off', 'all' or 'one') and toggles the 'is-active' and 'is-one' classes on it.
A queue item root rendered by the player always carries 'data-audio-player-queue-entry-id', whether it comes from the
- theme sub template or from the built-in markup, so clicking it starts that entry.
+ theme sub template or from the built-in markup, so clicking it starts that entry. The queue element stays 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.
- The three state progress bar: the played part carries 'audio-player-progress-played', the downloaded but not
played part carries 'audio-player-progress-downloaded', and the not yet downloaded part carries
'audio-player-progress-undownloaded'. Each layer also carries 'data-audio-player-progress-layer' ('played',
@@ -57,22 +55,40 @@
'audio-player-template-queue-item' and 'audio-player-template-playlist-item'. This application fallback partial
renders neither element; it intentionally uses the built-in queue item markup.
- The play affordances the pages hand to the player use the 'data-audio-player-play' trigger attribute, and a play next
- affordance uses 'data-audio-player-play-next'. A track trigger must carry libraryId, trackId, albumId and artistId,
- because the playback manifest route needs all four Ids. The 'The Audio Player Bar' section of
+ The play affordances the pages hand to the player use the 'data-audio-player-play' trigger attribute, a shuffled play
+ affordance uses 'data-audio-player-play-shuffled' together with 'data-audio-player-shuffle-scope' ('release', 'artist' or
+ 'library'), a whole library play affordance uses 'data-audio-player-play-library' with 'data-library-id', a whole library
+ shuffle affordance uses 'data-audio-player-play-library-shuffled' with 'data-library-id', and a play next affordance uses
+ 'data-audio-player-play-next'. A track trigger must carry libraryId, trackId, albumId and artistId, because the playback
+ manifest route needs all four Ids. The 'Play Affordances on the Music Pages' section of
docs/technical/theming/Theming.md documents this contract for theme authors.
*@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
0:00
@@ -82,24 +98,15 @@
--:--
-
-
-
-
-
-
-
-
-
+
@@ -119,8 +126,9 @@
-
-
+
diff --git a/src/Lumina.Presentation.Web/Core/Views/Shared/_ThemeLayoutScripts.cshtml b/src/Lumina.Presentation.Web/Core/Views/Shared/_ThemeLayoutScripts.cshtml
index 46aa91f2..af26abf3 100644
--- a/src/Lumina.Presentation.Web/Core/Views/Shared/_ThemeLayoutScripts.cshtml
+++ b/src/Lumina.Presentation.Web/Core/Views/Shared/_ThemeLayoutScripts.cshtml
@@ -50,6 +50,12 @@
getArtistsUrl: '@_urlService.GetRelativeUrl(WebRoutes.Music.GET_ARTISTS)',
getArtistAlbumsUrl: '@_urlService.GetRelativeUrl(WebRoutes.Music.GET_ARTIST_ALBUMS)',
getAlbumTracksUrl: '@_urlService.GetRelativeUrl(WebRoutes.Music.GET_ALBUM_TRACKS)',
+ // The full album details, used by the expanded player for the release labels and the artwork carousel of the
+ // current track's album. The route carries the artist and album Ids, and the library Id is a query parameter.
+ getAlbumUrl: '@_urlService.GetRelativeUrl(WebRoutes.Music.GET_ALBUM)',
+ // The endpoint that draws a uniformly random batch of tracks of a library, artist or album. The server samples the
+ // database, so a shuffle of a large library never has to enumerate its albums and tracks in the browser.
+ shuffleTracksUrl: '@_urlService.GetRelativeUrl(WebRoutes.Music.SHUFFLE_TRACKS)',
strings: {
play: '@localizer["AudioPlayerPlay"]',
pause: '@localizer["AudioPlayerPause"]',
@@ -60,16 +66,12 @@
buffering: '@localizer["AudioPlayerBuffering"]',
previous: '@localizer["AudioPlayerPrevious"]',
next: '@localizer["AudioPlayerNext"]',
- shuffle: '@localizer["AudioPlayerShuffle"]',
- shuffleOff: '@localizer["AudioPlayerShuffleOff"]',
- shuffleRelease: '@localizer["AudioPlayerShuffleRelease"]',
- shuffleArtist: '@localizer["AudioPlayerShuffleArtist"]',
- shuffleLibrary: '@localizer["AudioPlayerShuffleLibrary"]',
repeat: '@localizer["AudioPlayerRepeat"]',
repeatOff: '@localizer["AudioPlayerRepeatOff"]',
repeatAll: '@localizer["AudioPlayerRepeatAll"]',
repeatOne: '@localizer["AudioPlayerRepeatOne"]',
- queue: '@localizer["AudioPlayerQueue"]'
+ queue: '@localizer["AudioPlayerQueue"]',
+ albumArtwork: '@localizer["AudioPlayerAlbumArtwork"]'
}
};
diff --git a/src/Lumina.Presentation.Web/wwwroot/css/site.css b/src/Lumina.Presentation.Web/wwwroot/css/site.css
index 2d8ff013..2b7352bd 100644
--- a/src/Lumina.Presentation.Web/wwwroot/css/site.css
+++ b/src/Lumina.Presentation.Web/wwwroot/css/site.css
@@ -1251,9 +1251,9 @@ body {
border-color: #FFFFFF;
}
-/* Audio player bar. This is the application fallback styling: the themes own the final look, and the
- audio player script owns the state. The 'not-shown' and 'full-height' classes on the container, and
- the matching 'audio-player-not-shown' and 'audio-player-full-height' classes on main, are the contract. */
+/* Audio player bar. This is the application fallback styling: the themes own the final look and layout, and the
+ audio player script owns the state. The container carries 'not-shown' and 'expanded'; main carries the matching
+ 'audio-player-not-shown' and 'audio-player-bar-expanded' classes. A theme is free to replace every rule below. */
.audio-player-container {
position: fixed;
left: 0px;
@@ -1262,11 +1262,15 @@ body {
z-index: 997;
display: flex;
flex-direction: column;
+ /* The bar stays anchored to the bottom of the viewport while the expanded area above it grows and shrinks. */
+ justify-content: flex-end;
height: 50px;
overflow: hidden;
background-color: #1C1C1C;
border-top: 1px solid #444444;
- transition: height 0.4s ease;
+ /* The expand and collapse duration is one value, so a theme can keep the height, fade and padding transitions in step by overriding this property on the container. */
+ --audio-player-expanded-duration: 0.4s;
+ transition: height var(--audio-player-expanded-duration) ease;
}
.audio-player-container.not-shown {
@@ -1274,12 +1278,6 @@ body {
border-top-width: 0px;
}
-/* The shuffle scope menu opens above the bar, so the bar lets it overflow while the menu is open. Every other state keeps
- the overflow hidden that collapses the bar to its height. */
-.audio-player-container.is-menu-open {
- overflow: visible;
-}
-
/* The 'hidden' attribute keeps the bar unrendered until the audio player script takes over, so that a page load
never shows it, not even for a frame while the stylesheets settle. The script removes it once the bar is already
in its hidden state, so the removal is never visible. */
@@ -1306,8 +1304,8 @@ html.audio-player-initializing .audio-player-container {
padding-bottom: 0px;
}
-.audio-player-container.full-height {
- height: calc(100% - 22px); /* full height minus the height of the menu bar */
+.audio-player-container.expanded {
+ height: calc(100% - 22px); /* expanded height, less the height of the menu bar */
}
.audio-player-bar {
@@ -1327,14 +1325,31 @@ html.audio-player-initializing .audio-player-container {
object-fit: cover;
}
-.audio-player-track-name {
+.audio-player-track-labels {
+ display: flex;
flex: 1 1 20%;
+ min-width: 0px;
+ flex-direction: column;
+ overflow: hidden;
+}
+
+.audio-player-track-name,
+.audio-player-album-name {
min-width: 0px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
+.audio-player-album-name {
+ font-size: 11px;
+ color: #9AA7B0;
+}
+
+.audio-player-album-name:empty {
+ display: none;
+}
+
.audio-player-time {
flex: 0 0 auto;
font-size: 12px;
@@ -1418,8 +1433,7 @@ html.audio-player-initializing .audio-player-container {
cursor: grabbing;
}
-/* The queue controls hold the shuffle scope menu, the skip controls and the repeat toggle. They sit next to the play
- control, so the bar reads as one transport row. */
+/* The queue controls hold the skip controls and the repeat toggle. They sit next to the play control, so the bar reads as one transport row. */
.audio-player-queue-controls {
position: relative;
flex: 0 0 auto;
@@ -1476,14 +1490,7 @@ html.audio-player-initializing .audio-player-container {
box-shadow: 3px 0px 0px #E6E6E6;
}
-/* The shuffle and repeat glyphs are text, so a theme can replace them with its own imagery while keeping the hooks. */
-.audio-player-shuffle-control {
- position: relative;
- display: flex;
- align-items: center;
-}
-
-.audio-player-shuffle-icon,
+/* The repeat glyph is text, so a theme can replace it with its own imagery while keeping the hook. */
.audio-player-repeat-icon {
display: block;
font-size: 17px;
@@ -1491,7 +1498,6 @@ html.audio-player-initializing .audio-player-container {
color: #E6E6E6;
}
-.audio-player-shuffle.is-active .audio-player-shuffle-icon,
.audio-player-repeat.is-active .audio-player-repeat-icon {
color: #6DCBFE;
}
@@ -1514,40 +1520,6 @@ html.audio-player-initializing .audio-player-container {
display: block;
}
-/* The shuffle scope menu opens above the control, because the bar is anchored to the bottom of the page. */
-.audio-player-shuffle-menu {
- position: absolute;
- right: 0px;
- bottom: calc(100% + 6px);
- z-index: 998;
- display: flex;
- flex-direction: column;
- min-width: 150px;
- padding: 4px;
- background-color: #1C1C1C;
- border: 1px solid #444444;
-}
-
-.audio-player-shuffle-menu[hidden] {
- display: none;
-}
-
-.audio-player-shuffle-menu button {
- padding: 6px 8px;
- background: none;
- border: none;
- color: inherit;
- font: inherit;
- text-align: left;
- cursor: pointer;
-}
-
-.audio-player-shuffle-menu button:hover,
-.audio-player-shuffle-menu button.is-selected {
- background-color: #2A2A2A;
- color: #6DCBFE;
-}
-
/* The play affordance is a right pointing triangle, and the pause affordance two bars, both drawn with CSS
so that a theme can restyle them without an image. */
.audio-player-play-pause-icon {
@@ -1567,6 +1539,14 @@ html.audio-player-initializing .audio-player-container {
border-left: 3px solid #E6E6E6;
}
+/* The stop affordance is a filled square, drawn with CSS so a theme can restyle it without an image. */
+.audio-player-stop-icon {
+ display: block;
+ width: 10px;
+ height: 10px;
+ background-color: #E6E6E6;
+}
+
.audio-player-volume-control {
flex: 0 0 auto;
display: flex;
@@ -1621,35 +1601,183 @@ html.audio-player-initializing .audio-player-container {
}
.audio-player-controls button {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 32px;
+ height: 32px;
+ padding: 0px;
background: none;
border: none;
- padding: 0px;
color: inherit;
font: inherit;
cursor: pointer;
}
-.audio-player-expanded {
- display: none;
- flex: 1 1 auto;
- min-height: 0px;
- gap: 16px;
- padding: 16px;
- overflow-y: auto;
+/* The expand control is a pair of chevrons: they point up while the bar is collapsed, because activating the
+ control expands the bar, and down while it is expanded, because activating it collapses the bar again. */
+.audio-player-expand-icon {
+ position: relative;
+ display: block;
+ width: 12px;
+ height: 14px;
}
-.audio-player-container.full-height .audio-player-expanded {
+.audio-player-expand-icon::before,
+.audio-player-expand-icon::after {
+ content: "";
+ position: absolute;
+ left: 1px;
+ width: 8px;
+ height: 8px;
+ border-top: 2px solid #E6E6E6;
+ border-left: 2px solid #E6E6E6;
+ transform: rotate(45deg);
+}
+
+.audio-player-expand-icon::before {
+ top: 0px;
+}
+
+.audio-player-expand-icon::after {
+ top: 5px;
+}
+
+.audio-player-container.expanded .audio-player-expand-icon::before,
+.audio-player-container.expanded .audio-player-expand-icon::after {
+ transform: rotate(225deg);
+}
+
+/* Fallback layout only. The expanded area stays in the flex column so the condensed bar remains anchored to the bottom
+ while this area grows and shrinks above it. A theme can replace this with a vertical bar, a horizontal queue, an
+ overlay, or any other layout; the player only toggles the state classes. Its vertical padding is zero while collapsed,
+ because padding cannot shrink with the flex item and would otherwise push the bar out of the viewport during the
+ fallback collapse transition. */
+.audio-player-expanded {
display: flex;
+ flex: 1 1 auto;
flex-direction: row;
+ min-height: 0px;
+ gap: 16px;
+ padding: 0px 16px;
+ overflow-y: auto;
+ opacity: 0;
+ visibility: hidden;
+ pointer-events: none;
+ transition:
+ opacity var(--audio-player-expanded-duration) ease,
+ visibility 0s linear var(--audio-player-expanded-duration),
+ padding-top var(--audio-player-expanded-duration) ease,
+ padding-bottom var(--audio-player-expanded-duration) ease;
+}
+
+.audio-player-container.expanded .audio-player-expanded {
+ padding-top: 16px;
+ padding-bottom: 16px;
+ opacity: 1;
+ visibility: visible;
+ pointer-events: auto;
+ transition-delay: 0s, 0s, 0s, 0s;
+}
+
+/* The expanded player presents the current track's cover, labels and stored album artwork in one column beside the queue. */
+.audio-player-now-playing {
+ flex: 0 0 auto;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ width: 240px;
+ min-width: 0px;
}
.audio-player-cover-image {
+ display: block;
flex: 0 0 auto;
width: 240px;
height: 240px;
object-fit: cover;
}
+.audio-player-now-playing .audio-player-cover-image {
+ width: 100%;
+}
+
+.audio-player-now-playing-labels {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ min-width: 0px;
+}
+
+.audio-player-now-playing-title {
+ min-width: 0px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-size: 14px;
+ font-weight: 700;
+ color: #E6E6E6;
+}
+
+.audio-player-now-playing-release-line {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 4px;
+ min-width: 0px;
+}
+
+.audio-player-now-playing-release,
+.audio-player-now-playing-year,
+.audio-player-now-playing-artist {
+ min-width: 0px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-size: 12px;
+ color: #9AA7B0;
+}
+
+.audio-player-now-playing-release-type {
+ flex: 0 0 auto;
+ align-self: center;
+ padding: 1px 5px;
+ border: 1px solid #555555;
+ border-radius: 3px;
+ background-color: #2A2A2A;
+ color: #E6E6E6;
+ font-size: 10px;
+ line-height: 1.3;
+ letter-spacing: 0.04em;
+ text-transform: uppercase;
+}
+
+.audio-player-now-playing-release-type:empty {
+ display: none;
+}
+
+.audio-player-now-playing-release {
+ flex: 1 1 auto;
+}
+
+.audio-player-now-playing-year {
+ flex: 0 0 auto;
+}
+
+.audio-player-now-playing-release:empty,
+.audio-player-now-playing-year:empty,
+.audio-player-now-playing-artist:empty {
+ display: none;
+}
+
+.audio-player-artwork-carousel {
+ max-width: 100%;
+ margin-top: 2px;
+}
+
+.audio-player-artwork-carousel[hidden] {
+ display: none;
+}
+
.audio-player-queue {
flex: 1 1 auto;
margin: 0px;
@@ -1658,21 +1786,35 @@ html.audio-player-initializing .audio-player-container {
list-style: none;
}
+/* A queue item carries its album cover, so a queue built from a whole library shuffle stays readable when consecutive
+ entries come from different artists and releases. The row is slightly taller than the plain text rows it replaced. */
.audio-player-queue-item {
display: flex;
- justify-content: space-between;
- gap: 12px;
- padding: 6px 8px;
+ align-items: center;
+ gap: 10px;
+ min-height: 52px;
+ padding: 8px;
+ box-sizing: border-box;
border-bottom: 1px solid #333333;
cursor: pointer;
}
+.audio-player-queue-item-cover {
+ display: block;
+ flex: 0 0 auto;
+ width: 36px;
+ height: 36px;
+ object-fit: cover;
+ background-color: #333333;
+}
+
.audio-player-queue-item.is-played .audio-player-queue-item-title {
color: #8A8A8A;
}
.audio-player-queue-item.is-current .audio-player-queue-item-title {
color: #6DCBFE;
+ font-weight: 700;
}
.audio-player-queue-item:focus {
@@ -1680,7 +1822,16 @@ html.audio-player-initializing .audio-player-container {
}
.audio-player-queue-item-title {
+ flex: 1 1 auto;
+ min-width: 0px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
+
+.audio-player-queue-item-duration {
+ flex: 0 0 auto;
+ font-size: 12px;
+ color: #9AA7B0;
+ font-variant-numeric: tabular-nums;
+}
diff --git a/src/Lumina.Presentation.Web/wwwroot/js/audio-player/audio-player-queue.js b/src/Lumina.Presentation.Web/wwwroot/js/audio-player/audio-player-queue.js
index 70601b6f..12e63e0a 100644
--- a/src/Lumina.Presentation.Web/wwwroot/js/audio-player/audio-player-queue.js
+++ b/src/Lumina.Presentation.Web/wwwroot/js/audio-player/audio-player-queue.js
@@ -22,12 +22,23 @@
* small concurrency bound so a prolific artist does not turn into hundreds of sequential requests.
* - Track context (libraryId, trackId):
* The descriptor itself is the only item. A track page does not load the album or the discography around it.
+ * - Library context (libraryId, without a trackId, albumId or artistId):
+ * WebRoutes.Music.GET_ARTISTS ("api-get-artists") returns the artists in artist page order. The first artist that has
+ * tracks starts the queue with its whole discography; the autoplay continuation then moves through the remaining artists in the same order.
+ * - Shuffle (release, artist or library scope):
+ * WebRoutes.Music.SHUFFLE_TRACKS ("api-shuffle-tracks") returns a uniformly random batch of tracks of the
+ * scope, selected by the API database, together with the album, artist and cover data of each track. The request
+ * carries the tracks the queue already holds, so consecutive batches do not repeat a track.
+ * - Now playing album details:
+ * WebRoutes.Music.GET_ALBUM ("api-get-album") returns the metadata and stored artwork of the current track's album,
+ * which the expanded player shows under its cover. The player requests it only while expanded and caches its small summary per album.
*
- * The autoplay continuation at the end of an album or an artist uses the same endpoints:
+ * The autoplay continuation at the end of an album, an artist or a library uses the same endpoints:
* - After an album, the remaining releases of the artist, in the release order this module applies (primary release
* type group, then release year, title and Id). When those are exhausted, the next artists of the library, in the
* artist order of GET_ARTISTS ("api-get-artists"), one artist at a time, each with all of its releases and tracks.
* - After an artist, the next artists of the library, one at a time.
+ * - After the first artist of a library context, the next artists of the library, one at a time.
* A continuation batch is never built for a track context or for an explicit queue, and it is dropped as soon as the user
* queues an explicit play next item.
*
@@ -35,11 +46,8 @@
* --------------
* Shuffle is offered per release, per artist and per library. It does not materialize a whole category: it appends a
* batch of {@link SHUFFLE_BATCH_SIZE} randomized tracks and, while the queue approaches the end of that batch, appends
- * another batch of the same category. The release and artist scopes only load the lightweight release metadata of the
- * category and prefetch the track lists of a small, bounded number of releases in parallel, never the whole category.
- * The library scope only loads the lightweight artist metadata and the releases of one artist at a time, so choosing
- * shuffle on an entire library never puts every track of the library into the queue and never fetches every track of the
- * library at once.
+ * another batch of the same category. The server selects each batch uniformly at random from every matching track of the
+ * scope and excludes the tracks the queue already holds, so a shuffle of a large library is not limited to the albums or artists that happen to be loaded first.
*
* Lifetime
* --------
@@ -85,6 +93,7 @@
LuminaAudioPlayer.PlayContextKind = Object.freeze({
ALBUM: 'album',
ARTIST: 'artist',
+ LIBRARY: 'library',
TRACK: 'track',
QUEUE: 'queue'
});
@@ -105,14 +114,6 @@
*/
const SHUFFLE_LOOKAHEAD = 10;
- /**
- * The number of release track lists a shuffle batch fetches at the same time. A batch of 100 tracks spans about nine
- * releases, so resolving their track lists concurrently removes most of the sequential wait before the batch is ready.
- * @readonly
- * @type {number}
- */
- const SHUFFLE_PREFETCH_CONCURRENCY = 4;
-
/**
* The number of history entries the queue keeps, so a very long session cannot grow the queue without bound.
* @readonly
@@ -218,23 +219,6 @@
return leftId === rightId ? 0 : (leftId < rightId ? -1 : 1);
}
- /**
- * Shuffles a copy of a list with the Fisher-Yates algorithm.
- * @template T
- * @param {Array} items - The items to shuffle.
- * @returns {Array} A new, shuffled list; the input is never mutated.
- */
- function shuffleCopy(items) {
- const result = Array.isArray(items) ? [...items] : [];
- for (let index = result.length - 1; index > 0; index--) {
- const swapIndex = Math.floor(Math.random() * (index + 1));
- const value = result[index];
- result[index] = result[swapIndex];
- result[swapIndex] = value;
- }
- return result;
- }
-
/**
* Reads a value from an insertion ordered cache and marks it as the most recently used.
* @param {Map} cache - The cache to read.
@@ -354,7 +338,7 @@
// the autoplay continuation.
this.shuffle = false;
this.shuffleScope = LuminaAudioPlayer.QueueShuffleScope.RELEASE;
- // The play context the queue was built from: { kind, libraryId, albumId, artistId, title, coverArtPath }.
+ // The play context the queue was built from: { kind, libraryId, albumId, artistId, title, coverArtPath, coverArtUrl }.
this.context = null;
// True while the autoplay continuation of an album or artist may still append entries.
this.continuationEnabled = false;
@@ -1057,6 +1041,7 @@
* Creates an instance of QueueContextService.
* @param {Object} options - The service options.
* @param {Function} options.fetchJsonAsync - The JSON transport, in the shape of the player's fetchJsonAsync.
+ * @param {Function} options.postJsonAsync - The JSON POST transport, in the shape of the player's postJsonAsync.
* @param {Function} options.getConfiguration - A function returning the endpoints configuration of the player.
* @param {Function} [options.getShouldIgnoreThePrefix] - A function returning the user's alpha picker prefix preference,
* so the artist order the queue uses matches the order the artist page shows.
@@ -1064,11 +1049,12 @@
constructor(options) {
const settings = options || {};
this.fetchJsonAsync = settings.fetchJsonAsync;
+ this.postJsonAsync = settings.postJsonAsync;
this.getConfiguration = settings.getConfiguration;
this.getShouldIgnoreThePrefix = settings.getShouldIgnoreThePrefix || (() => false);
// The ordered release list of an artist is reused by the artist context and by the continuation, so a long
- // discography does not re-fetch the same ordered list. Both caches are bounded LRUs, because a library shuffle
- // can otherwise visit every artist of the library for the whole page lifetime.
+ // discography does not re-fetch the same ordered list. Both caches are bounded LRUs, because a long session can
+ // otherwise visit every artist of a library for the whole page lifetime.
this.releaseCache = new Map();
this.artistCache = new Map();
}
@@ -1083,7 +1069,7 @@
}
/**
- * Builds the queue of a play descriptor.
+ * Builds the queue of a play descriptor. A descriptor that names only a library builds the ordered library context, starting with the first artist that has tracks.
* @param {Object} descriptor - The normalized play descriptor.
* @param {AbortSignal} [signal] - The signal that cancels the request when the player supersedes or stops it.
* @returns {Promise<{ descriptors: Array