From 525ac1348dd07594894ee79533b122388dd96121 Mon Sep 17 00:00:00 2001 From: Binary Alley Date: Thu, 22 Oct 2026 20:27:07 +0300 Subject: [PATCH] Adds favorites and aligns playlist and favorite pagination --- docs/manual/index.md | 1 + docs/manual/using-lumina/index.md | 19 +- docs/technical/api/favorites/Api.Favorites.md | 335 ++ .../architecture-decision-record-0017.md | 104 + docs/technical/domain/UbiquitousLanguage.md | 9 + .../requests/favorites/AddFavorite.http | 8 + .../requests/favorites/GetFavoriteStatus.http | 2 + .../requests/favorites/GetFavorites.http | 2 + .../requests/favorites/RemoveFavorite.http | 2 + docs/technical/theming/Theming.md | 90 +- .../DTO/Favorites/FavoriteItemDisplayDto.cs | 33 + .../Common/DTO/Favorites/FavoriteItemDto.cs | 17 + .../DTO/Playlists/PlaylistDetailsDto.cs | 10 +- .../DTO/Playlists/PlaylistEntryDisplayDto.cs | 4 +- .../Common/DTO/Playlists/PlaylistEntryDto.cs | 4 +- .../DTO/Playlists/PlaylistSummaryDto.cs | 2 + .../Entities/Favorites/FavoriteEntity.cs | 59 + .../Favorites/IFavoriteRepository.cs | 70 + .../Playlists/IPlaylistRepository.cs | 8 +- .../Common/DataAccess/UoW/IUnitOfWork.cs | 6 + .../Favorites/AddFavoriteRequestMapping.cs | 22 + .../Favorites/FavoriteEntityMapping.cs | 50 + .../Favorites/FavoriteItemDtoMapping.cs | 67 + .../Mapping/Favorites/FavoriteMapping.cs | 33 + .../GetFavoriteStatusRequestMapping.cs | 22 + .../Favorites/GetFavoritesRequestMapping.cs | 33 + .../Playlists/GetPlaylistRequestMapping.cs | 34 + .../Playlists/PlaylistDetailsDtoMapping.cs | 4 +- .../Playlists/PlaylistEntryDtoMapping.cs | 20 + .../Utilities/FavoriteMediaKindExtensions.cs | 30 + .../AddFavorite/AddFavoriteCommand.cs | 19 + .../AddFavorite/AddFavoriteCommandHandler.cs | 153 + .../AddFavoriteCommandValidator.cs | 38 + .../RemoveFavorite/RemoveFavoriteCommand.cs | 17 + .../RemoveFavoriteCommandHandler.cs | 123 + .../RemoveFavoriteCommandValidator.cs | 41 + .../GetFavoriteStatusQuery.cs | 20 + .../GetFavoriteStatusQueryHandler.cs | 73 + .../GetFavoriteStatusQueryValidator.cs | 46 + .../Queries/GetFavorites/GetFavoritesQuery.cs | 19 + .../GetFavorites/GetFavoritesQueryHandler.cs | 105 + .../GetFavoritesQueryValidator.cs | 24 + .../CreatePlaylistCommandHandler.cs | 4 +- .../Queries/GetPlaylist/GetPlaylistQuery.cs | 11 +- .../GetPlaylist/GetPlaylistQueryHandler.cs | 8 +- .../GetPlaylist/GetPlaylistQueryValidator.cs | 8 - .../Queries/GetPlaylist/PlaylistWindow.cs | 17 - .../Requests/Favorites/AddFavoriteRequest.cs | 18 + .../Favorites/GetFavoriteStatusRequest.cs | 19 + .../Requests/Favorites/GetFavoritesRequest.cs | 19 + .../Requests/Playlists/GetPlaylistRequest.cs | 12 +- .../Favorites/FavoriteItemResponse.cs | 39 + .../Responses/Favorites/FavoriteResponse.cs | 22 + .../Favorites/FavoriteStatusResponse.cs | 16 + .../Responses/Playlists/PlaylistResponse.cs | 12 +- .../Configuration/FavoriteConfiguration.cs | 77 + .../20261021184608_AddsFavorites.Designer.cs | 3766 +++++++++++++++++ .../20261021184608_AddsFavorites.cs | 62 + .../LuminaDbContextModelSnapshot.cs | 57 + .../Favorites/FavoriteRepository.cs | 403 ++ .../Playlists/PlaylistRepository.cs | 79 +- .../Core/UoW/LuminaDbContext.cs | 2 + src/Lumina.DataAccess/Core/UoW/UnitOfWork.cs | 15 + .../Enums/Favorites/FavoriteMediaKind.cs | 42 + .../Common/Errors/Errors.Favorite.cs | 22 + .../Common/Errors/Errors.Playlist.cs | 2 - .../MediaItemAggregate/MediaItemId.cs | 51 + .../UserAggregate/UserId.cs | 51 + .../Events/FavoriteAddedDomainEvent.cs | 30 + .../Events/FavoriteRemovedDomainEvent.cs | 30 + .../FavoriteAggregate/Favorite.cs | 163 + .../ValueObjects/FavoriteId.cs | 51 + .../Routes/Favorites/ApiRoutes.Favorites.cs | 18 + .../AddFavorite/AddFavoriteEndpoint.cs | 61 + .../AddFavorite/AddFavoriteEndpointSummary.cs | 170 + .../GetFavoriteStatusEndpoint.cs | 61 + .../GetFavoriteStatusEndpointSummary.cs | 112 + .../GetFavorites/GetFavoritesEndpoint.cs | 62 + .../GetFavoritesEndpointSummary.cs | 166 + .../RemoveFavorite/RemoveFavoriteEndpoint.cs | 61 + .../RemoveFavoriteEndpointSummary.cs | 104 + .../CreatePlaylistEndpointSummary.cs | 14 +- .../GetPlaylist/GetPlaylistEndpoint.cs | 11 +- .../GetPlaylist/GetPlaylistEndpointSummary.cs | 59 +- .../Core/Themes/Bundled/editorial-paper.zip | Bin 379844 -> 380698 bytes .../Core/Themes/Bundled/lumina-default.zip | Bin 379307 -> 380162 bytes .../PaginatedMusicAlbumLiteDto.cs | 38 - .../PaginatedMusicArtistLiteDto.cs | 38 - .../PaginatedMusicTrackLiteDto.cs | 38 - .../Common/DTO/Common/PaginatedDto.cs | 24 + .../Common/DTO/Favorites/FavoriteDto.cs | 22 + .../Common/DTO/Favorites/FavoriteItemDto.cs | 34 + .../Common/DTO/Favorites/FavoriteStatusDto.cs | 16 + .../DTO/Libraries/PaginatedBookLiteDto.cs | 38 - .../Common/DTO/Playlists/PlaylistDto.cs | 10 +- .../Enums/Favorites/FavoriteMediaKind.cs | 42 + .../Requests/Favorites/AddFavoriteRequest.cs | 18 + .../Favorites/GetFavoriteStatusRequest.cs | 19 + .../Requests/Favorites/GetFavoritesRequest.cs | 19 + .../Requests/Playlists/GetPlaylistRequest.cs | 12 +- .../Common/Routes/ApiRoutes.Favorites.cs | 18 + .../Common/Routes/WebRoutes.Favorites.cs | 19 + .../AddFavorite/AddFavoriteEndpoint.cs | 55 + .../AddFavorite/AddFavoriteEndpointSummary.cs | 42 + .../GetFavoriteStatusEndpoint.cs | 72 + .../GetFavoriteStatusEndpointSummary.cs | 43 + .../GetFavorites/GetFavoritesEndpoint.cs | 69 + .../GetFavoritesEndpointSummary.cs | 58 + .../Index/FavoritesIndexViewEndpoint.cs | 108 + .../FavoritesIndexViewEndpointSummary.cs | 24 + .../RemoveFavorite/RemoveFavoriteEndpoint.cs | 71 + .../RemoveFavoriteEndpointSummary.cs | 30 + .../GetArtistAlbumsEndpoint.cs | 3 +- .../GetMusicArtistsEndpoint.cs | 3 +- .../GetAlbumTracks/GetAlbumTracksEndpoint.cs | 3 +- .../GetLibraryItemsEndpoint.cs | 3 +- .../GetLibraryItemsEndpointSummary.cs | 2 +- .../GetPlaylist/GetPlaylistEndpoint.cs | 14 +- .../GetPlaylist/GetPlaylistEndpointSummary.cs | 41 +- .../Playlists/Item/AddPlaylistViewEndpoint.cs | 12 +- .../Item/PlaylistItemViewEndpoint.cs | 8 +- .../Views/Favorites/Index.ar-SA.resx | 66 + .../Views/Favorites/Index.de-DE.resx | 66 + .../Views/Favorites/Index.en-US.resx | 66 + .../Views/Favorites/Index.es-ES.resx | 66 + .../Views/Favorites/Index.fr-FR.resx | 66 + .../Views/Favorites/Index.it-IT.resx | 66 + .../Views/Favorites/Index.ja-JP.resx | 66 + .../Core/Resources/Views/Favorites/Index.resx | 66 + .../Views/Favorites/Index.ro-RO.resx | 66 + .../Views/Favorites/Index.uk-UA.resx | 66 + .../Views/Favorites/Index.zh-CN.resx | 66 + .../Resources/Views/Playlists/Item.ar-SA.resx | 3 + .../Resources/Views/Playlists/Item.de-DE.resx | 3 + .../Resources/Views/Playlists/Item.en-US.resx | 3 + .../Resources/Views/Playlists/Item.es-ES.resx | 3 + .../Resources/Views/Playlists/Item.fr-FR.resx | 3 + .../Resources/Views/Playlists/Item.it-IT.resx | 3 + .../Resources/Views/Playlists/Item.ja-JP.resx | 3 + .../Core/Resources/Views/Playlists/Item.resx | 3 + .../Resources/Views/Playlists/Item.ro-RO.resx | 3 + .../Resources/Views/Playlists/Item.uk-UA.resx | 3 + .../Resources/Views/Playlists/Item.zh-CN.resx | 3 + .../Resources/Views/Shared/_Layout.ar-SA.resx | 6 + .../Resources/Views/Shared/_Layout.de-DE.resx | 6 + .../Resources/Views/Shared/_Layout.en-US.resx | 6 + .../Resources/Views/Shared/_Layout.es-ES.resx | 6 + .../Resources/Views/Shared/_Layout.fr-FR.resx | 6 + .../Resources/Views/Shared/_Layout.it-IT.resx | 6 + .../Resources/Views/Shared/_Layout.ja-JP.resx | 6 + .../Core/Resources/Views/Shared/_Layout.resx | 6 + .../Resources/Views/Shared/_Layout.ro-RO.resx | 6 + .../Resources/Views/Shared/_Layout.uk-UA.resx | 6 + .../Resources/Views/Shared/_Layout.zh-CN.resx | 6 + .../Views/Shared/_NavMenu.ar-SA.resx | 3 + .../Views/Shared/_NavMenu.de-DE.resx | 3 + .../Views/Shared/_NavMenu.en-US.resx | 3 + .../Views/Shared/_NavMenu.es-ES.resx | 3 + .../Views/Shared/_NavMenu.fr-FR.resx | 3 + .../Views/Shared/_NavMenu.it-IT.resx | 3 + .../Views/Shared/_NavMenu.ja-JP.resx | 3 + .../Core/Resources/Views/Shared/_NavMenu.resx | 3 + .../Views/Shared/_NavMenu.ro-RO.resx | 3 + .../Views/Shared/_NavMenu.uk-UA.resx | 3 + .../Views/Shared/_NavMenu.zh-CN.resx | 3 + .../Core/Themes/ThemeNavBuilder.cs | 1 + .../Core/Views/Favorites/Index.cshtml | 534 +++ .../MusicLibrary/Albums/Item.cshtml | 19 +- .../MusicLibrary/Artists/Index.cshtml | 9 + .../MusicLibrary/Artists/Item.cshtml | 9 + .../BookLibrary/Books/Index.cshtml | 9 + .../Core/Views/Playlists/Item.cshtml | 284 +- .../Views/Shared/_ThemeLayoutScripts.cshtml | 15 + .../wwwroot/css/site.css | 64 + .../wwwroot/js/favorites.js | 553 +++ src/Lumina.sln | 16 + .../PaginatedMusicAlbumLiteDtoFixture.cs | 55 - .../PaginatedMusicArtistLiteDtoFixture.cs | 55 - .../PaginatedMusicTrackLiteDtoFixture.cs | 55 - .../PaginatedDtoFixture.cs} | 39 +- .../Playlists/PlaylistRepositoryTests.cs | 15 +- .../GetArtistAlbumsEndpointTests.cs | 6 +- .../GetMusicArtistsEndpointTests.cs | 4 +- .../GetAlbumTracksEndpointTests.cs | 6 +- .../GetLibraryItemsEndpointTests.cs | 6 +- .../GetArtistAlbumsEndpointTests.cs | 4 +- .../GetMusicArtistsEndpointTests.cs | 4 +- .../GetAlbumTracksEndpointTests.cs | 4 +- .../GetLibraryItemsEndpointTests.cs | 4 +- .../GetArtistAlbumsEndpointTests.cs | 28 +- .../GetMusicArtistsEndpointTests.cs | 28 +- .../GetAlbumTracksEndpointTests.cs | 36 +- .../GetLibraryItemsEndpointTests.cs | 16 +- 193 files changed, 10944 insertions(+), 643 deletions(-) create mode 100644 docs/technical/api/favorites/Api.Favorites.md create mode 100644 docs/technical/architecture/architecture-knowledge-management/architecture-decision-log/architecture-decision-record-0017.md create mode 100644 docs/technical/requests/favorites/AddFavorite.http create mode 100644 docs/technical/requests/favorites/GetFavoriteStatus.http create mode 100644 docs/technical/requests/favorites/GetFavorites.http create mode 100644 docs/technical/requests/favorites/RemoveFavorite.http create mode 100644 src/Lumina.Application/Common/DTO/Favorites/FavoriteItemDisplayDto.cs create mode 100644 src/Lumina.Application/Common/DTO/Favorites/FavoriteItemDto.cs create mode 100644 src/Lumina.Application/Common/DataAccess/Entities/Favorites/FavoriteEntity.cs create mode 100644 src/Lumina.Application/Common/DataAccess/Repositories/Favorites/IFavoriteRepository.cs create mode 100644 src/Lumina.Application/Common/Mapping/Favorites/AddFavoriteRequestMapping.cs create mode 100644 src/Lumina.Application/Common/Mapping/Favorites/FavoriteEntityMapping.cs create mode 100644 src/Lumina.Application/Common/Mapping/Favorites/FavoriteItemDtoMapping.cs create mode 100644 src/Lumina.Application/Common/Mapping/Favorites/FavoriteMapping.cs create mode 100644 src/Lumina.Application/Common/Mapping/Favorites/GetFavoriteStatusRequestMapping.cs create mode 100644 src/Lumina.Application/Common/Mapping/Favorites/GetFavoritesRequestMapping.cs create mode 100644 src/Lumina.Application/Common/Mapping/Playlists/GetPlaylistRequestMapping.cs create mode 100644 src/Lumina.Application/Common/Utilities/FavoriteMediaKindExtensions.cs create mode 100644 src/Lumina.Application/Core/Favorites/Commands/AddFavorite/AddFavoriteCommand.cs create mode 100644 src/Lumina.Application/Core/Favorites/Commands/AddFavorite/AddFavoriteCommandHandler.cs create mode 100644 src/Lumina.Application/Core/Favorites/Commands/AddFavorite/AddFavoriteCommandValidator.cs create mode 100644 src/Lumina.Application/Core/Favorites/Commands/RemoveFavorite/RemoveFavoriteCommand.cs create mode 100644 src/Lumina.Application/Core/Favorites/Commands/RemoveFavorite/RemoveFavoriteCommandHandler.cs create mode 100644 src/Lumina.Application/Core/Favorites/Commands/RemoveFavorite/RemoveFavoriteCommandValidator.cs create mode 100644 src/Lumina.Application/Core/Favorites/Queries/GetFavoriteStatus/GetFavoriteStatusQuery.cs create mode 100644 src/Lumina.Application/Core/Favorites/Queries/GetFavoriteStatus/GetFavoriteStatusQueryHandler.cs create mode 100644 src/Lumina.Application/Core/Favorites/Queries/GetFavoriteStatus/GetFavoriteStatusQueryValidator.cs create mode 100644 src/Lumina.Application/Core/Favorites/Queries/GetFavorites/GetFavoritesQuery.cs create mode 100644 src/Lumina.Application/Core/Favorites/Queries/GetFavorites/GetFavoritesQueryHandler.cs create mode 100644 src/Lumina.Application/Core/Favorites/Queries/GetFavorites/GetFavoritesQueryValidator.cs delete mode 100644 src/Lumina.Application/Core/Playlists/Queries/GetPlaylist/PlaylistWindow.cs create mode 100644 src/Lumina.Contracts/Requests/Favorites/AddFavoriteRequest.cs create mode 100644 src/Lumina.Contracts/Requests/Favorites/GetFavoriteStatusRequest.cs create mode 100644 src/Lumina.Contracts/Requests/Favorites/GetFavoritesRequest.cs create mode 100644 src/Lumina.Contracts/Responses/Favorites/FavoriteItemResponse.cs create mode 100644 src/Lumina.Contracts/Responses/Favorites/FavoriteResponse.cs create mode 100644 src/Lumina.Contracts/Responses/Favorites/FavoriteStatusResponse.cs create mode 100644 src/Lumina.DataAccess/Common/Configuration/FavoriteConfiguration.cs create mode 100644 src/Lumina.DataAccess/Common/Migrations/20261021184608_AddsFavorites.Designer.cs create mode 100644 src/Lumina.DataAccess/Common/Migrations/20261021184608_AddsFavorites.cs create mode 100644 src/Lumina.DataAccess/Core/Repositories/Favorites/FavoriteRepository.cs create mode 100644 src/Lumina.Domain.SharedKernel/Common/Enums/Favorites/FavoriteMediaKind.cs create mode 100644 src/Lumina.Domain/Common/Errors/Errors.Favorite.cs create mode 100644 src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/ExternalIdentifiers/MediaLibraryBoundedContext/MediaItemAggregate/MediaItemId.cs create mode 100644 src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/ExternalIdentifiers/UserManagementBoundedContext/UserAggregate/UserId.cs create mode 100644 src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/Events/FavoriteAddedDomainEvent.cs create mode 100644 src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/Events/FavoriteRemovedDomainEvent.cs create mode 100644 src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/Favorite.cs create mode 100644 src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/ValueObjects/FavoriteId.cs create mode 100644 src/Lumina.Presentation.Api/Common/Routes/Favorites/ApiRoutes.Favorites.cs create mode 100644 src/Lumina.Presentation.Api/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpoint.cs create mode 100644 src/Lumina.Presentation.Api/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpointSummary.cs create mode 100644 src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpoint.cs create mode 100644 src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpointSummary.cs create mode 100644 src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpoint.cs create mode 100644 src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpointSummary.cs create mode 100644 src/Lumina.Presentation.Api/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpoint.cs create mode 100644 src/Lumina.Presentation.Api/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpointSummary.cs delete mode 100644 src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDto.cs delete mode 100644 src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicArtistLiteDto.cs delete mode 100644 src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicTrackLiteDto.cs create mode 100644 src/Lumina.Presentation.Web/Common/DTO/Common/PaginatedDto.cs create mode 100644 src/Lumina.Presentation.Web/Common/DTO/Favorites/FavoriteDto.cs create mode 100644 src/Lumina.Presentation.Web/Common/DTO/Favorites/FavoriteItemDto.cs create mode 100644 src/Lumina.Presentation.Web/Common/DTO/Favorites/FavoriteStatusDto.cs delete mode 100644 src/Lumina.Presentation.Web/Common/DTO/Libraries/PaginatedBookLiteDto.cs create mode 100644 src/Lumina.Presentation.Web/Common/Enums/Favorites/FavoriteMediaKind.cs create mode 100644 src/Lumina.Presentation.Web/Common/Requests/Favorites/AddFavoriteRequest.cs create mode 100644 src/Lumina.Presentation.Web/Common/Requests/Favorites/GetFavoriteStatusRequest.cs create mode 100644 src/Lumina.Presentation.Web/Common/Requests/Favorites/GetFavoritesRequest.cs create mode 100644 src/Lumina.Presentation.Web/Common/Routes/ApiRoutes.Favorites.cs create mode 100644 src/Lumina.Presentation.Web/Common/Routes/WebRoutes.Favorites.cs create mode 100644 src/Lumina.Presentation.Web/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpoint.cs create mode 100644 src/Lumina.Presentation.Web/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpointSummary.cs create mode 100644 src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpoint.cs create mode 100644 src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpointSummary.cs create mode 100644 src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpoint.cs create mode 100644 src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpointSummary.cs create mode 100644 src/Lumina.Presentation.Web/Core/Endpoints/Favorites/Index/FavoritesIndexViewEndpoint.cs create mode 100644 src/Lumina.Presentation.Web/Core/Endpoints/Favorites/Index/FavoritesIndexViewEndpointSummary.cs create mode 100644 src/Lumina.Presentation.Web/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpoint.cs create mode 100644 src/Lumina.Presentation.Web/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpointSummary.cs create mode 100644 src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.ar-SA.resx create mode 100644 src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.de-DE.resx create mode 100644 src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.en-US.resx create mode 100644 src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.es-ES.resx create mode 100644 src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.fr-FR.resx create mode 100644 src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.it-IT.resx create mode 100644 src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.ja-JP.resx create mode 100644 src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.resx create mode 100644 src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.ro-RO.resx create mode 100644 src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.uk-UA.resx create mode 100644 src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.zh-CN.resx create mode 100644 src/Lumina.Presentation.Web/Core/Views/Favorites/Index.cshtml create mode 100644 src/Lumina.Presentation.Web/wwwroot/js/favorites.js delete mode 100644 tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDtoFixture.cs delete mode 100644 tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicArtistLiteDtoFixture.cs delete mode 100644 tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicTrackLiteDtoFixture.cs rename tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/{Libraries/PaginatedBookLiteDtoFixture.cs => Common/PaginatedDtoFixture.cs} (50%) diff --git a/docs/manual/index.md b/docs/manual/index.md index b3a2e806..5cee1d79 100644 --- a/docs/manual/index.md +++ b/docs/manual/index.md @@ -37,6 +37,7 @@ Lumina is growing, and this is what works right now: - **Media libraries that scan themselves.** Point Lumina at a folder or a drive, tell it what kind of media lives there, and it gets to work discovering and indexing what it finds. Scans run in the background, report their progress as they go, and can be started, cancelled or resumed. - **Written content.** Add a written content library and Lumina scans it, cataloguing the books and e-books it contains and dressing them up with metadata for browsing in the client. Open one and it renders in the browser through a reader plugin; the EPUB and PDF readers are bundled and can be enabled per library. - **Music.** Add a music library and Lumina indexes the artists, albums and tracks it contains, reading metadata from the tags inside the audio files. If you want more, enable a metadata provider and Lumina fills in the gaps from online sources, and artwork can come from your folders or from remote sources. You can also build your own playlists, order them the way you want and play them in the browser. +- **Favorites.** Mark the artists, albums, tracks and books you love as favorites and come back to them from one page, filtered by kind. Favorites are private to your account. - **Metadata and artwork from plugins.** Plugins do the knowing. They supply the metadata and the artwork of a library, and you decide, library by library, which ones are switched on and which one wins when several of them recognize the same item. - **A file system browser.** Reach the drives, folders and files of the server machine from anywhere you can open the client, as if you were sitting right in front of it. Poke around, walk a path to its root or to its parent, and let Lumina generate thumbnails for what it finds. - **Accounts, roles, permissions and policies.** Create accounts, sign in with a password and optional two factor authentication, and hand out access through roles, fine grained permissions and policies that decide who may reach which library or content. Administrators manage all of it from the administration area. diff --git a/docs/manual/using-lumina/index.md b/docs/manual/using-lumina/index.md index 4859fc7c..ced2b80c 100644 --- a/docs/manual/using-lumina/index.md +++ b/docs/manual/using-lumina/index.md @@ -90,11 +90,24 @@ From the playlists page you can open a playlist or select **Create** to open the The playlist reflects the catalogue at the moment you open it. If a track is deleted from a library after it was added to a playlist, its row stays in the playlist as an unavailable track so you can remove it deliberately. Long playlists are shown in pages; select **Load more** to show the next page. +## Favorites + +A favorite is a mark you place on an artist, album, track or book so you can find it again quickly. Favorites belong to your account and are not shared with other users. Marking an item never changes the item or its files. Videos and photos are not available as favorites yet. + +Select the heart on an item's card, or on its row on an album page, to add or remove the mark. A blue heart means the item is not a favorite; a red heart means it is. + +The **Favorites** page in the library section lists everything you marked, most recent first, with a count that follows the filter. + +- **Filter by kind** with the **Show** picker. +- **Open an item** from its card. +- **Remove a favorite** with the heart on its card. +- **Load more** when the list is long, or **Retry** if it does not load. + +A favorite whose item was deleted, or whose library you can no longer access, stays in the list as an unavailable card so you can still remove it. + ## 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. - -Changes you make here live in Lumina's catalogue. +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 applies the changes to Lumina's catalogue. ## The file system browser diff --git a/docs/technical/api/favorites/Api.Favorites.md b/docs/technical/api/favorites/Api.Favorites.md new file mode 100644 index 00000000..92d9ae44 --- /dev/null +++ b/docs/technical/api/favorites/Api.Favorites.md @@ -0,0 +1,335 @@ +# Lumina API + +- [Lumina API](#lumina-api) + - [Favorites](#favorites) + - [Add Favorite](#add-favorite) + - [Add Favorite Request](#add-favorite-request) + - [Add Favorite Response](#add-favorite-response) + - [Remove Favorite](#remove-favorite) + - [Remove Favorite Request](#remove-favorite-request) + - [Remove Favorite Response](#remove-favorite-response) + - [Get Favorites](#get-favorites) + - [Get Favorites Request](#get-favorites-request) + - [Get Favorites Response](#get-favorites-response) + - [Get Favorite Status](#get-favorite-status) + - [Get Favorite Status Request](#get-favorite-status-request) + - [Get Favorite Status Response](#get-favorite-status-response) + - [Media Kinds](#media-kinds) + - [Scoping and Library Access](#scoping-and-library-access) + - [Errors](#errors) + - [Pagination Limits](#pagination-limits) + +## Favorites + +A favorite is the marker the current user places on a media item of any media kind. It references the item only by its kind and its Id, so the same four operations serve music artists, albums and tracks, books, and the kinds that are planned. A favorite belongs to the user that created it, and only that user can list it, check it or remove it. Every route is under `users/me`, because it always acts on the currently authenticated user, and every operation requires authentication. + +Favorites are independent of the catalogue they point to. A favorite stores the kind and the Id of the item without a foreign key to it, so deleting the item from its library does not delete the favorite. A favorite is deleted together with the user that owns it. A favorite whose item was deleted, or whose library the user can no longer access, is still listed, as an unavailable item with empty display fields, so that its owner can see it and remove it. + +All the responses of the four operations are private to the authenticated user: they carry `Cache-Control: private, no-store` and `Vary: Authorization`. + +### Add Favorite + +#### Add Favorite Request + +```js +POST api/v1/users/me/favorites +Authorization: Bearer +Content-Type: application/json +``` + +```json +{ + "mediaKind": "MusicTrack", + "mediaItemId": "9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f" +} +``` + +| Field | Type | Required | Meaning | +| --- | --- | --- | --- | +| `mediaKind` | string | yes | The kind of the media item: `MusicArtist`, `MusicAlbum`, `MusicTrack` or `Book`. `Video` and `Photo` are planned kinds and are rejected, see [Media Kinds](#media-kinds). | +| `mediaItemId` | Guid | yes | The Id of the media item. It cannot be the empty Guid. | + +Marks the media item as a favorite of the current user. The request is validated first, and then the media item is looked up in the catalogue of its kind. The item must exist, and the library that contains it must be accessible to the current user, see [Scoping and Library Access](#scoping-and-library-access). The user is always the authenticated user, so no user Id is accepted in the body. + +#### Add Favorite Response + +```js +200 Ok +``` + +```json +{ + "id": "2c1b0a9f-8e7d-4c6b-5a4f-3e2d1c0b9a8f", + "mediaKind": "MusicTrack", + "mediaItemId": "9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f", + "favoritedOnUtc": "2026-10-21T12:00:00.0000000Z" +} +``` + +| Field | Meaning | +| --- | --- | +| `id` | The Id of the favorite. | +| `mediaKind` | The kind of the favorited media item. | +| `mediaItemId` | The Id of the favorited media item. | +| `favoritedOnUtc` | The date and time when the item was favorited. | + +The response is `200 Ok` both when the favorite was created and when it already existed, so a client does not need to tell the two apart. The favorite is read back from storage after it is saved, so `favoritedOnUtc` is the stored value. A favorite that was created raises a `FavoriteAdded` domain event; an existing favorite raises none. + +### Remove Favorite + +#### Remove Favorite Request + +```js +DELETE api/v1/users/me/favorites/MusicTrack/9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f +Authorization: Bearer +``` + +| Route value | Meaning | +| --- | --- | +| `mediaKind` | The name of the media kind, matched case insensitively. Only the member names are accepted: a number that would parse as a kind is rejected. | +| `mediaItemId` | The Id of the media item. It must be a Guid and cannot be the empty Guid. | + +Removes the favorite of the current user on the media item identified by the route. Removal is scoped to the authenticated user and never touches another user's favorite. It does not look the media item up and does not evaluate the library access rule, so a user can always remove their own favorite even when the item was deleted or its library is no longer accessible. Another user's favorite is never visible to them, so it cannot be removed through this route. Removing a media kind that is planned but not supported is not an error by itself: it finds no favorite and the request succeeds without changing anything. + +#### Remove Favorite Response + +```js +200 Ok +``` + +The response body is an empty JSON object. + +Removing an item that the current user did not favorite succeeds without changing anything, and the same is true for a favorite of another user, which is never visible to the current user. Removing is therefore idempotent: the second removal of the same favorite also returns `200 Ok` and raises no event. A favorite that was actually removed raises a `FavoriteRemoved` domain event. + +### Get Favorites + +#### Get Favorites Request + +```js +GET api/v1/users/me/favorites?mediaKind=MusicTrack¤tPage=1&perPage=200 +Authorization: Bearer +``` + +| Query parameter | Type | Required | Meaning | +| --- | --- | --- | --- | +| `mediaKind` | string | no | Restricts the list to one kind: `MusicArtist`, `MusicAlbum`, `MusicTrack` or `Book`. Every kind is returned when it is omitted. | +| `currentPage` | integer | no | The one based page of favorites to return. Defaults to `1` when `perPage` is provided. Values below `1` are raised to `1`. | +| `perPage` | integer | no | The number of favorites per page. Defaults to `200` when `currentPage` is provided. Values below `1` are raised to `1`, and there is no maximum. | + +Returns the favorites of the current user, from the most recently favorited. The page bounds one response, not the number of favorites a user can have: a client reads the next page until `currentPage` reaches `numberOfPages`, and `count` reports the total. When neither `currentPage` nor `perPage` is provided, every matching favorite is returned in a single page, the same way the other paginated collections of the API behave when pagination is omitted. + +#### Get Favorites Response + +```js +200 Ok +``` + +```json +{ + "data": [ + { + "mediaKind": "MusicTrack", + "mediaItemId": "9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f", + "isAvailable": true, + "libraryId": "3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a", + "title": "Bohemian Rhapsody", + "collectionId": "e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f", + "collectionTitle": "A Night at the Opera", + "creatorId": "d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a", + "creatorName": "Queen", + "coverPath": "/media/music/Queen-3b3a19f3/A Night at the Opera-e8d52f7b/cover.jpg" + }, + { + "mediaKind": "Book", + "mediaItemId": "4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d", + "isAvailable": true, + "libraryId": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f", + "title": "The Hobbit", + "collectionId": "00000000-0000-0000-0000-000000000000", + "collectionTitle": "", + "creatorId": "00000000-0000-0000-0000-000000000000", + "creatorName": "J. R. R. Tolkien", + "coverPath": null + }, + { + "mediaKind": "MusicAlbum", + "mediaItemId": "0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f", + "isAvailable": false, + "libraryId": "00000000-0000-0000-0000-000000000000", + "title": "", + "collectionId": "00000000-0000-0000-0000-000000000000", + "collectionTitle": "", + "creatorId": "00000000-0000-0000-0000-000000000000", + "creatorName": "", + "coverPath": null + } + ], + "currentPage": 1, + "perPage": 200, + "count": 3, + "numberOfPages": 1 +} +``` + +| Field | Meaning | +| --- | --- | +| `data` | The favorites of the page, from the most recently favorited. | +| `currentPage` | The one based page number. | +| `perPage` | The number of favorites per page. | +| `count` | The number of favorites that match the `mediaKind` filter, even when only a page of them is returned. | +| `numberOfPages` | The total number of pages. | + +Each item carries the kind and Id of the favorited media item together with its display details. The display fields are generic across media kinds, and "no value" is the empty Guid or the empty string: + +| Field | Meaning | +| --- | --- | +| `mediaKind` | The kind of the favorited media item. | +| `mediaItemId` | The Id of the favorited media item. | +| `isAvailable` | Whether the item still exists and its library is accessible to the user. When it is `false`, every display field below is empty. | +| `libraryId` | The Id of the library that contains the item. | +| `title` | The title of the item. | +| `collectionId`, `collectionTitle` | The Id and the title of the collection the item belongs to. | +| `creatorId`, `creatorName` | The Id and the name of the creator of the item. | +| `coverPath` | The stored path of the cover art of the item, the same kind of value the artist, album and book resources expose as `coverPath`, or `null` when it has none. The cover of a track is the cover of its album. | + +How the generic fields map to each kind: + +| Kind | `title` | `collection` | `creator` | +| --- | --- | --- | --- | +| `MusicArtist` | The artist name. | None. | None. | +| `MusicAlbum` | The album title. | None. | The artist. | +| `MusicTrack` | The track title. | The album. | The artist. | +| `Book` | The book title. | None today: the series of a book is not catalogued yet, so the collection is always empty. | The first author, by display name. | + +An item whose display details no longer exist, because the item was deleted, or whose library the current user cannot access, is returned with `isAvailable` set to `false` and every display field empty. It stays in `data` and in `count`, so its owner can see it and remove it with [Remove Favorite](#remove-favorite), and the response never exposes display data from a library the user cannot reach. The Id of the media item is the one the user favorited, and carries no information beyond that. + +### Get Favorite Status + +#### Get Favorite Status Request + +```js +GET api/v1/users/me/favorites/status?mediaKind=MusicTrack&mediaItemIds=9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f&mediaItemIds=8e9f0a1b-2c3d-4e5f-9a6b-7c8d9e0f1a2b +Authorization: Bearer +``` + +| Query parameter | Type | Required | Meaning | +| --- | --- | --- | --- | +| `mediaKind` | string | yes | The kind of every media item checked: `MusicArtist`, `MusicAlbum`, `MusicTrack` or `Book`. | +| `mediaItemIds` | Guid, repeated | yes | The Ids of the media items to check, one `mediaItemIds` parameter per Id, from 1 to 100. None can be the empty Guid. Repeated Ids are checked once. | + +Tells which of the given media items are favorites of the current user. It reads only the favorites of the current user and evaluates no library access, so the answer reveals nothing about any other user, and an Id that is not a favorite, does not exist or belongs to an inaccessible library is simply absent from the answer. A page that renders many favorite toggles uses it to hydrate all of them with one request per kind. + +#### Get Favorite Status Response + +```js +200 Ok +``` + +```json +{ + "favoritedMediaItemIds": [ + "9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f" + ] +} +``` + +| Field | Meaning | +| --- | --- | +| `favoritedMediaItemIds` | The Ids, among the checked ones, that the current user favorited. Empty when none is. | + +### Media Kinds + +The media kind is stored by its name, together with the Id of the item. + +| Kind | Status | Item | +| --- | --- | --- | +| `MusicArtist` | Supported | An artist of a music library. | +| `MusicAlbum` | Supported | An album of a music library. | +| `MusicTrack` | Supported | A track of a music library. | +| `Book` | Supported | A book of a book library. | +| `Video` | Planned | A video file. Video libraries are not catalogued yet. | +| `Photo` | Planned | A photo. Photo libraries are not catalogued yet. | + +### Scoping and Library Access + +Every operation is scoped to the current user by the server: the user is read from the authenticated principal, never from the route, the query or the body, so a user cannot read or change the favorites of another user. + +Adding a favorite also applies the library access rule. The server resolves the library that contains the item, through the catalogue of its kind, and then evaluates the library ownership policy of the current user for that library, exactly as the library routes do. An item that does not exist, and an item whose library is not accessible to the current user, are both reported with the same kind specific not found error, so the response cannot be used to find out whether an item exists in a library of another user. The not found error depends on the kind: + +| Kind | Not found error | +| --- | --- | +| `MusicArtist` | `ArtistNotFound` | +| `MusicAlbum` | `AlbumNotFound` | +| `MusicTrack` | `TrackNotFound` | +| `Book` | `BookNotFound` | + +Removing, and checking the status of, favorites do not evaluate the rule, because they only touch the favorites of the current user. Listing evaluates the rule once for each distinct library among the items of the page, and an item of an inaccessible library is returned as unavailable, as described in [Get Favorites Response](#get-favorites-response). + +### Errors + +Errors are returned as problem details. A request without a valid token is rejected with `401 Unauthorized` before it reaches the operation. + +| Status | Error | When | +| --- | --- | --- | +| `401` | | The request carries no token, or an invalid or expired one. The body is a problem whose `title` is `Unauthorized` and whose `detail` says why, for example `The token has expired`. | +| `403` | `NotAuthorized` | The authenticated principal carries no user identity. | +| `404` | `ArtistNotFound` | [Add Favorite](#add-favorite) of a `MusicArtist` that does not exist or whose library the user cannot access. | +| `404` | `AlbumNotFound` | [Add Favorite](#add-favorite) of a `MusicAlbum` that does not exist or whose library the user cannot access. | +| `404` | `TrackNotFound` | [Add Favorite](#add-favorite) of a `MusicTrack` that does not exist or whose library the user cannot access. | +| `404` | `BookNotFound` | [Add Favorite](#add-favorite) of a `Book` that does not exist or whose library the user cannot access. | +| `409` | `ConcurrencyConflict` | The storage reported a busy or locked database while the change was saved. Repeating the request is safe. | +| `422` | see below | The request failed validation. | + +The `404` and `409` problems carry the generic error code in `title` and the specific name in `detail`: + +```json +{ + "title": "General.NotFound", + "status": 404, + "detail": "TrackNotFound", + "instance": "/api/v1/users/me/favorites", + "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01" +} +``` + +A request that fails validation is rejected with `422 Unprocessable Entity` and a validation problem whose `errors` object lists the names of the validation errors under the generic `General.Validation` code: + +```json +{ + "title": "General.Validation", + "status": 422, + "detail": "OneOrMoreValidationErrorsOccurred", + "instance": "/api/v1/users/me/favorites", + "errors": { + "General.Validation": [ + "FavoriteMediaKindIsNotSupported" + ] + }, + "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01" +} +``` + +The validation errors of each operation are: + +| Error | Operation | When | +| --- | --- | --- | +| `FavoriteMediaKindIsInvalid` | Add, Remove, Get Favorites, Get Favorite Status | The kind is missing where it is required, or it is a number that is not a member of the media kind enumeration. In the Remove route, the segment is not a member name of the enumeration, and numbers are not accepted. | +| `FavoriteMediaKindIsNotSupported` | Add | The kind is `Video` or `Photo`, which are planned and cannot be favorited yet. | +| `FavoriteMediaItemIdCannotBeEmpty` | Add, Remove, Get Favorite Status | The item Id is missing or is the empty Guid. In the Remove route it is also reported when the segment is not a Guid. For the status request, any of the Ids is the empty Guid. | +| `FavoriteMediaItemIdsCannotBeEmpty` | Get Favorite Status | No `mediaItemIds` were given. | +| `FavoriteMediaItemIdsExceedMaximumCount` | Get Favorite Status | More than 100 Ids were given. | + +A value that cannot be bound is not reported by the validators. This covers a `mediaKind` that is not a member of `FavoriteMediaKind` (for example `"Song"`, or a number outside the enumeration), an item Id that is not a Guid in the Add body or the status query, and a `currentPage` or `perPage` that is not an integer. The endpoints do not catch binding failures, so the request is answered by the exception handling middleware as a generic `500 Internal Server Error` problem, exactly like every other endpoint of the API that binds an enumeration or a number, and not with the `422` problem above. The web client never sends such values, because its proxy endpoints rebuild the query from typed values. + +`FavoriteAlreadyExists` is defined among the favorites errors, but adding is idempotent, so no operation returns it. `FavoriteNotFound` remains defined for the storage read that follows an add, but removing is idempotent, so a remove request no longer returns it. + +### Pagination Limits + +| Limit | Value | +| --- | --- | +| Default per page of Get Favorites | 200 favorites, when a page is requested. | +| Minimum per page of Get Favorites | 1 favorite. | +| Maximum per page of Get Favorites | None. The server has no separate maximum page size, matching the other paginated collections of the API. | +| Ids of one Get Favorite Status request | From 1 to 100, one kind per request. The Ids travel in the query string, so the limit keeps the request line under the 8 KB default of Kestrel. | + +The limits bound a response or a request, not the number of favorites a user can have. A client that needs more than 100 Ids checked splits them into several requests, as the bundled web client does. diff --git a/docs/technical/architecture/architecture-knowledge-management/architecture-decision-log/architecture-decision-record-0017.md b/docs/technical/architecture/architecture-knowledge-management/architecture-decision-log/architecture-decision-record-0017.md new file mode 100644 index 00000000..239cbea8 --- /dev/null +++ b/docs/technical/architecture/architecture-knowledge-management/architecture-decision-log/architecture-decision-record-0017.md @@ -0,0 +1,104 @@ +# Architecture Decision Record (ADR): 0017 - One Generic Favorites Aggregate Keyed by Media Kind and Item Id + +## Status + +**Accepted** (2026-10-21) + +## Context + +A user must be able to mark any media item as a favorite: today the artists, albums and tracks of a music library and the books of a book library, and later videos and photos. Playlists already reference media items across bounded contexts by storing a media kind and a media item Id without a foreign key. + +Favorites raise the same question with different constraints: + +1. **One concept, many contexts**: a favorite is the same fact for every media kind, so a table and an aggregate per media kind would repeat one model four times now, and again for every media kind that is added. +2. **Bounded context isolation**: as specified by DDD, an aggregate does not reference objects of another bounded context, only identifiers placed in `ExternalIdentifiers` directories. A favorites aggregate that held an `Artist`, a `Book` or any other media entity would couple favorites to every media context. +3. **Referential integrity across kinds**: one table cannot declare a foreign key to the tables of several media kinds. A favorite must also outlive the item it references, because a library scan or a manual delete can remove an item, and the owner of the favorite has to be able to see and remove it afterwards instead of the favorite silently disappearing. +4. **Concurrent toggles**: a favorite toggle is rendered on many pages, and a user can have several tabs open, so the same add can arrive twice at nearly the same moment. +5. **Access control**: favoriting an item must not reveal whether an item exists in a library the user cannot access, and listing must not expose the display data of such a library. + +## Decision + +Store favorites as one generic `Favorite` aggregate in `FavoriteBoundedContext`, in one `Favorites` table. The table has a surrogate `FavoriteId` primary key and a unique business key `(UserId, MediaKind, MediaItemId)`. A media item is referenced only by its `FavoriteMediaKind` and the external `MediaItemId`; there is no foreign key to a media table. There are no per-kind favorite aggregates, tables, endpoints or contracts. + +The decision includes these rules: + +- **Add is idempotent.** Adding an item the user already favorited returns the existing favorite and raises no event. +- **Remove is idempotent.** Removing a favorite that is already absent succeeds without changing anything and raises no event. +- **The owner always comes from the authenticated principal.** No route, query or body carries the owner, and no administrator or library-owner override exposes another user's favorites. +- **Access is checked where it can leak.** Adding evaluates the library ownership policy of the item's library. Listing evaluates it for each distinct library in the returned page and hides the display data of inaccessible libraries. Removing and checking the status read only the current user's own favorites, so they evaluate no library policy. +- **Dangling favorites stay visible.** A favorite whose item no longer exists, or whose library is no longer accessible, is returned as an unavailable item with empty display fields so its owner can see and remove it. +- **Reads use the shared pagination contract.** The repository accepts the shared `PaginationDataDto` and returns the shared `PaginatedResultDto`, like every other paginated listing. When the request provides neither `currentPage` nor `perPage`, every matching favorite is returned in a single page; when a page is requested, the page defaults to `1` and the page size defaults to `200`. A page beyond the last one is clamped to the last page, and there is no separate maximum page size. The status check accepts 1 to 100 Ids of one kind per request. + +### Model + +| Element | Decision | +|---|---| +| Aggregate | `Favorite` is the root, with a `FavoriteId`, a `UserId`, a `MediaItemId`, a `FavoriteMediaKind` and the audit columns. It has no entities. The user and the media item are referenced only through the identifier types in the context's `ExternalIdentifiers` directories; the kind is the shared `FavoriteMediaKind` enumeration. The media item identifier is generic across artists, albums, tracks, books and the planned video and photo kinds. | +| Media kind | `FavoriteMediaKind` has `MusicArtist`, `MusicAlbum`, `MusicTrack`, `Book`, `Video` and `Photo`, and it is stored by name. `Favorite.IsSupported` is `true` for the first four, and creating a favorite of the planned `Video` and `Photo` kinds is rejected with the validation error `FavoriteMediaKindIsNotSupported`. A planned kind becomes supported by lifting the restriction, with no change to the storage schema. | +| Domain events | `FavoriteAdded` is raised when a favorite is created, and `FavoriteRemoved` when it is removed. | +| Storage | The `Favorites` table holds the Id, the owner, the media kind, the media item Id and the audit columns. The owner is a foreign key that cascades, so favorites leave with their user. The media item is not a foreign key. | +| Invariant | A unique index on `(UserId, MediaKind, MediaItemId)` makes the storage medium the owner of the rule "one favorite per user and item", and serves the status check that looks up a user's favorites among checked Ids. Indexes on `(UserId, CreatedOnUtc)` and `(UserId, MediaKind, CreatedOnUtc)` serve the listing of every kind and of one kind. | +| Display data | The repository resolves, per kind and with projections that do not materialize the entities, the library Id of an item and the generic display fields of a page of favorites. The display fields are the title, the collection Id and title, the creator Id and name, and the cover path. Each kind fills what it has, and "no value" is the empty Guid or the empty string. Adding a media kind adds one branch to each resolution and one entry to the enumeration, with no new table, endpoint or contract. | + +### Operations + +- **Add**: the handler validates, requires the current user, rejects an unsupported kind, resolves the library of the item, evaluates the library ownership policy and returns the existing favorite without an event when the user already favorited the item. Otherwise it creates the aggregate, inserts it, saves the unit of work, queues the aggregate's events and reads the row back. If the unique index rejects a concurrent add, the handler re-reads the existing favorite and returns it without an event. +- **Remove**: the handler validates, requires the current user and loads the favorite by user, kind and item. A missing favorite is a successful removal with no event. Otherwise it removes the aggregate, deletes the row, saves the unit of work and queues the removal event. A concurrent removal is treated as success; any other concurrency conflict is reported. +- **List**: the repository scopes the query to the current user inside the storage query and returns the paginated listing ordered by the time of favoriting, with the shared pagination metadata. The handler evaluates the library policy once per distinct library in the page and maps a favorite with missing or inaccessible display data to an unavailable item with empty display fields. +- **Status**: the repository scopes the check to the current user and returns the Ids, among the checked ones, that the user favorited. The response carries only those Ids. +- **Errors**: `FavoriteAlreadyExists` remains defined but no operation produces it. `FavoriteNotFound` is used only where a stored favorite cannot be read back; removal of an absent favorite succeeds. `FavoriteMediaKindIsNotSupported` is returned by Add for the planned kinds. + +## Consequences + +### Positive Outcomes + +| Aspect | Benefit | +|---|---| +| One model | Multiple media kinds share one aggregate, one table, four operations and one set of contracts | +| Context isolation | The aggregate holds identifiers only, so favorites depend on no media bounded context and could move to their own service | +| Survives deletion | A favorite is not removed by deleting or rescanning its item, and its owner is shown an unavailable item that can be removed | +| Race safe | The storage unique index, not the existence check alone, guarantees a single favorite per user and item, and a concurrent duplicate add resolves to the existing favorite | +| No existence oracle | An inaccessible item and a missing item are indistinguishable when adding, and inaccessible display data is never listed | +| No schema change for new kinds | The kind is stored by name, so a planned kind only needs its restriction lifted and its two resolutions written | + +### Risks and Mitigations + +| Risk | Mitigation Strategy | +|---|---| +| Without a foreign key, rows can point at items that no longer exist | This is intended: the listing returns such rows as unavailable and removal never needs the item. Nothing relies on the item being present | +| The per-kind resolution is a switch in the repository, so a new kind could be added to the enumeration without a resolution | `GetMediaItemLibraryIdAsync` reports no library for a kind without a branch, so an add of it is reported as not found, and `Favorite.IsSupported` has to be extended together with the branch | +| The listing evaluates the library policy once per distinct library of a page | The policy is evaluated once per distinct library, not once per favorite, so the cost grows with the number of distinct libraries rather than with the number of favorites. A client that needs a bound requests a page size, like every other paginated listing | +| The display projections can drift from how the catalogues show their items | The projections reuse the same sources as the listings of each catalogue, so a change to how a catalogue shows an item has to be mirrored in the matching branch | + +## Alternatives Considered + +### 1. One favorites table and aggregate per media kind + +A `FavoriteArtist`, `FavoriteAlbum`, `FavoriteTrack` and `FavoriteBook` aggregate, each with a real foreign key to its media table. + +**Rejected**: it repeats the same model, endpoints and contracts per kind, and again for every planned kind. The foreign keys would also make the favorite die with its item, which removes the user's ability to see and remove it, and each aggregate would need to reference a media bounded context directly. + +### 2. A flag on each media entity + +An `IsFavorite` column on artists, albums, tracks and books. + +**Rejected**: a favorite is private to a user, and a flag on a shared catalogue row cannot be. A join table per user would be needed anyway, which brings back the first alternative. + +### 3. Reuse the playlist model with a system playlist + +Store favorites as the entries of a special playlist per user. + +**Rejected**: a playlist is an ordered list that allows duplicates and is positioned by the user, while a favorite is an unordered set with exactly one entry per item and a listing ordered by the time of favoriting. The playlist operations, the position keys and the entry limits do not apply, and the favorites of artists, albums and books are not playable entries. + +### 4. Enforce uniqueness only in the handler + +Check for an existing favorite and rely on it, with no unique index. + +**Rejected**: two requests of the same user can both pass the check, so duplicates would be created under concurrency. The storage medium must own the invariant, and the handler's check is kept only to make the common repeated add idempotent without a failure. + +### 5. Return a conflict when an item is already a favorite + +Report `FavoriteAlreadyExists` instead of returning the existing favorite. + +**Rejected**: a toggle rendered on several pages, and several open tabs, make a repeated add a normal event rather than an error. An idempotent add keeps the client simple, since it does not have to distinguish a created favorite from an existing one. `FavoriteAlreadyExists` remains defined in the favorites error set, but no operation produces it. + diff --git a/docs/technical/domain/UbiquitousLanguage.md b/docs/technical/domain/UbiquitousLanguage.md index 89c93228..35b68173 100644 --- a/docs/technical/domain/UbiquitousLanguage.md +++ b/docs/technical/domain/UbiquitousLanguage.md @@ -5,6 +5,8 @@ - _**Metadata**_: Information describing a media item - _**User**_: A person who interacts with the media library - _**Playlist**_: A curated list of media items, potentially cross-media-type +- _**Favorite**_: The marker a user places on a media item of any media kind, private to that user. It references the item only by its kind and its Id, so one concept serves music, books and the media kinds that are planned +- _**FavoriteMediaKind**_: The set of media item kinds that can be marked as a favorite - _**Tag**_: A label for categorizing and organizing media items - _**Collection**_: A user-defined group of any media items - _**File**_: The actual digital file of a media item @@ -95,6 +97,7 @@ - PhotoAlbum - User - Playlist +- Favorite - Collection - SubtitleFile - Lyrics @@ -114,6 +117,7 @@ - PhotoLibrary (root: PhotoLibrary, entities: Photo, PhotoAlbum, AlbumArtwork, MoviePoster) - UserProfile (root: User, entities: Collection) - PlaylistManagement (root: Playlist, entities: PlaylistEntry) +- Favorites (root: Favorite, no entities) - SupplementaryContentLibrary (root: SupplementaryContentLibrary, entities: SubtitleFile, Lyrics, LanguageTrack) - FileSystemManagement (root: File, entities: Stream) @@ -213,6 +217,8 @@ - PlaylistEntryRemoved - PlaylistEntriesReordered - PlaylistDeleted +- FavoriteAdded +- FavoriteRemoved - UserPreferencesChanged - MetadataUpdated - FileTranscoded @@ -229,6 +235,8 @@ - Services: RecommendationEngine, ContentCurationService, UserActivityTrackingService - PlaylistManagement - Aggregates: Playlist +- Favorites + - Aggregates: Favorite - ContentDelivery - Aggregates: FileSystemManagement - Services: StreamingService, ContentSynchronizationService @@ -244,6 +252,7 @@ - PhotoRepository - UserRepository - PlaylistRepository +- FavoriteRepository - CollectionRepository - FileRepository - StreamRepository diff --git a/docs/technical/requests/favorites/AddFavorite.http b/docs/technical/requests/favorites/AddFavorite.http new file mode 100644 index 00000000..fe753ce0 --- /dev/null +++ b/docs/technical/requests/favorites/AddFavorite.http @@ -0,0 +1,8 @@ +POST {{host}}/api/v1/users/me/favorites +Authorization: Bearer {{ACCESS_TOKEN}} +Content-Type: application/json + +{ + "mediaKind": "MusicTrack", + "mediaItemId": "9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f" +} diff --git a/docs/technical/requests/favorites/GetFavoriteStatus.http b/docs/technical/requests/favorites/GetFavoriteStatus.http new file mode 100644 index 00000000..1499123b --- /dev/null +++ b/docs/technical/requests/favorites/GetFavoriteStatus.http @@ -0,0 +1,2 @@ +GET {{host}}/api/v1/users/me/favorites/status?mediaKind=MusicTrack&mediaItemIds=9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f&mediaItemIds=8e9f0a1b-2c3d-4e5f-9a6b-7c8d9e0f1a2b +Authorization: Bearer {{ACCESS_TOKEN}} diff --git a/docs/technical/requests/favorites/GetFavorites.http b/docs/technical/requests/favorites/GetFavorites.http new file mode 100644 index 00000000..8ec7556b --- /dev/null +++ b/docs/technical/requests/favorites/GetFavorites.http @@ -0,0 +1,2 @@ +GET {{host}}/api/v1/users/me/favorites?mediaKind=MusicTrack¤tPage=1&perPage=200 +Authorization: Bearer {{ACCESS_TOKEN}} diff --git a/docs/technical/requests/favorites/RemoveFavorite.http b/docs/technical/requests/favorites/RemoveFavorite.http new file mode 100644 index 00000000..3406d216 --- /dev/null +++ b/docs/technical/requests/favorites/RemoveFavorite.http @@ -0,0 +1,2 @@ +DELETE {{host}}/api/v1/users/me/favorites/MusicTrack/9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f +Authorization: Bearer {{ACCESS_TOKEN}} diff --git a/docs/technical/theming/Theming.md b/docs/technical/theming/Theming.md index 6d0bfb2e..86349502 100644 --- a/docs/technical/theming/Theming.md +++ b/docs/technical/theming/Theming.md @@ -19,6 +19,11 @@ The web client of Lumina is a themed shell: every page is rendered inside the te - [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) + - [The Playlist Pages](#the-playlist-pages) + - [The Shared Add to Playlist Action](#the-shared-add-to-playlist-action) + - [The Album Track Actions Menu](#the-album-track-actions-menu) + - [The Favorites Page](#the-favorites-page) + - [Favorite Toggles](#favorite-toggles) - [The Scripts Section](#the-scripts-section) - [Assets](#assets) - [Configuration Options](#configuration-options) @@ -171,6 +176,7 @@ Known page keys: | `library/written-content-library/book-library/books/index` | The books browsing page. | | `playlists/index` | The page that lists and deletes the playlists of the current user. | | `playlists/item` | The page that creates a playlist, or edits, reorders, plays and deletes an existing playlist of the current user. The `isNew` page data field tells the two modes apart. | +| `favorites/index` | The page that lists, filters and removes the favorites of the current user across media kinds. | | `shared/file-system-browser` | The file system browser component shell. | | `shared/file-system-browser/tree-node` | The tree view node of the file system browser. | | `shared/file-system-browser/explorer-item` | The file system entry of the file system browser. | @@ -523,11 +529,11 @@ Page templates are rendered into a content section that the layout wraps. A page | --- | --- | | `isNew` | `true` on the create page, `false` on the page of an existing playlist. The same page key serves both modes. | | `playlistId` | The Id of the playlist the page shows, or the empty Id on the create page. | -| `playlistJson` | The playlist metadata and only the first window of its ordered entries, serialized as JSON. `entryCount` is the total number of entries. Each entry carries `mediaItemId` and `mediaItemType`, which are generic across media kinds, together with the generic display fields `libraryId`, `collectionId`, `creatorId`, `mediaItemTitle`, `collectionTitle`, `creatorName`, `durationInSeconds` and `coverPath`. For a music entry, the collection is the album and the creator is the artist. On the create page it is an empty music playlist. | -| `entriesWindowSize` | The number of entries in the first window. The page fetches the next windows with `getPlaylistUrl` and the same size. | +| `playlistJson` | The playlist metadata and only the first page of its ordered entries, serialized as JSON. `entries.count` is the total number of entries, and `entries.currentPage`, `entries.perPage` and `entries.numberOfPages` describe the page. Each entry carries `mediaItemId` and `mediaItemType`, which are generic across media kinds, together with the generic display fields `libraryId`, `collectionId`, `creatorId`, `mediaItemTitle`, `collectionTitle`, `creatorName`, `durationInSeconds` and `coverPath`. For a music entry, the collection is the album and the creator is the artist. On the create page it is an empty music playlist. | +| `entriesPerPage` | The number of entries per page the page requests. The page fetches the next pages with `getPlaylistUrl` and the same size. | | `createPlaylistUrl` | The route that creates a playlist. Only meaningful when `isNew` is `true`. | | `itemUrl` | The route template of the page of an existing playlist. The trailing `00000000-0000-0000-0000-000000000000` is replaced by the Id of the playlist, and the page script navigates to it after a successful create. | -| `getPlaylistUrl` | The route that returns a window of the playlist. It takes `offset` and `limit` query parameters and returns `entryCount` with the window. The limit is a response-window bound of at most 1000 entries, not a cap on the playlist size. | +| `getPlaylistUrl` | The route that returns a page of the playlist. It takes `currentPage` and `perPage` query parameters and returns `entries` with `data`, `currentPage`, `perPage`, `count` and `numberOfPages`. When both pagination parameters are omitted, every entry is returned in one page. The `perPage` is the page size the theme requests. | | `updatePlaylistUrl` | The route that updates the name and description of the playlist. | | `deletePlaylistUrl` | The route that deletes the playlist. | | `addEntryUrl` | The route that adds a track to the playlist. | @@ -543,7 +549,7 @@ Page templates are rendered into a content section that the layout wraps. A page The fallback views keep these element hooks, which the application script drives: on the list page, `playlists-container`, `no-playlists` and `playlist-count`; on the item page, `playlist-details-form`, `playlist-title`, `playlist-name-input`, `playlist-description-input`, `save-playlist-button`, `cancel-playlist-button`, `play-playlist-button`, `delete-playlist-button`, `playlist-entries`, `no-tracks`, `load-more-entries-button`, `playlist-library-combobox`, `playlist-artist-combobox`, `playlist-album-combobox`, `playlist-track-combobox`, `add-track-button` and `no-music-libraries`. The four track picker controls are standard application combo boxes, not native `select` elements. A theme that restructures a page must keep the hooks the page script needs for that page. -The playlist rows use the same play affordance contract as the music pages: an element with `data-audio-player-play` and the `data-track-id`, `data-library-id`, `data-album-id`, `data-artist-id`, `data-title`, `data-album-title`, `data-duration` and `data-cover-art-path` attributes is handed to the global player by event delegation. The page fills `data-track-id` from the entry `mediaItemId`, because a music entry references a track. The Play playlist control fetches every window of the playlist in order, builds an explicit queue from the playable entries and starts it through the player control API, so a theme template must keep the `play-playlist-button` hook for that control. +The playlist rows use the same play affordance contract as the music pages: an element with `data-audio-player-play` and the `data-track-id`, `data-library-id`, `data-album-id`, `data-artist-id`, `data-title`, `data-album-title`, `data-duration` and `data-cover-art-path` attributes is handed to the global player by event delegation. The page fills `data-track-id` from the entry `mediaItemId`, because a music entry references a track. The Play playlist control fetches every page of the playlist in order, builds an explicit queue from the playable entries and starts it through the player control API, so a theme template must keep the `play-playlist-button` hook for that control. The playlist rows are reordered by dragging the handle with the `playlist-entry-drag-handle` class, and the row carries the `is-dragging` class while it is being dragged. The up and down controls remain available for keyboard and touch users, and the page uses the `playlist-entry-move-up`, `playlist-entry-move-down` and `playlist-entry-remove` classes to disable them while an entry mutation is in flight. A theme template that changes the row structure must keep the `playlist-entry` class and the `data-entry-id` attribute on the row, so the page script can find the row and commit its new position. @@ -569,6 +575,82 @@ The player queue action does not use `addToPlaylistLabel`. Its label comes from Every rendered track row of the album details page carries the same `card-actions-trigger` button with the vertical dots as the card menus, plus the `track-actions-trigger` class that places it inline in the row. The page script creates the same `card-actions-menu` markup on demand. The menu has three application actions: `card-action-add-to-playlist` opens the shared add-to-playlist dialog for that track, `card-action-add-to-queue` calls `window.LuminaAudioPlayer.instance.appendToQueueAsync(descriptor)`, and `card-action-play-all-from-here` calls `playAsync` with an explicit queue built from the clicked track and every track that follows it in the album order. The player starts the clicked track for the last action, and replaces the queue. A theme that renders the album page must keep the track row markup and the script behavior, or provide its own equivalent. +#### The Favorites Page + +`favorites/index` receives a model with the following fields: + +| Field | Content | +| --- | --- | +| `getFavoritesUrl` | The route that returns a page of the favorites of the current user. It takes the optional `mediaKind`, `currentPage` and `perPage` query parameters, and returns `data`, `currentPage`, `perPage`, `count` and `numberOfPages`. When both pagination parameters are omitted, every matching favorite is returned in one page. The `perPage` is the page size the theme requests; the server has no separate maximum page size, like every other paginated collection of the API. | +| `getFavoriteStatusUrl` | The route that tells which of a list of media items of one kind are favorites of the current user. It takes the `mediaKind` query parameter and one `mediaItemIds` parameter per Id, with at most 100 Ids. | +| `addFavoriteUrl` | The route that marks a media item as a favorite. The body carries `mediaKind` and `mediaItemId`. | +| `removeFavoriteUrl` | The route template that removes a favorite. Its named `{mediaKind}` and `{mediaItemId}` placeholders are replaced by the media kind name and the Id of the media item. | +| `artistUrl` | The route template of an artist page. The trailing `00000000-0000-0000-0000-000000000000` is replaced by the Id of the artist. | +| `albumUrl` | The route template of an album page. The two `00000000-0000-0000-0000-000000000000` segments are replaced, in order, by the Ids of the artist and the album. | +| `trackUrl` | The route template of a track page. The three `00000000-0000-0000-0000-000000000000` segments are replaced, in order, by the Ids of the artist, the album and the track. | +| `bookUrl` | The route template of a book page. The trailing `00000000-0000-0000-0000-000000000000` is replaced by the Id of the book. | +| `antiforgeryToken` | The anti-forgery token the page submits with its mutating requests. | +| `strings` | The localized strings of the page, keyed by their resource names. | + +The pages of the media items read the library of the item from the `libraryId` query parameter, so the page script appends `libraryId` to the link of an item from the `libraryId` of the favorite. The link of a track needs the artist and the album of the item, which are the `creatorId` and the `collectionId` of the favorite. An item of the response with `isAvailable` set to `false` has no library and no display fields, so the page shows it as an unavailable item, without a link, and keeps its heart so the favorite can still be removed. The generic display fields of an item are `title`, `collectionTitle`, `creatorName` and `coverPath`; for a track the collection is the album and the creator is the artist, for an album the creator is the artist, for a book the creator is its first author, and for an artist there is neither. The series of a book is not catalogued yet, so a book has no collection. + +The fallback view keeps these element hooks, which the application script drives: `favorites-container`, `no-favorites`, `favorite-count`, `favorites-kind-filter`, `load-more-favorites-button` and `retry-favorites-button`. The bundled themes ship no template for `favorites/index`, so the fallback view is what a healthy site shows, and a theme that wants its own page provides `templates/favorites/index.html` and must keep the hooks the page script needs. + +The fallback view renders one card per favorite, from the most recently favorited, in pages of 50 that `load-more-favorites-button` extends. Each card carries a favorite heart (a `card-favorite-toggle` button, described below), already in the favorited state, and a favorite is removed from the page by unfavoriting its card: the page script does not call the remove route itself, the global favorites script does, and the page listens to the `lumina:favorite-changed` event described below, removes the card of an item that is no longer a favorite, and updates the counter and the empty state without another request. A failed first page or reload clears the rendered cards and shows the localized failure message with `retry-favorites-button`, so the user can load the current filter again instead of being left with a truncated list. A theme template that renders the page itself gets the same behavior by rendering hearts on its cards and handling that event. + +#### Favorite Toggles + +A favorite toggle is the heart of a media card or of a track row. It is rendered by a page or by a theme template, and it is driven entirely by the global script `wwwroot/js/favorites.js`, which every layout loads next to `playlists.js`. The script binds one click listener and one mutation observer on the document, so a toggle works anywhere in the swapped page content, including toggles that a page script adds later, and a page needs no script of its own. A theme owns the look of the toggle, and the script never renders markup: it only writes the attributes, the class and the texts described below. + +A toggle is any focusable element, normally a `button`, that carries these attributes: + +| Attribute | Meaning | +| --- | --- | +| `data-favorite-toggle` | Required. Marks the element as a favorite toggle. | +| `data-favorite-media-kind` | Required. The media kind of the item: `MusicArtist`, `MusicAlbum`, `MusicTrack` or `Book`. The name is matched case insensitively. The planned kinds `Video` and `Photo` cannot be favorited yet, so a toggle that carries one stays in the `failed` state. | +| `data-favorite-media-item-id` | Required. The Id of the media item. An empty or malformed Id leaves the toggle in the `failed` state. | + +The script reads which items the current user favorited with `getFavoriteStatusUrl` and writes the result on the toggle. It collects the toggles of a tick and sends one status request per kind, deduplicates the Ids, and splits the Ids of a kind into requests of at most 100, so a page that renders many toggles costs few requests. The script writes these on the element: + +| Written on the toggle | Meaning | +| --- | --- | +| `aria-pressed` | `true` when the item is a favorite, `false` otherwise. It keeps the previous value while a request is in flight. | +| `data-favorite-state` | `favorited` or `not-favorited` when the state is known, `loading` while the state is read or a change is in flight, and `failed` when the state could not be read or the attributes are invalid. | +| `is-favorite` class | Present exactly when the item is a favorite. | +| `aria-busy` | `true` only while the state is loading or a change is in flight. | +| `aria-label` | The localized name of the action the next click performs: the `remove` string when the item is a favorite, the `add` string otherwise. | +| `title` | The same localized text as the `aria-label`. It is the hover text of a heart, which has no visible text. | +| The text of `.favorite-toggle-label` | When the toggle contains an element with the `favorite-toggle-label` class, the same localized text as the `aria-label`. The bundled themes and the application views render no such element. | + +A theme restyles a toggle from the `is-favorite` class or from the `aria-pressed` and `data-favorite-state` attributes. Until the first state arrives the toggle shows `loading`, so a theme should not style a toggle that has no state yet as pressed. + +A click on a toggle adds the favorite when the item is not one, and removes it otherwise, through the add and remove routes of the configuration. A click is ignored while a request for the same item is in flight, whichever toggle of the item it comes from, and a click on a toggle whose state is unknown reads the state again instead of guessing. The script keeps every toggle of the same item on the page in sync. When a change fails, every toggle returns to the state it had, and the global API helper shows the failure as a notification. When a state read fails, the global API helper shows the failure as a notification. The click handler prevents the default action, so a toggle inside a link or a card does not also navigate. + +After every successful change the script dispatches the `lumina:favorite-changed` event on `document`, with `detail` carrying `mediaKind` (the canonical kind name), `mediaItemId` (the lowercase Id) and `isFavorite` (the new state), so a page that lists favorites can react while it stays decoupled from the toggle that caused the change. + +The layout provides the shared configuration as `window.favoritesConfiguration`: + +| Field | Content | +| --- | --- | +| `getFavoriteStatusUrl` | The route that tells which of the checked media items are favorites. | +| `addFavoriteUrl` | The route that marks a media item as a favorite. The body carries `mediaKind` and `mediaItemId`. | +| `removeFavoriteUrlTemplate` | The route template that removes a favorite. Its named `{mediaKind}` and `{mediaItemId}` placeholders are replaced by the media kind name and the Id of the media item. | +| `strings` | The localized labels: `add` and `remove`. | + +The script also exposes `window.LuminaFavorites` for page scripts that need more than the markup contract: + +| Member | Behavior | +| --- | --- | +| `hydrate(rootElement)` | Reads the state of the toggles inside the element, the whole document by default, and writes it on them. It never rejects. The script already hydrates the toggles of the page and the ones added to it, so this is only needed for toggles in an element that is not attached to the document. | +| `isFavorite(mediaKind, mediaItemId)` | Returns a promise of whether the item is a favorite. The answer always comes from the server, and the check is batched with the others of the same tick. It rejects when the kind or the Id is invalid, or when the request failed. | +| `setFavoriteAsync(mediaKind, mediaItemId, shouldFavorite)` | Adds or removes the favorite, with the same in-flight rule, synchronization and failure notification from the global API helper as a click, and returns a promise of whether the item now has the requested state. A call for an item that is already being changed returns the running change when it asks for the same state, and `false` otherwise. | + +The hearts are rendered on the cards of the books list, of the artists list and of the albums on the artist page (the kinds `Book`, `MusicArtist` and `MusicAlbum`), on the cards of the favorites page, and on the rows of the track table of the album page (the kind `MusicTrack`, after the duration). The detail pages of an artist, an album, a track and a book render no toggle. The audio player bar and the playlist rows have none either, so a theme should not assume they exist. + +A card heart is a plain `button` with the `card-favorite-toggle` class, with the three data attributes and nothing else, appended to the `media-card` element as a sibling of the `media-panel` link and of the `card-actions-trigger`. The stylesheet draws the heart with `::after`, like the dots of the actions trigger. The heart has the box of the actions trigger, sits immediately on its left, is shown on hover, while the actions menu of the card is open, and while any control of the card has the focus, shows the heart in the blue of the trigger, and shows it in red when the item is a favorite (`aria-pressed="true"` or the `is-favorite` class). A heart in the `loading` state is dimmed, and one in the `failed` state has an error border. A `media-card` that has no `card-actions-trigger`, like the cards of the favorites page, gets the heart in the place of the trigger, always visible so that it stays reachable by keyboard and on touch screens. A track row heart is a `button` with the `card-favorite-toggle track-favorite-toggle` classes inside a `td` with the `track-favorite-cell` class that follows the duration cell, and the `colgroup` of the table gets a `col` with the `track-favorite-column` class after the duration column. It is static, always visible and centered, like the actions trigger of the row. The hover text of every heart is the `title` that the script writes. + +The bundled themes render the hearts on those cards and rows, and carry the card rules in their `assets/site.css`; the rules of the track row and of its columns are in the application stylesheet, `wwwroot/css/site.css`, which every page loads. The application fallback views render the same hearts. A custom theme that replaces one of these templates must render the hearts again to keep favoriting reachable from that page. + ### The Scripts Section JavaScript is always allowed in themes: script elements in templates are served and rendered as-is, and script files under `assets/` are served normally. A theme relies on scripts for the client side navigation of the application, because pages are swapped in place by the global AJAX navigator, so themes are expected to ship their own JavaScript. Because JavaScript is enabled, *themes can execute malicious code*, so, be aware about the source of your installed themes! Themes bundled with the application are reviewed and safe. diff --git a/src/Lumina.Application/Common/DTO/Favorites/FavoriteItemDisplayDto.cs b/src/Lumina.Application/Common/DTO/Favorites/FavoriteItemDisplayDto.cs new file mode 100644 index 00000000..09519a0a --- /dev/null +++ b/src/Lumina.Application/Common/DTO/Favorites/FavoriteItemDisplayDto.cs @@ -0,0 +1,33 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Application.Common.DTO.Favorites; + +/// +/// Data transfer object for the generic display data of a favorited media item. +/// +/// +/// For a music artist the title is the artist name and there is no collection or creator. For a music album the title is the album title, +/// there is no collection, and the creator is the artist. For a music track the title is the track title, the collection is the album and +/// the creator is the artist. For a book the title is the book title, there is no collection yet because the series of a book is not catalogued, and the creator is its +/// first author. +/// +/// The Id of the media library that contains the media item. +/// The title of the media item. +/// The Id of the collection that contains the media item, or an empty Guid when there is none. +/// The title of the collection that contains the media item, or an empty string when there is none. +/// The Id of the creator of the media item, or an empty Guid when there is none. +/// The name of the creator of the media item, or an empty string when there is none. +/// The path of the cover art of the media item, if available. +[DebuggerDisplay("LibraryId: {LibraryId}; Title: {Title}")] +public sealed record FavoriteItemDisplayDto( + Guid LibraryId, + string Title, + Guid CollectionId, + string CollectionTitle, + Guid CreatorId, + string CreatorName, + string? CoverPath +); diff --git a/src/Lumina.Application/Common/DTO/Favorites/FavoriteItemDto.cs b/src/Lumina.Application/Common/DTO/Favorites/FavoriteItemDto.cs new file mode 100644 index 00000000..d34c46db --- /dev/null +++ b/src/Lumina.Application/Common/DTO/Favorites/FavoriteItemDto.cs @@ -0,0 +1,17 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.DataAccess.Entities.Favorites; +using System.Diagnostics; +#endregion + +namespace Lumina.Application.Common.DTO.Favorites; + +/// +/// Data transfer object for a stored favorite together with the display data of the media item it references. +/// +/// The stored favorite. +/// The display data of the referenced media item, or when it no longer exists. +[DebuggerDisplay("Id: {Favorite.Id}; MediaKind: {Favorite.MediaKind}")] +public sealed record FavoriteItemDto( + FavoriteEntity Favorite, + FavoriteItemDisplayDto? Display +); diff --git a/src/Lumina.Application/Common/DTO/Playlists/PlaylistDetailsDto.cs b/src/Lumina.Application/Common/DTO/Playlists/PlaylistDetailsDto.cs index 9604b553..5661bbdc 100644 --- a/src/Lumina.Application/Common/DTO/Playlists/PlaylistDetailsDto.cs +++ b/src/Lumina.Application/Common/DTO/Playlists/PlaylistDetailsDto.cs @@ -1,16 +1,18 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Application.Common.DataAccess.Entities.Playlists; -using System.Collections.Generic; +using Lumina.Application.Common.DTO.Pagination; +using System.Diagnostics; #endregion namespace Lumina.Application.Common.DTO.Playlists; /// -/// A stored playlist together with a window of its entries and their display data. +/// Data transfer object for a stored playlist together with a page of its entries and their display data. /// /// The stored playlist. -/// The requested window of entries. +/// The requested page of entries. +[DebuggerDisplay("PlaylistId: {Playlist.Id}; Name: {Playlist.Name}; Entries: {Entries.Count}")] public sealed record PlaylistDetailsDto( PlaylistEntity Playlist, - IReadOnlyList Entries + PaginatedResultDto Entries ); diff --git a/src/Lumina.Application/Common/DTO/Playlists/PlaylistEntryDisplayDto.cs b/src/Lumina.Application/Common/DTO/Playlists/PlaylistEntryDisplayDto.cs index d866ac25..b9cea7a7 100644 --- a/src/Lumina.Application/Common/DTO/Playlists/PlaylistEntryDisplayDto.cs +++ b/src/Lumina.Application/Common/DTO/Playlists/PlaylistEntryDisplayDto.cs @@ -1,11 +1,12 @@ #region ========================================================================= USING ===================================================================================== using System; +using System.Diagnostics; #endregion namespace Lumina.Application.Common.DTO.Playlists; /// -/// Display data of the media item referenced by a playlist entry, together with its collection and creator. +/// Data transfer object for the display data of the media item referenced by a playlist entry, together with its collection and creator. /// /// The Id of the track. /// The title of the track. @@ -16,6 +17,7 @@ namespace Lumina.Application.Common.DTO.Playlists; /// The Id of the artist that produced the track. /// The name of the artist that produced the track. /// The path of the cover art of the album, if available. +[DebuggerDisplay("TrackId: {TrackId}; TrackTitle: {TrackTitle}")] public sealed record PlaylistEntryDisplayDto( Guid TrackId, string TrackTitle, diff --git a/src/Lumina.Application/Common/DTO/Playlists/PlaylistEntryDto.cs b/src/Lumina.Application/Common/DTO/Playlists/PlaylistEntryDto.cs index e74dd3a6..4ebc9410 100644 --- a/src/Lumina.Application/Common/DTO/Playlists/PlaylistEntryDto.cs +++ b/src/Lumina.Application/Common/DTO/Playlists/PlaylistEntryDto.cs @@ -1,15 +1,17 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Application.Common.DataAccess.Entities.Playlists; +using System.Diagnostics; #endregion namespace Lumina.Application.Common.DTO.Playlists; /// -/// A stored playlist entry together with the display data of the media item it references and its dense display position. +/// Data transfer object for a stored playlist entry together with the display data of the media item it references and its dense display position. /// /// The stored entry. /// The display data of the referenced media item, or when it no longer exists. /// The dense zero based position shown to the client. +[DebuggerDisplay("EntryId: {Entry.Id}; MediaItemId: {Entry.MediaItemId}; Position: {DisplayPosition}")] public sealed record PlaylistEntryDto( PlaylistEntryEntity Entry, PlaylistEntryDisplayDto? Display, diff --git a/src/Lumina.Application/Common/DTO/Playlists/PlaylistSummaryDto.cs b/src/Lumina.Application/Common/DTO/Playlists/PlaylistSummaryDto.cs index 8ee7901c..f5eaa70c 100644 --- a/src/Lumina.Application/Common/DTO/Playlists/PlaylistSummaryDto.cs +++ b/src/Lumina.Application/Common/DTO/Playlists/PlaylistSummaryDto.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Domain.SharedKernel.Common.Enums.Playlists; using System; +using System.Diagnostics; #endregion namespace Lumina.Application.Common.DTO.Playlists; @@ -15,6 +16,7 @@ namespace Lumina.Application.Common.DTO.Playlists; /// The number of entries of the playlist. /// The date and time when the playlist was created. /// The date and time when the playlist was last updated, if applicable. +[DebuggerDisplay("Id: {Id}; Name: {Name}; EntryCount: {EntryCount}")] public sealed record PlaylistSummaryDto( Guid Id, string Name, diff --git a/src/Lumina.Application/Common/DataAccess/Entities/Favorites/FavoriteEntity.cs b/src/Lumina.Application/Common/DataAccess/Entities/Favorites/FavoriteEntity.cs new file mode 100644 index 00000000..a529eff0 --- /dev/null +++ b/src/Lumina.Application/Common/DataAccess/Entities/Favorites/FavoriteEntity.cs @@ -0,0 +1,59 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.DataAccess.Entities.Common; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Application.Common.DataAccess.Entities.Favorites; + +/// +/// Repository entity for a favorite - the marker of a user on a media item of any media kind. +/// +/// +/// The favorite references the media item by its kind and its Id, without a foreign key, so the same table serves every media context and a +/// favorite survives the deletion of the item it references, so its owner can still see and remove it. +/// +[DebuggerDisplay("Id: {Id}; MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")] +public class FavoriteEntity : IStorageEntity, IAuditableEntity +{ + /// + /// Gets the Id of the favorite. + /// + public required Guid Id { get; init; } + + /// + /// Gets or sets the Id of the user that owns the favorite. + /// + public required Guid UserId { get; set; } + + /// + /// Gets or sets the kind of the favorited media item. + /// + public required FavoriteMediaKind MediaKind { get; set; } + + /// + /// Gets or sets the Id of the favorited media item. + /// + public required Guid MediaItemId { get; set; } + + /// + /// Gets or sets the time and date when the entity was added. + /// + public required DateTime CreatedOnUtc { get; set; } + + /// + /// Gets or sets the Id of the user that created the entity. + /// + public required Guid CreatedBy { get; set; } + + /// + /// Gets or sets the optional time and date when the entity was updated. + /// + public DateTime? UpdatedOnUtc { get; set; } + + /// + /// Gets or sets the optional Id of the user that updated the entity. + /// + public required Guid? UpdatedBy { get; set; } +} diff --git a/src/Lumina.Application/Common/DataAccess/Repositories/Favorites/IFavoriteRepository.cs b/src/Lumina.Application/Common/DataAccess/Repositories/Favorites/IFavoriteRepository.cs new file mode 100644 index 00000000..966cf241 --- /dev/null +++ b/src/Lumina.Application/Common/DataAccess/Repositories/Favorites/IFavoriteRepository.cs @@ -0,0 +1,70 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.DataAccess.Entities.Favorites; +using Lumina.Application.Common.DataAccess.Repositories.Common.Actions; +using Lumina.Application.Common.DataAccess.Repositories.Common.Base; +using Lumina.Application.Common.DTO.Favorites; +using Lumina.Application.Common.DTO.Pagination; +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Application.Common.DataAccess.Repositories.Favorites; + +/// +/// Interface for the repository for favorites. +/// +public interface IFavoriteRepository : IRepository, + IInsertRepositoryAction, + IDeleteByIdRepositoryAction +{ + /// + /// Gets the favorite of the user identified by on the media item identified by and , if it exists. + /// + /// The Id of the user the favorite must belong to. + /// The kind of the favorited media item. + /// The Id of the favorited media item. + /// Whether the retrieved entity should be tracked by the persistence medium, so that changes to it can be saved. + /// Cancellation token that can be used to stop the execution. + /// + /// An containing either the favorite, when the user has not favorited the media item, or an error. + /// + Task> GetByMediaItemIdForUserAsync(Guid userId, FavoriteMediaKind mediaKind, Guid mediaItemId, bool shouldTrackEntities = true, CancellationToken cancellationToken = default); + + /// + /// Gets the Id of the media library that contains the media item identified by and , if the media item exists. + /// + /// The kind of the media item. + /// The Id of the media item. + /// Cancellation token that can be used to stop the execution. + /// + /// An containing either the Id of the library that contains the media item, when the + /// media item does not exist or its kind has no catalogued library yet, or an error. + /// + Task> GetMediaItemLibraryIdAsync(FavoriteMediaKind mediaKind, Guid mediaItemId, CancellationToken cancellationToken); + + /// + /// Gets the paginated favorites of the user identified by , together with the display data of the media items they reference, + /// or all the matching favorites when the pagination data is . + /// + /// The Id of the user whose favorites are retrieved. + /// The kind of media item to restrict the favorites to, or for every kind. + /// The pagination data that includes the current page and the number of items per page to retrieve. If , all matching favorites are returned. + /// Whether the retrieved entities should be tracked by the persistence medium, so that changes to them can be saved. Pass for read-only scenarios, to avoid the tracking overhead. + /// Cancellation token that can be used to stop the execution. + /// An containing either a , or an error. + Task>> GetAllForUserAsync(Guid userId, FavoriteMediaKind? mediaKind, PaginationDataDto? paginationData = null, bool shouldTrackEntities = false, CancellationToken cancellationToken = default); + + /// + /// Gets the Ids, among , of the media items of kind that the user identified by has favorited. + /// + /// The Id of the user whose favorites are checked. + /// The kind of the media items. + /// The Ids of the media items to check. + /// Cancellation token that can be used to stop the execution. + /// An containing either the subset of the Ids that are favorites of the user, or an error. + Task>> GetFavoritedMediaItemIdsForUserAsync(Guid userId, FavoriteMediaKind mediaKind, IReadOnlyCollection mediaItemIds, CancellationToken cancellationToken); +} diff --git a/src/Lumina.Application/Common/DataAccess/Repositories/Playlists/IPlaylistRepository.cs b/src/Lumina.Application/Common/DataAccess/Repositories/Playlists/IPlaylistRepository.cs index 4d4ad251..20e2401d 100644 --- a/src/Lumina.Application/Common/DataAccess/Repositories/Playlists/IPlaylistRepository.cs +++ b/src/Lumina.Application/Common/DataAccess/Repositories/Playlists/IPlaylistRepository.cs @@ -2,6 +2,7 @@ using Lumina.Application.Common.DataAccess.Entities.Playlists; using Lumina.Application.Common.DataAccess.Repositories.Common.Actions; using Lumina.Application.Common.DataAccess.Repositories.Common.Base; +using Lumina.Application.Common.DTO.Pagination; using Lumina.Application.Common.DTO.Playlists; using Lumina.Domain.Common.Primitives; using Lumina.Domain.SharedKernel.Common.Enums.Playlists; @@ -44,16 +45,17 @@ public interface IPlaylistRepository : IRepository, Task>> GetAllForUserAsync(Guid userId, CancellationToken cancellationToken); /// - /// Gets the playlist identified by together with the display details of the media items its entries reference, - /// when the playlist belongs to the user identified by . + /// Gets the playlist identified by together with a page of the display details of the media items its entries reference, + /// when the playlist belongs to the user identified by , or all the entries when the pagination data is . /// /// The Id of the playlist to get. /// The Id of the user the playlist must belong to. + /// The pagination data that includes the current page and the number of items per page to retrieve. If , all matching entries are returned. /// Cancellation token that can be used to stop the execution. /// /// An containing either the playlist details, when no such playlist exists, or an error. /// - Task> GetDetailsForUserAsync(Guid id, Guid userId, int offset, int limit, CancellationToken cancellationToken); + Task> GetDetailsForUserAsync(Guid id, Guid userId, PaginationDataDto? paginationData = null, CancellationToken cancellationToken = default); /// /// Appends a batch of media items of one kind to the end of the ordered entries of a playlist of the user identified by diff --git a/src/Lumina.Application/Common/DataAccess/UoW/IUnitOfWork.cs b/src/Lumina.Application/Common/DataAccess/UoW/IUnitOfWork.cs index 379ee478..13b7acda 100644 --- a/src/Lumina.Application/Common/DataAccess/UoW/IUnitOfWork.cs +++ b/src/Lumina.Application/Common/DataAccess/UoW/IUnitOfWork.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Application.Common.DataAccess.Repositories.Authorization; using Lumina.Application.Common.DataAccess.Repositories.BookLibrary; +using Lumina.Application.Common.DataAccess.Repositories.Favorites; using Lumina.Application.Common.DataAccess.Repositories.MediaContributors; using Lumina.Application.Common.DataAccess.Repositories.MediaLibrary; using Lumina.Application.Common.DataAccess.Repositories.MusicLibrary; @@ -161,6 +162,11 @@ public interface IUnitOfWork /// IPlaylistRepository PlaylistRepository { get; } + /// + /// Gets the favorite repository. + /// + IFavoriteRepository FavoriteRepository { get; } + /// /// Saves the changes made to the database. /// diff --git a/src/Lumina.Application/Common/Mapping/Favorites/AddFavoriteRequestMapping.cs b/src/Lumina.Application/Common/Mapping/Favorites/AddFavoriteRequestMapping.cs new file mode 100644 index 00000000..50a47702 --- /dev/null +++ b/src/Lumina.Application/Common/Mapping/Favorites/AddFavoriteRequestMapping.cs @@ -0,0 +1,22 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Core.Favorites.Commands.AddFavorite; +using Lumina.Contracts.Requests.Favorites; +#endregion + +namespace Lumina.Application.Common.Mapping.Favorites; + +/// +/// Extension methods for converting . +/// +public static class AddFavoriteRequestMapping +{ + /// + /// Converts to . + /// + /// The request to be converted. + /// The converted command. + public static AddFavoriteCommand ToCommand(this AddFavoriteRequest request) + { + return new AddFavoriteCommand(request.MediaKind, request.MediaItemId); + } +} diff --git a/src/Lumina.Application/Common/Mapping/Favorites/FavoriteEntityMapping.cs b/src/Lumina.Application/Common/Mapping/Favorites/FavoriteEntityMapping.cs new file mode 100644 index 00000000..a368a0fe --- /dev/null +++ b/src/Lumina.Application/Common/Mapping/Favorites/FavoriteEntityMapping.cs @@ -0,0 +1,50 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.DataAccess.Entities.Favorites; +using Lumina.Contracts.Responses.Favorites; +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.ExternalIdentifiers.MediaLibraryBoundedContext.MediaItemAggregate; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.ExternalIdentifiers.UserManagementBoundedContext.UserAggregate; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate.ValueObjects; +using System; +#endregion + +namespace Lumina.Application.Common.Mapping.Favorites; + +/// +/// Extension methods for converting . +/// +public static class FavoriteEntityMapping +{ + /// + /// Converts to . + /// + /// The repository entity to be converted. + /// + /// An containing either a successfully converted , or an error message. + /// + public static Result ToDomainEntity(this FavoriteEntity repositoryEntity) + { + return Favorite.Create( + FavoriteId.Create(repositoryEntity.Id), + UserId.Create(repositoryEntity.UserId), + MediaItemId.Create(repositoryEntity.MediaItemId), + repositoryEntity.MediaKind, + repositoryEntity.CreatedOnUtc, + Optional.FromNullable(repositoryEntity.UpdatedOnUtc)); + } + + /// + /// Converts to . + /// + /// The repository entity to be converted. + /// The converted response. + public static FavoriteResponse ToResponse(this FavoriteEntity repositoryEntity) + { + return new FavoriteResponse( + repositoryEntity.Id, + repositoryEntity.MediaKind, + repositoryEntity.MediaItemId, + repositoryEntity.CreatedOnUtc); + } +} diff --git a/src/Lumina.Application/Common/Mapping/Favorites/FavoriteItemDtoMapping.cs b/src/Lumina.Application/Common/Mapping/Favorites/FavoriteItemDtoMapping.cs new file mode 100644 index 00000000..829110ba --- /dev/null +++ b/src/Lumina.Application/Common/Mapping/Favorites/FavoriteItemDtoMapping.cs @@ -0,0 +1,67 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.DTO.Favorites; +using Lumina.Application.Common.DTO.Pagination; +using Lumina.Contracts.Responses.Common; +using Lumina.Contracts.Responses.Favorites; +using System; +using System.Linq; +#endregion + +namespace Lumina.Application.Common.Mapping.Favorites; + +/// +/// Extension methods for converting . +/// +public static class FavoriteItemDtoMapping +{ + /// + /// Converts to . + /// + /// The favorite data to be converted. + /// The converted response, flagged as not available with empty display fields when the display data is missing. + public static FavoriteItemResponse ToResponse(this FavoriteItemDto data) + { + if (data.Display is null) + return new FavoriteItemResponse( + data.Favorite.MediaKind, + data.Favorite.MediaItemId, + false, + Guid.Empty, + string.Empty, + Guid.Empty, + string.Empty, + Guid.Empty, + string.Empty, + null); + + FavoriteItemDisplayDto display = data.Display; + return new FavoriteItemResponse( + data.Favorite.MediaKind, + data.Favorite.MediaItemId, + true, + display.LibraryId, + display.Title, + display.CollectionId, + display.CollectionTitle, + display.CreatorId, + display.CreatorName, + display.CoverPath); + } + + /// + /// Converts to a paginated collection of . + /// + /// The paginated favorite data to be converted. + /// The converted paginated responses. + public static PaginatedResponse ToResponses(this PaginatedResultDto data) + { + return new PaginatedResponse + { + Data = [.. data.Data.Select(item => item.ToResponse())], + CurrentPage = data.CurrentPage, + PerPage = data.PerPage, + Count = data.Count, + NumberOfPages = data.NumberOfPages + }; + } +} diff --git a/src/Lumina.Application/Common/Mapping/Favorites/FavoriteMapping.cs b/src/Lumina.Application/Common/Mapping/Favorites/FavoriteMapping.cs new file mode 100644 index 00000000..66500db4 --- /dev/null +++ b/src/Lumina.Application/Common/Mapping/Favorites/FavoriteMapping.cs @@ -0,0 +1,33 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.DataAccess.Entities.Favorites; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate; +using System; +#endregion + +namespace Lumina.Application.Common.Mapping.Favorites; + +/// +/// Extension methods for converting . +/// +public static class FavoriteMapping +{ + /// + /// Converts to . + /// + /// The domain entity to be converted. + /// The converted repository entity. + public static FavoriteEntity ToRepositoryEntity(this Favorite domainEntity) + { + return new FavoriteEntity + { + Id = domainEntity.Id.Value, + UserId = domainEntity.UserId.Value, + MediaKind = domainEntity.MediaKind, + MediaItemId = domainEntity.MediaItemId.Value, + CreatedOnUtc = domainEntity.CreatedOnUtc, + CreatedBy = Guid.Empty, + UpdatedOnUtc = domainEntity.UpdatedOnUtc.HasValue ? domainEntity.UpdatedOnUtc.Value : null, + UpdatedBy = null + }; + } +} diff --git a/src/Lumina.Application/Common/Mapping/Favorites/GetFavoriteStatusRequestMapping.cs b/src/Lumina.Application/Common/Mapping/Favorites/GetFavoriteStatusRequestMapping.cs new file mode 100644 index 00000000..c855c6d6 --- /dev/null +++ b/src/Lumina.Application/Common/Mapping/Favorites/GetFavoriteStatusRequestMapping.cs @@ -0,0 +1,22 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Core.Favorites.Queries.GetFavoriteStatus; +using Lumina.Contracts.Requests.Favorites; +#endregion + +namespace Lumina.Application.Common.Mapping.Favorites; + +/// +/// Extension methods for converting . +/// +public static class GetFavoriteStatusRequestMapping +{ + /// + /// Converts to . + /// + /// The request to be converted. + /// The converted query. + public static GetFavoriteStatusQuery ToQuery(this GetFavoriteStatusRequest request) + { + return new GetFavoriteStatusQuery(request.MediaKind, request.MediaItemIds); + } +} diff --git a/src/Lumina.Application/Common/Mapping/Favorites/GetFavoritesRequestMapping.cs b/src/Lumina.Application/Common/Mapping/Favorites/GetFavoritesRequestMapping.cs new file mode 100644 index 00000000..7e3c89cd --- /dev/null +++ b/src/Lumina.Application/Common/Mapping/Favorites/GetFavoritesRequestMapping.cs @@ -0,0 +1,33 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.DTO.Pagination; +using Lumina.Application.Core.Favorites.Queries.GetFavorites; +using Lumina.Contracts.Requests.Favorites; +#endregion + +namespace Lumina.Application.Common.Mapping.Favorites; + +/// +/// Extension methods for converting . +/// +public static class GetFavoritesRequestMapping +{ + /// + /// Converts to . + /// + /// The request to be converted. + /// The converted query. + public static GetFavoritesQuery ToQuery(this GetFavoritesRequest request) + { + PaginationDataDto? paginationData = null; + if (request.CurrentPage is not null || request.PerPage is not null) + paginationData = new PaginationDataDto + { + CurrentPage = request.CurrentPage ?? 1, + PerPage = request.PerPage ?? 200 + }; + + return new GetFavoritesQuery( + request.MediaKind, + paginationData); + } +} diff --git a/src/Lumina.Application/Common/Mapping/Playlists/GetPlaylistRequestMapping.cs b/src/Lumina.Application/Common/Mapping/Playlists/GetPlaylistRequestMapping.cs new file mode 100644 index 00000000..a2c0ac60 --- /dev/null +++ b/src/Lumina.Application/Common/Mapping/Playlists/GetPlaylistRequestMapping.cs @@ -0,0 +1,34 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.DTO.Pagination; +using Lumina.Application.Core.Playlists.Queries.GetPlaylist; +using Lumina.Contracts.Requests.Playlists; +#endregion + +namespace Lumina.Application.Common.Mapping.Playlists; + +/// +/// Extension methods for converting . +/// +public static class GetPlaylistRequestMapping +{ + /// + /// Converts to . + /// + /// The request to be converted. + /// The Id of the playlist whose entries are retrieved, taken from the route. + /// The converted query. + public static GetPlaylistQuery ToQuery(this GetPlaylistRequest request, string? playlistId) + { + PaginationDataDto? paginationData = null; + if (request.CurrentPage is not null || request.PerPage is not null) + paginationData = new PaginationDataDto + { + CurrentPage = request.CurrentPage ?? 1, + PerPage = request.PerPage ?? 200 + }; + + return new GetPlaylistQuery( + playlistId, + paginationData); + } +} diff --git a/src/Lumina.Application/Common/Mapping/Playlists/PlaylistDetailsDtoMapping.cs b/src/Lumina.Application/Common/Mapping/Playlists/PlaylistDetailsDtoMapping.cs index 9b3c0756..b22d8a57 100644 --- a/src/Lumina.Application/Common/Mapping/Playlists/PlaylistDetailsDtoMapping.cs +++ b/src/Lumina.Application/Common/Mapping/Playlists/PlaylistDetailsDtoMapping.cs @@ -1,7 +1,6 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Application.Common.DTO.Playlists; using Lumina.Contracts.Responses.Playlists; -using System.Linq; #endregion namespace Lumina.Application.Common.Mapping.Playlists; @@ -23,8 +22,7 @@ public static class PlaylistDetailsDtoMapping data.Playlist.Name, data.Playlist.Description, data.Playlist.Type, - [.. data.Entries.Select(entry => entry.ToResponse())], - data.Playlist.EntryCount, + data.Entries.ToResponses(), data.Playlist.CreatedOnUtc, data.Playlist.UpdatedOnUtc); } diff --git a/src/Lumina.Application/Common/Mapping/Playlists/PlaylistEntryDtoMapping.cs b/src/Lumina.Application/Common/Mapping/Playlists/PlaylistEntryDtoMapping.cs index c6c555f2..77a33dbc 100644 --- a/src/Lumina.Application/Common/Mapping/Playlists/PlaylistEntryDtoMapping.cs +++ b/src/Lumina.Application/Common/Mapping/Playlists/PlaylistEntryDtoMapping.cs @@ -1,7 +1,10 @@ #region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.DTO.Pagination; using Lumina.Application.Common.DTO.Playlists; +using Lumina.Contracts.Responses.Common; using Lumina.Contracts.Responses.Playlists; using System; +using System.Linq; #endregion namespace Lumina.Application.Common.Mapping.Playlists; @@ -48,4 +51,21 @@ public static class PlaylistEntryDtoMapping display.DurationInSeconds, display.CoverPath); } + + /// + /// Converts to a paginated collection of . + /// + /// The paginated playlist entry data to be converted. + /// The converted paginated responses. + public static PaginatedResponse ToResponses(this PaginatedResultDto data) + { + return new PaginatedResponse + { + Data = [.. data.Data.Select(entry => entry.ToResponse())], + CurrentPage = data.CurrentPage, + PerPage = data.PerPage, + Count = data.Count, + NumberOfPages = data.NumberOfPages + }; + } } diff --git a/src/Lumina.Application/Common/Utilities/FavoriteMediaKindExtensions.cs b/src/Lumina.Application/Common/Utilities/FavoriteMediaKindExtensions.cs new file mode 100644 index 00000000..cc424d97 --- /dev/null +++ b/src/Lumina.Application/Common/Utilities/FavoriteMediaKindExtensions.cs @@ -0,0 +1,30 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using DomainErrors = Lumina.Domain.Common.Errors.Errors; +#endregion + +namespace Lumina.Application.Common.Utilities; + +/// +/// Extension methods for the enumeration. +/// +public static class FavoriteMediaKindExtensions +{ + /// + /// Gets the error that reports that a media item of does not exist. + /// + /// The kind of the media item that was not found. + /// The not found error specific to the media kind, or the not supported error when the media kind cannot be favorited yet. + public static Error ToMediaItemNotFoundError(this FavoriteMediaKind mediaKind) + { + return mediaKind switch + { + FavoriteMediaKind.MusicArtist => DomainErrors.Music.ArtistNotFound, + FavoriteMediaKind.MusicAlbum => DomainErrors.Music.AlbumNotFound, + FavoriteMediaKind.MusicTrack => DomainErrors.Music.TrackNotFound, + FavoriteMediaKind.Book => DomainErrors.WrittenContent.BookNotFound, + _ => DomainErrors.Favorites.FavoriteMediaKindIsNotSupported + }; + } +} diff --git a/src/Lumina.Application/Core/Favorites/Commands/AddFavorite/AddFavoriteCommand.cs b/src/Lumina.Application/Core/Favorites/Commands/AddFavorite/AddFavoriteCommand.cs new file mode 100644 index 00000000..655fe416 --- /dev/null +++ b/src/Lumina.Application/Core/Favorites/Commands/AddFavorite/AddFavoriteCommand.cs @@ -0,0 +1,19 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.CQRS; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Application.Core.Favorites.Commands.AddFavorite; + +/// +/// Command for marking a media item as a favorite of the current user. +/// +/// The kind of the media item to favorite. +/// The unique identifier of the media item to favorite. +[DebuggerDisplay("MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")] +public record AddFavoriteCommand( + FavoriteMediaKind? MediaKind, + Guid? MediaItemId +) : ICommand; diff --git a/src/Lumina.Application/Core/Favorites/Commands/AddFavorite/AddFavoriteCommandHandler.cs b/src/Lumina.Application/Core/Favorites/Commands/AddFavorite/AddFavoriteCommandHandler.cs new file mode 100644 index 00000000..dd83bb9a --- /dev/null +++ b/src/Lumina.Application/Core/Favorites/Commands/AddFavorite/AddFavoriteCommandHandler.cs @@ -0,0 +1,153 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.CQRS; +using Lumina.Application.Common.DataAccess.Entities.Favorites; +using Lumina.Application.Common.DataAccess.UoW; +using Lumina.Application.Common.DomainEvents; +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.Favorites; +using Lumina.Application.Common.Utilities; +using Lumina.Contracts.Responses.Favorites; +using Lumina.Domain.Common.Events; +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.ExternalIdentifiers.MediaLibraryBoundedContext.MediaItemAggregate; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.ExternalIdentifiers.UserManagementBoundedContext.UserAggregate; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using ApplicationErrors = Lumina.Application.Common.Errors.Errors; +using DomainErrors = Lumina.Domain.Common.Errors.Errors; +#endregion + +namespace Lumina.Application.Core.Favorites.Commands.AddFavorite; + +/// +/// Handler for the command to mark a media item as a favorite of the current user. +/// +public class AddFavoriteCommandHandler : ICommandHandler> +{ + private readonly IUnitOfWork _unitOfWork; + private readonly ICurrentUserService _currentUserService; + private readonly IAuthorizationService _authorizationService; + private readonly IDomainEventsQueue _domainEventsQueue; + 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 to retrieve the current user information. + /// Injected service for authorization related functionality. + /// Injected service for the queue of domain events. + /// Injected validator for application validation rules. + public AddFavoriteCommandHandler( + IUnitOfWork unitOfWork, + ICurrentUserService currentUserService, + IAuthorizationService authorizationService, + IDomainEventsQueue domainEventsQueue, + IValidator validator) + { + _unitOfWork = unitOfWork; + _currentUserService = currentUserService; + _authorizationService = authorizationService; + _domainEventsQueue = domainEventsQueue; + _validator = validator; + } + + /// + /// Handles the command to mark a media item as a favorite of the current user. + /// + /// The command to be handled. + /// Cancellation token that can be used to stop the execution. + /// + /// An containing either the favorite of the current user on the media item, or an error message. + /// + public async Task> HandleAsync(AddFavoriteCommand command, CancellationToken cancellationToken) + { + List validationResult = _validator.Validate(command); + 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 media kind is a defined value and the media item identifier is a non-empty Guid before this point. + FavoriteMediaKind mediaKind = command.MediaKind!.Value; + Guid mediaItemId = command.MediaItemId!.Value; + + // A planned media kind has no catalogued library to look the item up in, so it is rejected before any lookup. + if (!Favorite.IsSupported(mediaKind)) + return DomainErrors.Favorites.FavoriteMediaKindIsNotSupported; + + // The item must exist, and its library must be reachable by the current user, so another user's library cannot be probed through favorites. + Result getLibraryIdResult = await _unitOfWork.FavoriteRepository.GetMediaItemLibraryIdAsync(mediaKind, mediaItemId, cancellationToken).ConfigureAwait(false); + if (getLibraryIdResult.IsFailure) + return getLibraryIdResult.Errors; + if (getLibraryIdResult.Value is null) + return mediaKind.ToMediaItemNotFoundError(); + + // An item whose library is not reachable is reported exactly like a missing item, so the response cannot be used to probe whether an item exists in another user's library. + bool canAccessLibrary = await _authorizationService.EvaluatePolicyAsync( + userId, new LibraryOwnershipPolicyContext(getLibraryIdResult.Value.Value), cancellationToken).ConfigureAwait(false); + if (!canAccessLibrary) + return mediaKind.ToMediaItemNotFoundError(); + + // Adding an item that is already a favorite is idempotent: the existing favorite is returned and no event is raised. + Result getExistingFavoriteResult = await _unitOfWork.FavoriteRepository + .GetByMediaItemIdForUserAsync(userId, mediaKind, mediaItemId, shouldTrackEntities: false, cancellationToken: cancellationToken).ConfigureAwait(false); + if (getExistingFavoriteResult.IsFailure) + return getExistingFavoriteResult.Errors; + if (getExistingFavoriteResult.Value is not null) + return getExistingFavoriteResult.Value.ToResponse(); + + Result createFavoriteResult = Favorite.Create(UserId.Create(userId), MediaItemId.Create(mediaItemId), mediaKind); + if (createFavoriteResult.IsFailure) + return createFavoriteResult.Errors; + Favorite favorite = createFavoriteResult.Value; + + Result insertResult = await _unitOfWork.FavoriteRepository.InsertAsync(favorite.ToRepositoryEntity(), cancellationToken).ConfigureAwait(false); + if (insertResult.IsFailure) + return insertResult.Errors; + + Result saveChangesResult = await _unitOfWork.SaveChangesAsync(cancellationToken).ConfigureAwait(false); + if (saveChangesResult.IsFailure) + { + // A concurrent request favorited the same item between the read above and this write, and the unique index rejected this one. The + // desired state already holds, so the request succeeds with the stored favorite, without announcing a favorite that this request did not create. + if (!saveChangesResult.Errors.Any(error => error == ApplicationErrors.Persistence.UniqueConstraintViolation)) + return saveChangesResult.Errors; + + _unitOfWork.ClearTrackedEntities(); + Result getConcurrentFavoriteResult = await _unitOfWork.FavoriteRepository + .GetByMediaItemIdForUserAsync(userId, mediaKind, mediaItemId, shouldTrackEntities: false, cancellationToken: cancellationToken).ConfigureAwait(false); + if (getConcurrentFavoriteResult.IsFailure) + return getConcurrentFavoriteResult.Errors; + if (getConcurrentFavoriteResult.Value is null) + return saveChangesResult.Errors; + return getConcurrentFavoriteResult.Value.ToResponse(); + } + + // Queue any domain events, to be published after the request has completed successfully. + foreach (IDomainEvent domainEvent in favorite.GetDomainEvents()) + _domainEventsQueue.Enqueue(domainEvent); + + // The persisted row is read back, so the response carries the timestamps the auditing interceptor actually stored. + Result getFavoriteResult = await _unitOfWork.FavoriteRepository + .GetByMediaItemIdForUserAsync(userId, mediaKind, mediaItemId, shouldTrackEntities: false, cancellationToken: cancellationToken).ConfigureAwait(false); + if (getFavoriteResult.IsFailure) + return getFavoriteResult.Errors; + if (getFavoriteResult.Value is null) + return DomainErrors.Favorites.FavoriteNotFound; + + return getFavoriteResult.Value.ToResponse(); + } +} diff --git a/src/Lumina.Application/Core/Favorites/Commands/AddFavorite/AddFavoriteCommandValidator.cs b/src/Lumina.Application/Core/Favorites/Commands/AddFavorite/AddFavoriteCommandValidator.cs new file mode 100644 index 00000000..f1648cf0 --- /dev/null +++ b/src/Lumina.Application/Core/Favorites/Commands/AddFavorite/AddFavoriteCommandValidator.cs @@ -0,0 +1,38 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.Infrastructure.Validation; +using Lumina.Application.Common.Utilities; +using Lumina.Domain.Common.Errors; +using System; +#endregion + +namespace Lumina.Application.Core.Favorites.Commands.AddFavorite; + +/// +/// Validates the needed validation rules for . +/// +public class AddFavoriteCommandValidator : AbstractValidator +{ + /// + /// Initializes a new instance of the class. + /// + public AddFavoriteCommandValidator() + { + RuleFor(command => command.MediaKind) + .NotNull() + .WithError(Errors.Favorites.FavoriteMediaKindIsInvalid); + + RuleFor(command => command.MediaKind) + .IsInEnum() + .WithError(Errors.Favorites.FavoriteMediaKindIsInvalid) + .When(command => command.MediaKind is not null); + + RuleFor(command => command.MediaItemId) + .NotNull() + .WithError(Errors.Favorites.FavoriteMediaItemIdCannotBeEmpty); + + RuleFor(command => command.MediaItemId) + .NotEmpty() + .WithError(Errors.Favorites.FavoriteMediaItemIdCannotBeEmpty) + .When(command => command.MediaItemId is not null); + } +} diff --git a/src/Lumina.Application/Core/Favorites/Commands/RemoveFavorite/RemoveFavoriteCommand.cs b/src/Lumina.Application/Core/Favorites/Commands/RemoveFavorite/RemoveFavoriteCommand.cs new file mode 100644 index 00000000..c3cee0c3 --- /dev/null +++ b/src/Lumina.Application/Core/Favorites/Commands/RemoveFavorite/RemoveFavoriteCommand.cs @@ -0,0 +1,17 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.CQRS; +using System.Diagnostics; +#endregion + +namespace Lumina.Application.Core.Favorites.Commands.RemoveFavorite; + +/// +/// Command for removing a media item from the favorites of the current user. +/// +/// The name of the kind of the favorited media item, taken from the route. +/// The unique identifier of the favorited media item, taken from the route. +[DebuggerDisplay("MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")] +public record RemoveFavoriteCommand( + string? MediaKind, + string? MediaItemId +) : ICommand; diff --git a/src/Lumina.Application/Core/Favorites/Commands/RemoveFavorite/RemoveFavoriteCommandHandler.cs b/src/Lumina.Application/Core/Favorites/Commands/RemoveFavorite/RemoveFavoriteCommandHandler.cs new file mode 100644 index 00000000..e91e0687 --- /dev/null +++ b/src/Lumina.Application/Core/Favorites/Commands/RemoveFavorite/RemoveFavoriteCommandHandler.cs @@ -0,0 +1,123 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.CQRS; +using Lumina.Application.Common.DataAccess.Entities.Favorites; +using Lumina.Application.Common.DataAccess.UoW; +using Lumina.Application.Common.DomainEvents; +using Lumina.Application.Common.Infrastructure.Authentication; +using Lumina.Application.Common.Infrastructure.Validation; +using Lumina.Application.Common.Mapping.Favorites; +using Lumina.Domain.Common.Events; +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +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.Favorites.Commands.RemoveFavorite; + +/// +/// Handler for the command to remove a media item from the favorites of the current user. +/// +public class RemoveFavoriteCommandHandler : ICommandHandler> +{ + private readonly IUnitOfWork _unitOfWork; + private readonly ICurrentUserService _currentUserService; + private readonly IDomainEventsQueue _domainEventsQueue; + 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 to retrieve the current user information. + /// Injected service for the queue of domain events. + /// Injected validator for application validation rules. + public RemoveFavoriteCommandHandler( + IUnitOfWork unitOfWork, + ICurrentUserService currentUserService, + IDomainEventsQueue domainEventsQueue, + IValidator validator) + { + _unitOfWork = unitOfWork; + _currentUserService = currentUserService; + _domainEventsQueue = domainEventsQueue; + _validator = validator; + } + + /// + /// Handles the command to remove a media item from the favorites of the current user. + /// + /// The command to be handled. + /// Cancellation token that can be used to stop the execution. + /// An representing either a successful operation, or an error. + public async Task> HandleAsync(RemoveFavoriteCommand command, CancellationToken cancellationToken) + { + List validationResult = _validator.Validate(command); + 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 values are a defined media kind name and a non-empty Guid before this point. + FavoriteMediaKind mediaKind = Enum.Parse(command.MediaKind!, ignoreCase: true); + Guid mediaItemId = Guid.Parse(command.MediaItemId!); + + // The favorite is loaded by the current user, the kind and the item, so another user's favorite is never touched. It is loaded so that its + // aggregate can raise the removal event before the row is deleted. The library of the item is deliberately not evaluated, so a user can + // always remove their own favorite whose item was deleted or is no longer accessible. + Result getFavoriteResult = await _unitOfWork.FavoriteRepository + .GetByMediaItemIdForUserAsync(userId, mediaKind, mediaItemId, shouldTrackEntities: true, cancellationToken: cancellationToken).ConfigureAwait(false); + if (getFavoriteResult.IsFailure) + return getFavoriteResult.Errors; + // Removing a favorite that is already absent succeeds, so a retry, or another tab that removed it first, does not turn the + // caller's removal into an error. Nothing is deleted and no event is raised because this request did not remove anything. + if (getFavoriteResult.Value is null) + return Result.Deleted; + + Result toDomainEntityResult = getFavoriteResult.Value.ToDomainEntity(); + if (toDomainEntityResult.IsFailure) + return toDomainEntityResult.Errors; + Favorite favorite = toDomainEntityResult.Value; + + Result removeResult = favorite.Remove(); + if (removeResult.IsFailure) + return removeResult.Errors; + + Result deleteFavoriteResult = await _unitOfWork.FavoriteRepository.DeleteByIdAsync(favorite.Id.Value, cancellationToken).ConfigureAwait(false); + if (deleteFavoriteResult.IsFailure) + return deleteFavoriteResult.Errors; + + Result saveChangesResult = await _unitOfWork.SaveChangesAsync(cancellationToken).ConfigureAwait(false); + if (saveChangesResult.IsFailure) + { + // A concurrent request removed the same favorite between the read above and this write, so the row this request tried to delete is already gone. The + // desired state already holds, so the request succeeds, without announcing a removal that this request did not perform. + if (!saveChangesResult.Errors.Any(error => error == ApplicationErrors.Persistence.ConcurrencyConflict)) + return saveChangesResult.Errors; + + _unitOfWork.ClearTrackedEntities(); + Result getRemainingFavoriteResult = await _unitOfWork.FavoriteRepository + .GetByMediaItemIdForUserAsync(userId, mediaKind, mediaItemId, shouldTrackEntities: false, cancellationToken: cancellationToken).ConfigureAwait(false); + if (getRemainingFavoriteResult.IsFailure) + return getRemainingFavoriteResult.Errors; + if (getRemainingFavoriteResult.Value is not null) + return saveChangesResult.Errors; + return Result.Deleted; + } + + // Queue any domain events, to be published after the request has completed successfully. + foreach (IDomainEvent domainEvent in favorite.GetDomainEvents()) + _domainEventsQueue.Enqueue(domainEvent); + + return Result.Deleted; + } +} diff --git a/src/Lumina.Application/Core/Favorites/Commands/RemoveFavorite/RemoveFavoriteCommandValidator.cs b/src/Lumina.Application/Core/Favorites/Commands/RemoveFavorite/RemoveFavoriteCommandValidator.cs new file mode 100644 index 00000000..ae06535a --- /dev/null +++ b/src/Lumina.Application/Core/Favorites/Commands/RemoveFavorite/RemoveFavoriteCommandValidator.cs @@ -0,0 +1,41 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.Infrastructure.Validation; +using Lumina.Application.Common.Utilities; +using Lumina.Domain.Common.Errors; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Linq; +#endregion + +namespace Lumina.Application.Core.Favorites.Commands.RemoveFavorite; + +/// +/// Validates the needed validation rules for . +/// +public class RemoveFavoriteCommandValidator : AbstractValidator +{ + /// + /// Initializes a new instance of the class. + /// + public RemoveFavoriteCommandValidator() + { + RuleFor(command => command.MediaKind) + .NotEmpty() + .WithError(Errors.Favorites.FavoriteMediaKindIsInvalid); + + // Only the member names are accepted, so a numeric route value that happens to parse as an enumeration value is rejected. + RuleFor(command => command.MediaKind) + .Must(mediaKind => Enum.GetNames().Contains(mediaKind, StringComparer.OrdinalIgnoreCase)) + .When(command => command.MediaKind is not null && command.MediaKind.Length > 0) + .WithError(Errors.Favorites.FavoriteMediaKindIsInvalid); + + RuleFor(command => command.MediaItemId) + .NotEmpty() + .WithError(Errors.Favorites.FavoriteMediaItemIdCannotBeEmpty); + + RuleFor(command => command.MediaItemId) + .Must(mediaItemId => Guid.TryParse(mediaItemId, out Guid parsedMediaItemId) && parsedMediaItemId != Guid.Empty) + .When(command => command.MediaItemId is not null && command.MediaItemId.Length > 0) + .WithError(Errors.Favorites.FavoriteMediaItemIdCannotBeEmpty); + } +} diff --git a/src/Lumina.Application/Core/Favorites/Queries/GetFavoriteStatus/GetFavoriteStatusQuery.cs b/src/Lumina.Application/Core/Favorites/Queries/GetFavoriteStatus/GetFavoriteStatusQuery.cs new file mode 100644 index 00000000..a4598f0d --- /dev/null +++ b/src/Lumina.Application/Core/Favorites/Queries/GetFavoriteStatus/GetFavoriteStatusQuery.cs @@ -0,0 +1,20 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.CQRS; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Application.Core.Favorites.Queries.GetFavoriteStatus; + +/// +/// Query for finding out which media items of one kind are favorites of the current user. +/// +/// The kind of the media items to check. +/// The unique identifiers of the media items to check. +[DebuggerDisplay("MediaKind: {MediaKind}")] +public record GetFavoriteStatusQuery( + FavoriteMediaKind? MediaKind, + IReadOnlyList? MediaItemIds +) : IQuery; diff --git a/src/Lumina.Application/Core/Favorites/Queries/GetFavoriteStatus/GetFavoriteStatusQueryHandler.cs b/src/Lumina.Application/Core/Favorites/Queries/GetFavoriteStatus/GetFavoriteStatusQueryHandler.cs new file mode 100644 index 00000000..f045642b --- /dev/null +++ b/src/Lumina.Application/Core/Favorites/Queries/GetFavoriteStatus/GetFavoriteStatusQueryHandler.cs @@ -0,0 +1,73 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.CQRS; +using Lumina.Application.Common.DataAccess.UoW; +using Lumina.Application.Common.Infrastructure.Authentication; +using Lumina.Application.Common.Infrastructure.Validation; +using Lumina.Contracts.Responses.Favorites; +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +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.Favorites.Queries.GetFavoriteStatus; + +/// +/// Handler for the query to find out which media items of one kind are favorites of the current user. +/// +public class GetFavoriteStatusQueryHandler : IQueryHandler> +{ + private readonly IUnitOfWork _unitOfWork; + 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 to retrieve the current user information. + /// Injected validator for application validation rules. + public GetFavoriteStatusQueryHandler(IUnitOfWork unitOfWork, ICurrentUserService currentUserService, IValidator validator) + { + _unitOfWork = unitOfWork; + _currentUserService = currentUserService; + _validator = validator; + } + + /// + /// Handles the query to find out which media items of one kind are favorites of the current user. + /// + /// The query to be handled. + /// Cancellation token that can be used to stop the execution. + /// + /// An containing either the requested , or an error message. + /// + public async Task> HandleAsync(GetFavoriteStatusQuery 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 media kind is a defined value and the identifiers are a non-empty collection of non-empty Guids before this point. + FavoriteMediaKind mediaKind = query.MediaKind!.Value; + List mediaItemIds = [.. query.MediaItemIds!.Distinct()]; + + // Only the favorites of the current user are checked, so no library access is evaluated: the answer reveals nothing about other users. + Result> getFavoritedIdsResult = await _unitOfWork.FavoriteRepository + .GetFavoritedMediaItemIdsForUserAsync(userId, mediaKind, mediaItemIds, cancellationToken).ConfigureAwait(false); + if (getFavoritedIdsResult.IsFailure) + return getFavoritedIdsResult.Errors; + + return new FavoriteStatusResponse(getFavoritedIdsResult.Value); + } +} diff --git a/src/Lumina.Application/Core/Favorites/Queries/GetFavoriteStatus/GetFavoriteStatusQueryValidator.cs b/src/Lumina.Application/Core/Favorites/Queries/GetFavoriteStatus/GetFavoriteStatusQueryValidator.cs new file mode 100644 index 00000000..8702357e --- /dev/null +++ b/src/Lumina.Application/Core/Favorites/Queries/GetFavoriteStatus/GetFavoriteStatusQueryValidator.cs @@ -0,0 +1,46 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.Infrastructure.Validation; +using Lumina.Application.Common.Utilities; +using Lumina.Domain.Common.Errors; +using System; +using System.Linq; +#endregion + +namespace Lumina.Application.Core.Favorites.Queries.GetFavoriteStatus; + +/// +/// Validates the needed validation rules for . +/// +public class GetFavoriteStatusQueryValidator : AbstractValidator +{ + private const int MAXIMUM_MEDIA_ITEM_COUNT = 100; + + /// + /// Initializes a new instance of the class. + /// + public GetFavoriteStatusQueryValidator() + { + RuleFor(query => query.MediaKind) + .NotNull() + .WithError(Errors.Favorites.FavoriteMediaKindIsInvalid); + + RuleFor(query => query.MediaKind) + .IsInEnum() + .WithError(Errors.Favorites.FavoriteMediaKindIsInvalid) + .When(query => query.MediaKind is not null); + + RuleFor(query => query.MediaItemIds) + .NotEmpty() + .WithError(Errors.Favorites.FavoriteMediaItemIdsCannotBeEmpty); + + RuleFor(query => query.MediaItemIds) + .Must(mediaItemIds => mediaItemIds!.Count <= MAXIMUM_MEDIA_ITEM_COUNT) + .When(query => query.MediaItemIds is not null) + .WithError(Errors.Favorites.FavoriteMediaItemIdsExceedMaximumCount); + + RuleFor(query => query.MediaItemIds) + .Must(mediaItemIds => !mediaItemIds!.Contains(Guid.Empty)) + .When(query => query.MediaItemIds is not null) + .WithError(Errors.Favorites.FavoriteMediaItemIdCannotBeEmpty); + } +} diff --git a/src/Lumina.Application/Core/Favorites/Queries/GetFavorites/GetFavoritesQuery.cs b/src/Lumina.Application/Core/Favorites/Queries/GetFavorites/GetFavoritesQuery.cs new file mode 100644 index 00000000..e7961535 --- /dev/null +++ b/src/Lumina.Application/Core/Favorites/Queries/GetFavorites/GetFavoritesQuery.cs @@ -0,0 +1,19 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.CQRS; +using Lumina.Application.Common.DTO.Pagination; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System.Diagnostics; +#endregion + +namespace Lumina.Application.Core.Favorites.Queries.GetFavorites; + +/// +/// Query for getting the favorites of the current user, from the most recently favorited. +/// +/// The kind of media item to restrict the favorites to, or for every kind. +/// The object containing the requested pagination data. +[DebuggerDisplay("MediaKind: {MediaKind}")] +public record GetFavoritesQuery( + FavoriteMediaKind? MediaKind, + PaginationDataDto? PaginationData +) : IQuery; diff --git a/src/Lumina.Application/Core/Favorites/Queries/GetFavorites/GetFavoritesQueryHandler.cs b/src/Lumina.Application/Core/Favorites/Queries/GetFavorites/GetFavoritesQueryHandler.cs new file mode 100644 index 00000000..f356bac4 --- /dev/null +++ b/src/Lumina.Application/Core/Favorites/Queries/GetFavorites/GetFavoritesQueryHandler.cs @@ -0,0 +1,105 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.CQRS; +using Lumina.Application.Common.DataAccess.UoW; +using Lumina.Application.Common.DTO.Favorites; +using Lumina.Application.Common.DTO.Pagination; +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.Favorites; +using Lumina.Contracts.Responses.Common; +using Lumina.Contracts.Responses.Favorites; +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.Favorites.Queries.GetFavorites; + +/// +/// Handler for the query to get a window of the favorites of the current user. +/// +public class GetFavoritesQueryHandler : IQueryHandler>> +{ + private readonly IUnitOfWork _unitOfWork; + private readonly ICurrentUserService _currentUserService; + private readonly IAuthorizationService _authorizationService; + 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 to retrieve the current user information. + /// Injected service for authorization related functionality. + /// Injected validator for application validation rules. + public GetFavoritesQueryHandler(IUnitOfWork unitOfWork, ICurrentUserService currentUserService, IAuthorizationService authorizationService, IValidator validator) + { + _unitOfWork = unitOfWork; + _currentUserService = currentUserService; + _authorizationService = authorizationService; + _validator = validator; + } + + /// + /// Handles the query to get a window of the favorites of the current user. + /// + /// The query to be handled. + /// Cancellation token that can be used to stop the execution. + /// + /// An containing either the requested page of favorites, or an error message. + /// + public async Task>> HandleAsync(GetFavoritesQuery 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 favorites are scoped to the current user by the repository. + Result> getFavoritesResult = await _unitOfWork.FavoriteRepository + .GetAllForUserAsync(userId, query.MediaKind, query.PaginationData, cancellationToken: cancellationToken).ConfigureAwait(false); + if (getFavoritesResult.IsFailure) + return getFavoritesResult.Errors; + + // Check the access permissions once for each library that the favorited items might belong to. + PaginatedResultDto page = getFavoritesResult.Value; + List libraryIds = [.. page.Data + .Select(item => item.Display?.LibraryId ?? Guid.Empty) + .Where(libraryId => libraryId != Guid.Empty) + .Distinct()]; + Dictionary libraryAccess = []; + foreach (Guid libraryId in libraryIds) + { + bool canAccessLibrary = await _authorizationService.EvaluatePolicyAsync( + userId, new LibraryOwnershipPolicyContext(libraryId), cancellationToken).ConfigureAwait(false); + libraryAccess[libraryId] = canAccessLibrary; + } + + if (libraryAccess.Values.Any(canAccessLibrary => !canAccessLibrary)) + { + List items = []; + foreach (FavoriteItemDto item in page.Data) + { + Guid libraryId = item.Display?.LibraryId ?? Guid.Empty; + if (libraryId == Guid.Empty || libraryAccess[libraryId]) + items.Add(item); + else // Keep the row so its owner can see and remove it, but do not expose display data from a library the user cannot access. + items.Add(item with { Display = null }); + } + page = page with { Data = items }; + } + + return Result.From(page.ToResponses()); + } +} diff --git a/src/Lumina.Application/Core/Favorites/Queries/GetFavorites/GetFavoritesQueryValidator.cs b/src/Lumina.Application/Core/Favorites/Queries/GetFavorites/GetFavoritesQueryValidator.cs new file mode 100644 index 00000000..6f512a40 --- /dev/null +++ b/src/Lumina.Application/Core/Favorites/Queries/GetFavorites/GetFavoritesQueryValidator.cs @@ -0,0 +1,24 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.Infrastructure.Validation; +using Lumina.Application.Common.Utilities; +using Lumina.Domain.Common.Errors; +#endregion + +namespace Lumina.Application.Core.Favorites.Queries.GetFavorites; + +/// +/// Validates the needed validation rules for . +/// +public class GetFavoritesQueryValidator : AbstractValidator +{ + /// + /// Initializes a new instance of the class. + /// + public GetFavoritesQueryValidator() + { + RuleFor(query => query.MediaKind) + .IsInEnum() + .WithError(Errors.Favorites.FavoriteMediaKindIsInvalid) + .When(query => query.MediaKind is not null); + } +} diff --git a/src/Lumina.Application/Core/Playlists/Commands/CreatePlaylist/CreatePlaylistCommandHandler.cs b/src/Lumina.Application/Core/Playlists/Commands/CreatePlaylist/CreatePlaylistCommandHandler.cs index bafaa12e..777d049c 100644 --- a/src/Lumina.Application/Core/Playlists/Commands/CreatePlaylist/CreatePlaylistCommandHandler.cs +++ b/src/Lumina.Application/Core/Playlists/Commands/CreatePlaylist/CreatePlaylistCommandHandler.cs @@ -2,11 +2,11 @@ using Lumina.Application.Common.CQRS; using Lumina.Application.Common.DataAccess.UoW; using Lumina.Application.Common.DomainEvents; +using Lumina.Application.Common.DTO.Pagination; using Lumina.Application.Common.DTO.Playlists; using Lumina.Application.Common.Infrastructure.Authentication; using Lumina.Application.Common.Infrastructure.Validation; using Lumina.Application.Common.Mapping.Playlists; -using Lumina.Application.Core.Playlists.Queries.GetPlaylist; using Lumina.Contracts.Responses.Playlists; using Lumina.Domain.Common.Events; using Lumina.Domain.Common.Primitives; @@ -94,7 +94,7 @@ public class CreatePlaylistCommandHandler : ICommandHandler getDetailsResult = await _unitOfWork.PlaylistRepository - .GetDetailsForUserAsync(playlist.Id.Value, userId, 0, PlaylistWindow.DEFAULT_ENTRY_WINDOW_SIZE, cancellationToken).ConfigureAwait(false); + .GetDetailsForUserAsync(playlist.Id.Value, userId, new PaginationDataDto(), cancellationToken).ConfigureAwait(false); if (getDetailsResult.IsFailure) return getDetailsResult.Errors; if (getDetailsResult.Value is null) diff --git a/src/Lumina.Application/Core/Playlists/Queries/GetPlaylist/GetPlaylistQuery.cs b/src/Lumina.Application/Core/Playlists/Queries/GetPlaylist/GetPlaylistQuery.cs index 8cfc66e3..17d6c9a3 100644 --- a/src/Lumina.Application/Core/Playlists/Queries/GetPlaylist/GetPlaylistQuery.cs +++ b/src/Lumina.Application/Core/Playlists/Queries/GetPlaylist/GetPlaylistQuery.cs @@ -1,19 +1,18 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Application.Common.CQRS; +using Lumina.Application.Common.DTO.Pagination; using System.Diagnostics; #endregion namespace Lumina.Application.Core.Playlists.Queries.GetPlaylist; /// -/// Query for getting a playlist of the current user, together with a window of its ordered entries. +/// Query for getting a playlist of the current user, together with a page of its ordered entries. /// /// The unique identifier of the playlist, taken from the route. -/// The zero based position of the first entry to return. -/// The maximum number of entries to return in this window. -[DebuggerDisplay("PlaylistId: {PlaylistId}; Offset: {Offset}; Limit: {Limit}")] +/// The object containing the requested pagination data. +[DebuggerDisplay("PlaylistId: {PlaylistId}")] public record GetPlaylistQuery( string? PlaylistId, - int Offset = 0, - int Limit = PlaylistWindow.DEFAULT_ENTRY_WINDOW_SIZE + PaginationDataDto? PaginationData ) : IQuery; diff --git a/src/Lumina.Application/Core/Playlists/Queries/GetPlaylist/GetPlaylistQueryHandler.cs b/src/Lumina.Application/Core/Playlists/Queries/GetPlaylist/GetPlaylistQueryHandler.cs index 553b7121..6d79979b 100644 --- a/src/Lumina.Application/Core/Playlists/Queries/GetPlaylist/GetPlaylistQueryHandler.cs +++ b/src/Lumina.Application/Core/Playlists/Queries/GetPlaylist/GetPlaylistQueryHandler.cs @@ -70,7 +70,7 @@ public class GetPlaylistQueryHandler : IQueryHandler getPlaylistResult = await _unitOfWork.PlaylistRepository - .GetDetailsForUserAsync(playlistId, userId, query.Offset, query.Limit, cancellationToken).ConfigureAwait(false); + .GetDetailsForUserAsync(playlistId, userId, query.PaginationData, cancellationToken).ConfigureAwait(false); if (getPlaylistResult.IsFailure) return getPlaylistResult.Errors; if (getPlaylistResult.Value is null) @@ -78,7 +78,7 @@ public class GetPlaylistQueryHandler : IQueryHandler libraryIds = [.. playlist.Entries + List libraryIds = [.. playlist.Entries.Data .Select(entry => entry.Display?.LibraryId ?? Guid.Empty) .Where(libraryId => libraryId != Guid.Empty) .Distinct()]; @@ -93,7 +93,7 @@ public class GetPlaylistQueryHandler : IQueryHandler !canAccessLibrary)) { List entries = []; - foreach (PlaylistEntryDto entry in playlist.Entries) + foreach (PlaylistEntryDto entry in playlist.Entries.Data) { Guid libraryId = entry.Display?.LibraryId ?? Guid.Empty; if (libraryId == Guid.Empty || libraryAccess[libraryId]) @@ -102,7 +102,7 @@ public class GetPlaylistQueryHandler : IQueryHandler .Must(playlistId => Guid.TryParse(playlistId, out Guid parsedPlaylistId) && parsedPlaylistId != Guid.Empty) .When(query => query.PlaylistId is not null && query.PlaylistId.Length > 0) .WithError(Errors.Playlists.PlaylistIdCannotBeEmpty); - - RuleFor(query => query.Offset) - .GreaterThanOrEqualTo(0) - .WithError(Errors.Playlists.PlaylistEntryWindowOffsetIsInvalid); - - RuleFor(query => query.Limit) - .InclusiveBetween(1, PlaylistWindow.MAXIMUM_ENTRY_WINDOW_SIZE) - .WithError(Errors.Playlists.PlaylistEntryWindowLimitIsInvalid); } } diff --git a/src/Lumina.Application/Core/Playlists/Queries/GetPlaylist/PlaylistWindow.cs b/src/Lumina.Application/Core/Playlists/Queries/GetPlaylist/PlaylistWindow.cs deleted file mode 100644 index 8f8f1806..00000000 --- a/src/Lumina.Application/Core/Playlists/Queries/GetPlaylist/PlaylistWindow.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Lumina.Application.Core.Playlists.Queries.GetPlaylist; - -/// -/// The bounds of one playlist entry read window. -/// -public static class PlaylistWindow -{ - /// - /// The default number of entries a single read window returns. - /// - public const int DEFAULT_ENTRY_WINDOW_SIZE = 200; - - /// - /// The maximum number of entries a single read window may return. - /// - public const int MAXIMUM_ENTRY_WINDOW_SIZE = 1000; -} diff --git a/src/Lumina.Contracts/Requests/Favorites/AddFavoriteRequest.cs b/src/Lumina.Contracts/Requests/Favorites/AddFavoriteRequest.cs new file mode 100644 index 00000000..e8f00635 --- /dev/null +++ b/src/Lumina.Contracts/Requests/Favorites/AddFavoriteRequest.cs @@ -0,0 +1,18 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Contracts.Requests.Favorites; + +/// +/// Represents a request for marking a media item as a favorite of the current user. +/// +/// The kind of the media item to favorite. Required. +/// The Id of the media item to favorite. Required. +[DebuggerDisplay("MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")] +public record AddFavoriteRequest( + FavoriteMediaKind? MediaKind, + Guid? MediaItemId +); diff --git a/src/Lumina.Contracts/Requests/Favorites/GetFavoriteStatusRequest.cs b/src/Lumina.Contracts/Requests/Favorites/GetFavoriteStatusRequest.cs new file mode 100644 index 00000000..b846a8fb --- /dev/null +++ b/src/Lumina.Contracts/Requests/Favorites/GetFavoriteStatusRequest.cs @@ -0,0 +1,19 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Contracts.Requests.Favorites; + +/// +/// Represents a request for finding out which media items of one kind are favorites of the current user. +/// +/// The kind of the media items to check. Required. +/// The Ids of the media items to check, from 1 to 100. Required. +[DebuggerDisplay("MediaKind: {MediaKind}")] +public record GetFavoriteStatusRequest( + FavoriteMediaKind? MediaKind, + List? MediaItemIds +); diff --git a/src/Lumina.Contracts/Requests/Favorites/GetFavoritesRequest.cs b/src/Lumina.Contracts/Requests/Favorites/GetFavoritesRequest.cs new file mode 100644 index 00000000..432c688b --- /dev/null +++ b/src/Lumina.Contracts/Requests/Favorites/GetFavoritesRequest.cs @@ -0,0 +1,19 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System.Diagnostics; +#endregion + +namespace Lumina.Contracts.Requests.Favorites; + +/// +/// Represents a request for getting a window of the favorites of the current user. +/// +/// The kind of media item to restrict the favorites to. Optional; every kind is returned when omitted. +/// The one based page of favorites to return. Optional; defaults to 1 when a page size is provided. +/// The number of favorites per page. Optional; defaults to 200 when a page is provided. When both pagination parameters are omitted, every matching favorite is returned. +[DebuggerDisplay("MediaKind: {MediaKind}; CurrentPage: {CurrentPage}; PerPage: {PerPage}")] +public record GetFavoritesRequest( + FavoriteMediaKind? MediaKind, + int? CurrentPage, + int? PerPage +); diff --git a/src/Lumina.Contracts/Requests/Playlists/GetPlaylistRequest.cs b/src/Lumina.Contracts/Requests/Playlists/GetPlaylistRequest.cs index c167abf0..e8bfe22a 100644 --- a/src/Lumina.Contracts/Requests/Playlists/GetPlaylistRequest.cs +++ b/src/Lumina.Contracts/Requests/Playlists/GetPlaylistRequest.cs @@ -5,12 +5,12 @@ using System.Diagnostics; namespace Lumina.Contracts.Requests.Playlists; /// -/// Represents a request for getting a window of the entries of a playlist of the current user. +/// Represents a request for getting a page of the entries of a playlist of the current user. /// -/// The zero based position of the first entry to return. Optional; defaults to 0. -/// The maximum number of entries to return, from 1 to 1000. Optional; defaults to 200. -[DebuggerDisplay("Offset: {Offset}; Limit: {Limit}")] +/// The one based page of entries to return. Optional; defaults to 1 when a page size is provided. +/// The number of entries per page. Optional; defaults to 200 when a page is provided. When both pagination parameters are omitted, every entry is returned. +[DebuggerDisplay("CurrentPage: {CurrentPage}; PerPage: {PerPage}")] public record GetPlaylistRequest( - int? Offset, - int? Limit + int? CurrentPage, + int? PerPage ); diff --git a/src/Lumina.Contracts/Responses/Favorites/FavoriteItemResponse.cs b/src/Lumina.Contracts/Responses/Favorites/FavoriteItemResponse.cs new file mode 100644 index 00000000..319ad5c5 --- /dev/null +++ b/src/Lumina.Contracts/Responses/Favorites/FavoriteItemResponse.cs @@ -0,0 +1,39 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Contracts.Responses.Favorites; + +/// +/// Represents a response for a favorite of the current user together with the display details of the media item it references. +/// +/// +/// The display fields are generic across media kinds. For a music artist the title is the artist name and there is no collection or +/// creator. For a music album the creator is the artist and there is no collection. For a music track the collection is the album and the +/// creator is the artist. For a book there is no collection yet, because the series of a book is not catalogued, and the creator is its first author. +/// +/// The kind of the favorited media item. +/// The Id of the favorited media item. +/// Whether the media item still exists and can be accessed by the user. When , every display field is empty. +/// The Id of the media library that contains the media item, or an empty Guid when the item is not available. +/// The title of the media item, or an empty string when the item is not available. +/// The Id of the collection that contains the media item, or an empty Guid when there is none. +/// The title of the collection that contains the media item, or an empty string when there is none. +/// The Id of the creator of the media item, or an empty Guid when there is none. +/// The name of the creator of the media item, or an empty string when there is none. +/// The path of the cover art of the media item, if available. +[DebuggerDisplay("MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")] +public sealed record FavoriteItemResponse( + FavoriteMediaKind MediaKind, + Guid MediaItemId, + bool IsAvailable, + Guid LibraryId, + string Title, + Guid CollectionId, + string CollectionTitle, + Guid CreatorId, + string CreatorName, + string? CoverPath +); diff --git a/src/Lumina.Contracts/Responses/Favorites/FavoriteResponse.cs b/src/Lumina.Contracts/Responses/Favorites/FavoriteResponse.cs new file mode 100644 index 00000000..5453a4d4 --- /dev/null +++ b/src/Lumina.Contracts/Responses/Favorites/FavoriteResponse.cs @@ -0,0 +1,22 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Contracts.Responses.Favorites; + +/// +/// Represents a response for a favorite of the current user. +/// +/// The Id of the favorite. +/// The kind of the favorited media item. +/// The Id of the favorited media item. +/// The date and time when the media item was favorited. +[DebuggerDisplay("Id: {Id}; MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")] +public sealed record FavoriteResponse( + Guid Id, + FavoriteMediaKind MediaKind, + Guid MediaItemId, + DateTime FavoritedOnUtc +); diff --git a/src/Lumina.Contracts/Responses/Favorites/FavoriteStatusResponse.cs b/src/Lumina.Contracts/Responses/Favorites/FavoriteStatusResponse.cs new file mode 100644 index 00000000..b950438e --- /dev/null +++ b/src/Lumina.Contracts/Responses/Favorites/FavoriteStatusResponse.cs @@ -0,0 +1,16 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Contracts.Responses.Favorites; + +/// +/// Represents a response that tells which of the checked media items are favorites of the current user. +/// +/// The Ids, among the checked ones, of the media items that are favorites of the current user. +[DebuggerDisplay("Favorited: {FavoritedMediaItemIds.Count}")] +public sealed record FavoriteStatusResponse( + IReadOnlyList FavoritedMediaItemIds +); diff --git a/src/Lumina.Contracts/Responses/Playlists/PlaylistResponse.cs b/src/Lumina.Contracts/Responses/Playlists/PlaylistResponse.cs index 7fd2a7dd..91b149d5 100644 --- a/src/Lumina.Contracts/Responses/Playlists/PlaylistResponse.cs +++ b/src/Lumina.Contracts/Responses/Playlists/PlaylistResponse.cs @@ -1,31 +1,29 @@ #region ========================================================================= USING ===================================================================================== +using Lumina.Contracts.Responses.Common; using Lumina.Domain.SharedKernel.Common.Enums.Playlists; using System; -using System.Collections.Generic; using System.Diagnostics; #endregion namespace Lumina.Contracts.Responses.Playlists; /// -/// Represents a response for a playlist together with its ordered entries. +/// Represents a response for a playlist together with a page of its ordered entries. /// /// The Id of the playlist. /// The name of the playlist. /// The description of the playlist, if applicable. /// The kind of media the playlist holds. -/// The ordered entries of the requested window of the playlist. -/// The number of entries the playlist holds, even when only a window of them is returned. +/// The ordered entries of the requested page of the playlist. /// The date and time when the playlist was created. /// The date and time when the playlist was last updated, if applicable. -[DebuggerDisplay("Id: {Id}; Name: {Name}; EntryCount: {EntryCount}; Window: {Entries.Count}")] +[DebuggerDisplay("Id: {Id}; Name: {Name}; Entries: {Entries.Count}")] public sealed record PlaylistResponse( Guid Id, string Name, string? Description, PlaylistType Type, - IReadOnlyList Entries, - int EntryCount, + PaginatedResponse Entries, DateTime CreatedOnUtc, DateTime? UpdatedOnUtc ); diff --git a/src/Lumina.DataAccess/Common/Configuration/FavoriteConfiguration.cs b/src/Lumina.DataAccess/Common/Configuration/FavoriteConfiguration.cs new file mode 100644 index 00000000..6e3c4449 --- /dev/null +++ b/src/Lumina.DataAccess/Common/Configuration/FavoriteConfiguration.cs @@ -0,0 +1,77 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.DataAccess.Entities.Favorites; +using Lumina.Application.Common.DataAccess.Entities.UsersManagement; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +#endregion + +namespace Lumina.DataAccess.Common.Configuration; + +/// +/// Configures the entity mapping for the entity. +/// +public class FavoriteConfiguration : IEntityTypeConfiguration +{ + /// + /// Configures the entity. + /// + /// The builder to be used to configure the entity. + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("Favorites"); + builder.HasKey(favorite => favorite.Id); + builder.Property(favorite => favorite.Id) + .ValueGeneratedNever() // because EF always tries to generate the value for the Id, and because we generate it as part of the aggregate root, we need to tell EF not to generate it + .HasColumnOrder(0); + + // A favorite belongs to the user that created it, and it is removed with that user. + builder.HasOne() + .WithMany() + .HasForeignKey(favorite => favorite.UserId) + .IsRequired() + .OnDelete(DeleteBehavior.Cascade); + + builder.Property(favorite => favorite.UserId) + .IsRequired() + .HasColumnOrder(1); + + builder.Property(favorite => favorite.MediaKind) + .IsRequired() + .HasConversion() + .HasMaxLength(20) + .HasColumnOrder(2); + + builder.Property(favorite => favorite.MediaItemId) + .IsRequired() + .HasColumnOrder(3); + + // Audit. + builder.Property(favorite => favorite.CreatedOnUtc) + .IsRequired() + .HasColumnOrder(4); + + builder.Property(favorite => favorite.CreatedBy) + .IsRequired() + .HasColumnOrder(5); + + builder.Property(favorite => favorite.UpdatedOnUtc) + .HasDefaultValue(null) + .HasColumnOrder(6); + + builder.Property(favorite => favorite.UpdatedBy) + .HasDefaultValue(null) + .HasColumnOrder(7); + + // The referenced media item is kept by kind and Id only, without a foreign key: one table serves every media kind, so no single table + // can be referenced, and a favorite survives the deletion of the item it references, so its owner can still see and remove it. + // The unique index makes the storage medium the owner of the "one favorite per user and item" invariant: a duplicate is rejected even + // when two concurrent adds both pass the existence check of the handler. + builder.HasIndex(favorite => new { favorite.UserId, favorite.MediaKind, favorite.MediaItemId }) + .IsUnique(); + + // Enable listing the favorites of a user from the most recently favorited: the first index serves the listing of every kind, and the second one serves the listing restricted to one media kind. + builder.HasIndex(favorite => new { favorite.UserId, favorite.CreatedOnUtc }); + + builder.HasIndex(favorite => new { favorite.UserId, favorite.MediaKind, favorite.CreatedOnUtc }); + } +} diff --git a/src/Lumina.DataAccess/Common/Migrations/20261021184608_AddsFavorites.Designer.cs b/src/Lumina.DataAccess/Common/Migrations/20261021184608_AddsFavorites.Designer.cs new file mode 100644 index 00000000..d02201cb --- /dev/null +++ b/src/Lumina.DataAccess/Common/Migrations/20261021184608_AddsFavorites.Designer.cs @@ -0,0 +1,3766 @@ +// +using System; +using Lumina.DataAccess.Core.UoW; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Lumina.DataAccess.Common.Migrations +{ + [DbContext(typeof(LuminaDbContext))] + [Migration("20261021184608_AddsFavorites")] + partial class AddsFavorites + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "10.0.11"); + + modelBuilder.Entity("AlbumGenres", b => + { + b.Property("AlbumId") + .HasColumnType("TEXT"); + + b.Property("GenreId") + .HasColumnType("TEXT"); + + b.HasKey("AlbumId", "GenreId"); + + b.HasIndex("GenreId"); + + b.ToTable("AlbumGenres", (string)null); + }); + + modelBuilder.Entity("AlbumTags", b => + { + b.Property("AlbumId") + .HasColumnType("TEXT"); + + b.Property("TagId") + .HasColumnType("TEXT"); + + b.HasKey("AlbumId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("AlbumTags", (string)null); + }); + + modelBuilder.Entity("ArtistGenres", b => + { + b.Property("ArtistId") + .HasColumnType("TEXT"); + + b.Property("GenreId") + .HasColumnType("TEXT"); + + b.HasKey("ArtistId", "GenreId"); + + b.HasIndex("GenreId"); + + b.ToTable("ArtistGenres", (string)null); + }); + + modelBuilder.Entity("ArtistTags", b => + { + b.Property("ArtistId") + .HasColumnType("TEXT"); + + b.Property("TagId") + .HasColumnType("TEXT"); + + b.HasKey("ArtistId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("ArtistTags", (string)null); + }); + + modelBuilder.Entity("BookGenres", b => + { + b.Property("BookId") + .HasColumnType("TEXT"); + + b.Property("GenreId") + .HasColumnType("TEXT"); + + b.HasKey("BookId", "GenreId"); + + b.HasIndex("GenreId"); + + b.ToTable("BookGenres", (string)null); + }); + + modelBuilder.Entity("BookTags", b => + { + b.Property("BookId") + .HasColumnType("TEXT"); + + b.Property("TagId") + .HasColumnType("TEXT"); + + b.HasKey("BookId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("BookTags", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.PermissionEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("PermissionName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.HasKey("Id"); + + b.ToTable("Permissions", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.RoleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.HasKey("Id"); + + b.ToTable("Roles", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.RolePermissionEntity", b => + { + b.Property("RoleId") + .HasColumnType("TEXT"); + + b.Property("PermissionId") + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.HasKey("RoleId", "PermissionId"); + + b.HasIndex("PermissionId"); + + b.HasIndex("RoleId", "PermissionId") + .IsUnique(); + + b.ToTable("RolePermissions", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.UserPermissionEntity", b => + { + b.Property("UserId") + .HasColumnType("TEXT"); + + b.Property("PermissionId") + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.HasKey("UserId", "PermissionId"); + + b.HasIndex("PermissionId"); + + b.HasIndex("UserId", "PermissionId") + .IsUnique(); + + b.ToTable("UserPermissions", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.UserRoleEntity", b => + { + b.Property("UserId") + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("RoleId") + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.HasKey("UserId"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId", "RoleId") + .IsUnique(); + + b.ToTable("UserRoles", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Common.GenreEntity", b => + { + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Name"); + + b.ToTable("Genres", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Common.TagEntity", b => + { + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Name"); + + b.ToTable("Tags", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Favorites.FavoriteEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("MediaItemId") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("MediaKind") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("UserId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("UserId", "CreatedOnUtc"); + + b.HasIndex("UserId", "MediaKind", "CreatedOnUtc"); + + b.HasIndex("UserId", "MediaKind", "MediaItemId") + .IsUnique(); + + b.ToTable("Favorites", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaContributors.MediaContributorEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("Biography") + .HasMaxLength(2000) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("DateOfBirth") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("DateOfDeath") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(1) + .UseCollation("NOCASE"); + + b.Property("LegalName") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.HasKey("Id"); + + b.HasIndex("DisplayName") + .IsUnique(); + + b.ToTable("MediaContributors", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumContributorEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("AlbumId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("MediaContributorId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("Role") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.HasKey("Id"); + + b.HasIndex("MediaContributorId"); + + b.HasIndex("AlbumId", "MediaContributorId", "Role") + .IsUnique(); + + b.ToTable("AlbumContributors", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("ASIN") + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(28); + + b.Property("ArtistId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("Barcode") + .HasMaxLength(13) + .HasColumnType("TEXT") + .HasColumnOrder(25); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(33); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(32); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("Disambiguation") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("Label") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(27); + + b.Property("LanguageCode") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.Property("LanguageName") + .HasColumnType("TEXT") + .HasColumnOrder(14); + + b.Property("LanguageNativeName") + .HasColumnType("TEXT") + .HasColumnOrder(15); + + b.Property("LastMetadataUpdateUtc") + .HasColumnType("TEXT") + .HasColumnOrder(37); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("MediaFormat") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(23); + + b.Property("MetadataProvider") + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(38); + + b.Property("MetadataStatus") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasDefaultValue("Pending") + .HasColumnOrder(36); + + b.Property("MusicBrainzReleaseArtistId") + .HasColumnType("TEXT") + .HasColumnOrder(31); + + b.Property("MusicBrainzReleaseGroupId") + .HasColumnType("TEXT") + .HasColumnOrder(30); + + b.Property("MusicBrainzReleaseId") + .HasColumnType("TEXT") + .HasColumnOrder(29); + + b.Property("OriginalLanguageCode") + .HasColumnType("TEXT") + .HasColumnOrder(16); + + b.Property("OriginalLanguageName") + .HasColumnType("TEXT") + .HasColumnOrder(17); + + b.Property("OriginalLanguageNativeName") + .HasColumnType("TEXT") + .HasColumnOrder(18); + + b.Property("OriginalReleaseDate") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("OriginalReleaseYear") + .HasColumnType("INTEGER") + .HasColumnOrder(8); + + b.Property("OriginalTitle") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("Packaging") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(24); + + b.Property("ReReleaseDate") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("ReReleaseYear") + .HasColumnType("INTEGER") + .HasColumnOrder(10); + + b.Property("ReleaseCountry") + .HasMaxLength(2) + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("ReleaseStatus") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(20); + + b.Property("ReleaseTitle") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(26); + + b.Property("ReleaseVersion") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("Script") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(19); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("TotalDiscs") + .HasColumnType("INTEGER") + .HasColumnOrder(21); + + b.Property("TotalTracks") + .HasColumnType("INTEGER") + .HasColumnOrder(22); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(35); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(34); + + b.HasKey("Id"); + + b.HasIndex("ArtistId", "Title"); + + b.HasIndex("LibraryId", "Title"); + + b.ToTable("Albums", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.ArtistContributorEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("ArtistId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("MediaContributorId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("Role") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.HasKey("Id"); + + b.HasIndex("MediaContributorId"); + + b.HasIndex("ArtistId", "MediaContributorId", "Role") + .IsUnique(); + + b.ToTable("ArtistContributors", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.ArtistEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("Country") + .HasMaxLength(2) + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(14); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.Property("Disambiguation") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("Gender") + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("IsEnded") + .HasColumnType("INTEGER") + .HasColumnOrder(10); + + b.Property("LastMetadataUpdateUtc") + .HasColumnType("TEXT") + .HasColumnOrder(18); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("LifeSpanBegin") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("LifeSpanEnd") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("MetadataProvider") + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(19); + + b.Property("MetadataStatus") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasDefaultValue("Pending") + .HasColumnOrder(17); + + b.Property("MusicBrainzArtistId") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("SortName") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("Type") + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(16); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(15); + + b.Property("Website") + .HasMaxLength(2048) + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.HasKey("Id"); + + b.HasIndex("LibraryId", "Name") + .IsUnique(); + + b.ToTable("Artists", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.MusicArtworkEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("ArtworkType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("ContentHash") + .HasColumnType("INTEGER") + .HasColumnOrder(6); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("FileName") + .HasMaxLength(2048) + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("LastUpdateUtc") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("Ordinal") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("OwnerId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("OwnerType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("Provider") + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.HasKey("Id"); + + b.HasIndex("Status"); + + b.HasIndex("OwnerType", "OwnerId", "ArtworkType", "Ordinal") + .IsUnique(); + + b.ToTable("MusicArtwork", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.MusicLibraryScanItemMetadataEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("AcoustId") + .HasMaxLength(64) + .HasColumnType("TEXT") + .HasColumnOrder(25); + + b.Property("ArtistName") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("AudioCodec") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(15); + + b.Property("BitDepth") + .HasColumnType("INTEGER") + .HasColumnOrder(14); + + b.Property("Bitrate") + .HasColumnType("INTEGER") + .HasColumnOrder(16); + + b.Property("Channels") + .HasColumnType("INTEGER") + .HasColumnOrder(13); + + b.Property("Container") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(31); + + b.Property("DiscNumber") + .HasColumnType("INTEGER") + .HasColumnOrder(10); + + b.Property("DurationInSeconds") + .HasColumnType("INTEGER") + .HasColumnOrder(11); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("LibraryScanId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.PrimitiveCollection("Moods") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(30); + + b.Property("MusicBrainzArtistId") + .HasColumnType("TEXT") + .HasColumnOrder(17); + + b.Property("MusicBrainzRecordingId") + .HasColumnType("TEXT") + .HasColumnOrder(21); + + b.Property("MusicBrainzReleaseArtistId") + .HasColumnType("TEXT") + .HasColumnOrder(18); + + b.Property("MusicBrainzReleaseGroupId") + .HasColumnType("TEXT") + .HasColumnOrder(19); + + b.Property("MusicBrainzReleaseId") + .HasColumnType("TEXT") + .HasColumnOrder(20); + + b.Property("MusicBrainzTrackId") + .HasColumnType("TEXT") + .HasColumnOrder(22); + + b.Property("MusicBrainzWorkId") + .HasColumnType("TEXT") + .HasColumnOrder(23); + + b.Property("Path") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("ReleaseName") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("ReleaseType") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("ReleaseYear") + .HasColumnType("INTEGER") + .HasColumnOrder(6); + + b.Property("ReplayGainAlbumGain") + .HasColumnType("decimal(8,2)") + .HasColumnOrder(28); + + b.Property("ReplayGainAlbumPeak") + .HasColumnType("decimal(8,6)") + .HasColumnOrder(29); + + b.Property("ReplayGainTrackGain") + .HasColumnType("decimal(8,2)") + .HasColumnOrder(26); + + b.Property("ReplayGainTrackPeak") + .HasColumnType("decimal(8,6)") + .HasColumnOrder(27); + + b.Property("SampleRate") + .HasColumnType("INTEGER") + .HasColumnOrder(12); + + b.Property("TrackNumber") + .HasColumnType("INTEGER") + .HasColumnOrder(9); + + b.Property("TrackTitle") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("WorkTitle") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(24); + + b.HasKey("Id"); + + b.HasIndex("LibraryScanId", "Path") + .IsUnique(); + + b.ToTable("MusicLibraryScanItemMetadata", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.MusicPlayRecordEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("AlbumId") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("ArtistId") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("EndedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("LastPositionMilliseconds") + .HasColumnType("INTEGER") + .HasColumnOrder(7); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("ListenedDurationMilliseconds") + .HasColumnType("INTEGER") + .HasColumnOrder(8); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("TrackId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(14); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.Property("UserId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("Version") + .IsConcurrencyToken() + .HasColumnType("INTEGER") + .HasColumnOrder(10); + + b.HasKey("Id"); + + b.HasIndex("TrackId"); + + b.HasIndex("UserId", "CreatedOnUtc"); + + b.ToTable("MusicPlayRecords", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.TrackContributorEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("MediaContributorId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("Role") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("TrackId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.HasKey("Id"); + + b.HasIndex("MediaContributorId"); + + b.HasIndex("TrackId", "MediaContributorId", "Role") + .IsUnique(); + + b.ToTable("TrackContributors", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.TrackEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("AcoustId") + .HasMaxLength(64) + .HasColumnType("TEXT") + .HasColumnOrder(44); + + b.Property("AlbumId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("AudioCodec") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(24); + + b.Property("BitDepth") + .HasColumnType("INTEGER") + .HasColumnOrder(23); + + b.Property("Bitrate") + .HasColumnType("INTEGER") + .HasColumnOrder(25); + + b.Property("Bpm") + .HasColumnType("INTEGER") + .HasColumnOrder(30); + + b.Property("Channels") + .HasColumnType("INTEGER") + .HasColumnOrder(22); + + b.Property("Container") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(49); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(38); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(37); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("Disambiguation") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("DiscNumber") + .HasColumnType("INTEGER") + .HasColumnOrder(27); + + b.Property("DurationInSeconds") + .HasColumnType("INTEGER") + .HasColumnOrder(20); + + b.Property("IsVideo") + .HasColumnType("INTEGER") + .HasColumnOrder(31); + + b.Property("Key") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(29); + + b.Property("LanguageCode") + .HasColumnType("TEXT") + .HasColumnOrder(14); + + b.Property("LanguageName") + .HasColumnType("TEXT") + .HasColumnOrder(15); + + b.Property("LanguageNativeName") + .HasColumnType("TEXT") + .HasColumnOrder(16); + + b.Property("LastMetadataUpdateUtc") + .HasColumnType("TEXT") + .HasColumnOrder(42); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("MetadataProvider") + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(43); + + b.Property("MetadataStatus") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasDefaultValue("Pending") + .HasColumnOrder(41); + + b.Property("MusicBrainzRecordingId") + .HasColumnType("TEXT") + .HasColumnOrder(34); + + b.Property("MusicBrainzTrackId") + .HasColumnType("TEXT") + .HasColumnOrder(35); + + b.Property("MusicBrainzWorkId") + .HasColumnType("TEXT") + .HasColumnOrder(36); + + b.Property("OriginalLanguageCode") + .HasColumnType("TEXT") + .HasColumnOrder(17); + + b.Property("OriginalLanguageName") + .HasColumnType("TEXT") + .HasColumnOrder(18); + + b.Property("OriginalLanguageNativeName") + .HasColumnType("TEXT") + .HasColumnOrder(19); + + b.Property("OriginalReleaseDate") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("OriginalReleaseYear") + .HasColumnType("INTEGER") + .HasColumnOrder(9); + + b.Property("OriginalTitle") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("Path") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("ReReleaseDate") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("ReReleaseYear") + .HasColumnType("INTEGER") + .HasColumnOrder(11); + + b.Property("ReleaseCountry") + .HasMaxLength(2) + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("ReleaseVersion") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.Property("ReplayGainAlbumGain") + .HasColumnType("decimal(8,2)") + .HasColumnOrder(47); + + b.Property("ReplayGainAlbumPeak") + .HasColumnType("decimal(8,6)") + .HasColumnOrder(48); + + b.Property("ReplayGainTrackGain") + .HasColumnType("decimal(8,2)") + .HasColumnOrder(45); + + b.Property("ReplayGainTrackPeak") + .HasColumnType("decimal(8,6)") + .HasColumnOrder(46); + + b.Property("SampleRate") + .HasColumnType("INTEGER") + .HasColumnOrder(21); + + b.Property("Script") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(28); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("TrackNumber") + .HasColumnType("INTEGER") + .HasColumnOrder(26); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(40); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(39); + + b.Property("WorkTitle") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(32); + + b.Property("WorkType") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(33); + + b.HasKey("Id"); + + b.HasIndex("AlbumId", "TrackNumber"); + + b.HasIndex("LibraryId", "Path") + .IsUnique(); + + b.ToTable("Tracks", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.DirectoryScanFingerprintEntity", b => + { + b.Property("LibraryId") + .HasColumnType("TEXT"); + + b.Property("Path") + .HasMaxLength(1024) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("LastWriteTimeUtc") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.HasKey("LibraryId", "Path"); + + b.HasIndex("LibraryId"); + + b.ToTable("DirectoryScanFingerprints", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("ArtworkProvidersConfigurationFingerprint") + .HasMaxLength(64) + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("CanDownloadMetadataFromWeb") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true) + .HasColumnOrder(6); + + b.Property("CoverImage") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("IsEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true) + .HasColumnOrder(4); + + b.Property("IsLocked") + .HasColumnType("INTEGER") + .HasColumnOrder(5); + + b.Property("LibraryType") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("MetadataProvidersConfigurationFingerprint") + .HasMaxLength(64) + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("PathTemplateFingerprint") + .HasMaxLength(64) + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("ShouldSaveMetadataInMediaDirectories") + .HasColumnType("INTEGER") + .HasColumnOrder(7); + + b.Property("ShouldSkipUnchangedDirectoriesDuringScan") + .HasColumnType("INTEGER") + .HasColumnOrder(8); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(15); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(14); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Libraries", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("LibraryId") + .HasColumnType("TEXT"); + + b.Property("Status") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("LibraryId", "Status", "CreatedOnUtc") + .IsDescending(true, false, true); + + b.ToTable("LibraryScans", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanResultEntity", b => + { + b.Property("LibraryScanId") + .HasColumnType("TEXT"); + + b.Property("Path") + .HasMaxLength(1024) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("ContentHash") + .HasMaxLength(24) + .HasColumnType("INTEGER") + .HasColumnOrder(2); + + b.Property("FileSize") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("Status") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("Ticks") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.HasKey("LibraryScanId", "Path"); + + b.HasIndex("Path"); + + b.HasIndex("ContentHash", "FileSize", "Path"); + + b.ToTable("LibraryScanResults", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanSnapshotEntity", b => + { + b.Property("LibraryId") + .HasColumnType("TEXT"); + + b.Property("Path") + .HasMaxLength(1024) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("ContentHash") + .HasColumnType("INTEGER") + .HasColumnOrder(2); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("FileSize") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("Ticks") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.HasKey("LibraryId", "Path"); + + b.HasIndex("LibraryId"); + + b.ToTable("LibraryScanSnapshots", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanStagingResultsEntity", b => + { + b.Property("LibraryScanId") + .HasColumnType("TEXT"); + + b.Property("Path") + .HasMaxLength(1024) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("ContentHash") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("IsNew") + .HasColumnType("INTEGER") + .HasColumnOrder(7); + + b.Property("NeedsRehash") + .HasColumnType("INTEGER") + .HasColumnOrder(6); + + b.Property("PreviousContentHash") + .HasColumnType("INTEGER") + .HasColumnOrder(5); + + b.Property("Size") + .HasColumnType("INTEGER") + .HasColumnOrder(2); + + b.Property("Ticks") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.HasKey("LibraryScanId", "Path"); + + b.HasIndex("LibraryScanId", "NeedsRehash"); + + b.ToTable("LibraryScanStagingResults", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookArtworkEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("ArtworkType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("BookId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("ContentHash") + .HasColumnType("INTEGER") + .HasColumnOrder(5); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("FileName") + .HasMaxLength(2048) + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("LastUpdateUtc") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("Ordinal") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("Provider") + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.HasKey("Id"); + + b.HasIndex("Status"); + + b.HasIndex("BookId", "ArtworkType", "Ordinal") + .IsUnique(); + + b.ToTable("BookArtwork", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookContributorEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("BookId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("MediaContributorId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("Role") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.HasKey("Id"); + + b.HasIndex("MediaContributorId"); + + b.HasIndex("BookId", "MediaContributorId", "Role") + .IsUnique(); + + b.ToTable("BookContributors", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("ASIN") + .HasMaxLength(10) + .HasColumnType("TEXT") + .HasColumnOrder(21); + + b.Property("AppleBooksId") + .HasColumnType("TEXT") + .HasColumnOrder(29); + + b.Property("BarnesAndNobleId") + .HasMaxLength(10) + .HasColumnType("TEXT") + .HasColumnOrder(28); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(33); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(32); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("Edition") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(19); + + b.Property("Format") + .HasColumnType("TEXT") + .HasColumnOrder(18); + + b.Property("GoodreadsId") + .HasColumnType("TEXT") + .HasColumnOrder(22); + + b.Property("GoogleBooksId") + .HasMaxLength(12) + .HasColumnType("TEXT") + .HasColumnOrder(27); + + b.Property("LCCN") + .HasColumnType("TEXT") + .HasColumnOrder(23); + + b.Property("LanguageCode") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("LanguageName") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("LanguageNativeName") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("LastMetadataUpdateUtc") + .HasColumnType("TEXT") + .HasColumnOrder(39); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(36); + + b.Property("LibraryThingId") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(26); + + b.Property("MetadataProvider") + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(40); + + b.Property("MetadataStatus") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(38); + + b.Property("OCLCNumber") + .HasColumnType("TEXT") + .HasColumnOrder(24); + + b.Property("OpenLibraryId") + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(25); + + b.Property("OriginalLanguageCode") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.Property("OriginalLanguageName") + .HasColumnType("TEXT") + .HasColumnOrder(14); + + b.Property("OriginalLanguageNativeName") + .HasColumnType("TEXT") + .HasColumnOrder(15); + + b.Property("OriginalReleaseDate") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("OriginalReleaseYear") + .HasColumnType("INTEGER") + .HasColumnOrder(5); + + b.Property("OriginalTitle") + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("PageCount") + .HasColumnType("INTEGER") + .HasColumnOrder(17); + + b.Property("Path") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("TEXT") + .HasColumnOrder(37); + + b.Property("Publisher") + .HasMaxLength(100) + .HasColumnType("TEXT") + .HasColumnOrder(16); + + b.Property("ReReleaseDate") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("ReReleaseYear") + .HasColumnType("INTEGER") + .HasColumnOrder(7); + + b.Property("ReleaseCountry") + .HasMaxLength(2) + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("ReleaseVersion") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(35); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(34); + + b.Property("VolumeNumber") + .HasColumnType("REAL") + .HasColumnOrder(20); + + b.HasKey("Id"); + + b.HasIndex("LibraryId", "MetadataStatus"); + + b.HasIndex("LibraryId", "Path") + .IsUnique(); + + b.ToTable("Books", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Playlists.PlaylistEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("EntryCount") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(0) + .HasColumnOrder(10); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("Type") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UserId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("Version") + .IsConcurrencyToken() + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(0L) + .HasColumnOrder(9); + + b.HasKey("Id"); + + b.HasIndex("UserId", "UpdatedOnUtc"); + + b.ToTable("Playlists", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Playlists.PlaylistEntryEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("MediaItemId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("MediaItemType") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("PlaylistId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("Position") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.HasKey("Id"); + + b.HasIndex("MediaItemId"); + + b.HasIndex("PlaylistId", "Position") + .IsUnique(); + + b.ToTable("PlaylistEntries", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Plugins.LibraryArtworkProviderConfigurationEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("IsEnabled") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("PluginId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("Rank") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.HasKey("Id"); + + b.HasIndex("LibraryId", "PluginId"); + + b.ToTable("LibraryArtworkProviderConfigurations", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Plugins.LibraryBookReaderConfigurationEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("IsEnabled") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("PluginId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.HasKey("Id"); + + b.HasIndex("LibraryId", "PluginId") + .IsUnique(); + + b.ToTable("LibraryBookReaderConfigurations", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Plugins.LibraryMetadataProviderConfigurationEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("IsEnabled") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("LibraryId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("PluginId") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("Rank") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.HasKey("Id"); + + b.HasIndex("LibraryId", "PluginId"); + + b.ToTable("LibraryMetadataProviderConfigurations", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Plugins.PluginEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("Author") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("Description") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("LoadError") + .HasMaxLength(2000) + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("LoadStatus") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("SettingsJson") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("Version") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.HasKey("Id"); + + b.ToTable("Plugins", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Scheduling.ScheduledJobEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("Hour") + .HasColumnType("INTEGER") + .HasColumnOrder(5); + + b.Property("IntervalMinutes") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("LastCompletedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("LastStartedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("Minute") + .HasColumnType("INTEGER") + .HasColumnOrder(6); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("OwnerUserId") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("ScheduleType") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("Status") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("TaskType") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(14); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.HasKey("Id"); + + b.HasIndex("Status"); + + b.ToTable("ScheduledJobs", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Scheduling.ScheduledJobExecutionEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CompletedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("IsCycleRun") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("ScheduledJobId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("StartedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("TaskType") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("WasCycleActive") + .HasColumnType("INTEGER") + .HasColumnOrder(6); + + b.HasKey("Id"); + + b.HasIndex("ScheduledJobId"); + + b.HasIndex("StartedOnUtc", "ScheduledJobId"); + + b.ToTable("ScheduledJobExecutions", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Scheduling.SchedulerDisplayPreferencesEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("DisplayTimeSpan") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("DisplayTimeUnit") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("JobTypeFilter") + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UserId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("UserId") + .IsUnique(); + + b.ToTable("SchedulerDisplayPreferences", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Themes.ThemeEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("Author") + .IsRequired() + .HasMaxLength(80) + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(12); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(11); + + b.Property("Description") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("InstallSource") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("InstalledAtUtc") + .HasColumnType("TEXT") + .HasColumnOrder(10); + + b.Property("IsCurrent") + .HasColumnType("INTEGER") + .HasColumnOrder(8); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(false) + .HasColumnOrder(9); + + b.Property("Name") + .IsRequired() + .HasMaxLength(80) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("PreviewPath") + .HasMaxLength(240) + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("ThemeId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(14); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(13); + + b.Property("Version") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.HasKey("Id"); + + b.HasIndex("IsCurrent") + .IsUnique() + .HasFilter("IsCurrent = 1"); + + b.HasIndex("ThemeId") + .IsUnique(); + + b.ToTable("Themes", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("Password") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("TempPassword") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("TempPasswordCreated") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("TotpSecret") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(9); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("Username") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("Users", (string)null); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserSettingsEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("IsGaplessPlaybackEnabled") + .HasColumnType("INTEGER") + .HasColumnOrder(16); + + b.Property("IsMuted") + .HasColumnType("INTEGER") + .HasColumnOrder(29); + + b.Property("IsPaginationEnabled") + .HasColumnType("INTEGER") + .HasColumnOrder(2); + + b.Property("IsThemeCachingEnabled") + .HasColumnType("INTEGER") + .HasColumnOrder(9); + + b.Property("ItemsPerPage") + .HasColumnType("INTEGER") + .HasColumnOrder(3); + + b.Property("ReplayGainMode") + .HasColumnType("INTEGER") + .HasColumnOrder(17); + + b.Property("ShouldAggregateArtworkWhenMissing") + .HasColumnType("INTEGER") + .HasColumnOrder(13); + + b.Property("ShouldAggregateMetadataWhenMissing") + .HasColumnType("INTEGER") + .HasColumnOrder(10); + + b.Property("ShouldAutoplay") + .HasColumnType("INTEGER") + .HasColumnOrder(15); + + b.Property("ShouldIgnoreThePrefixForAlphaPicker") + .HasColumnType("INTEGER") + .HasColumnOrder(4); + + b.Property("ShouldKeepDownloadingWhilePaused") + .HasColumnType("INTEGER") + .HasColumnOrder(14); + + b.Property("ShouldPreserveBookStyles") + .HasColumnType("INTEGER") + .HasColumnOrder(12); + + b.Property("ShouldRenderPdfAsImages") + .HasColumnType("INTEGER") + .HasColumnOrder(11); + + b.Property("StreamingQuality") + .HasColumnType("INTEGER") + .HasColumnOrder(18); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(8); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UserId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.Property("Volume") + .HasColumnType("REAL") + .HasColumnOrder(28); + + b.Property("VuMeterHighThreshold") + .HasColumnType("REAL") + .HasColumnOrder(23); + + b.Property("VuMeterMediumThreshold") + .HasColumnType("REAL") + .HasColumnOrder(22); + + b.Property("VuMeterOrientation") + .HasColumnType("INTEGER") + .HasColumnOrder(19); + + b.Property("VuMeterPeakHoldDurationInMilliseconds") + .HasColumnType("INTEGER") + .HasColumnOrder(25); + + b.Property("VuMeterPeakReleasePerSecond") + .HasColumnType("REAL") + .HasColumnOrder(27); + + b.Property("VuMeterReleasePerSecond") + .HasColumnType("REAL") + .HasColumnOrder(26); + + b.Property("VuMeterSegmentCount") + .HasColumnType("INTEGER") + .HasColumnOrder(20); + + b.Property("VuMeterSegmentGap") + .HasColumnType("INTEGER") + .HasColumnOrder(21); + + b.Property("VuMeterShowPeak") + .HasColumnType("INTEGER") + .HasColumnOrder(24); + + b.HasKey("Id"); + + b.HasIndex("UserId") + .IsUnique(); + + b.ToTable("UserSettings", (string)null); + }); + + modelBuilder.Entity("TrackGenres", b => + { + b.Property("TrackId") + .HasColumnType("TEXT"); + + b.Property("GenreId") + .HasColumnType("TEXT"); + + b.HasKey("TrackId", "GenreId"); + + b.HasIndex("GenreId"); + + b.ToTable("TrackGenres", (string)null); + }); + + modelBuilder.Entity("TrackTags", b => + { + b.Property("TrackId") + .HasColumnType("TEXT"); + + b.Property("TagId") + .HasColumnType("TEXT"); + + b.HasKey("TrackId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("TrackTags", (string)null); + }); + + modelBuilder.Entity("AlbumGenres", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumEntity", null) + .WithMany() + .HasForeignKey("AlbumId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Common.GenreEntity", null) + .WithMany() + .HasForeignKey("GenreId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("AlbumTags", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumEntity", null) + .WithMany() + .HasForeignKey("AlbumId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Common.TagEntity", null) + .WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ArtistGenres", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.ArtistEntity", null) + .WithMany() + .HasForeignKey("ArtistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Common.GenreEntity", null) + .WithMany() + .HasForeignKey("GenreId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ArtistTags", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.ArtistEntity", null) + .WithMany() + .HasForeignKey("ArtistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Common.TagEntity", null) + .WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BookGenres", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", null) + .WithMany() + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Common.GenreEntity", null) + .WithMany() + .HasForeignKey("GenreId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BookTags", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", null) + .WithMany() + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Common.TagEntity", null) + .WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.RolePermissionEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Authorization.PermissionEntity", "Permission") + .WithMany("RolePermissions") + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Authorization.RoleEntity", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Permission"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.UserPermissionEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Authorization.PermissionEntity", "Permission") + .WithMany("UserPermissions") + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", "User") + .WithMany("UserPermissions") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Permission"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.UserRoleEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Authorization.RoleEntity", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", "User") + .WithOne("UserRole") + .HasForeignKey("Lumina.Application.Common.DataAccess.Entities.Authorization.UserRoleEntity", "UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Favorites.FavoriteEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumContributorEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumEntity", null) + .WithMany("Contributors") + .HasForeignKey("AlbumId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.ArtistEntity", "Artist") + .WithMany("Albums") + .HasForeignKey("ArtistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumCatalogNumberEntity", "CatalogNumbers", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("AlbumId") + .HasColumnType("TEXT"); + + b1.Property("CatalogNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b1.HasKey("Id"); + + b1.HasIndex("AlbumId"); + + b1.ToTable("AlbumCatalogNumbers", (string)null); + + b1.WithOwner() + .HasForeignKey("AlbumId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AudioRatingEntity", "Ratings", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("AlbumId") + .HasColumnType("TEXT"); + + b1.Property("MaxValue") + .HasColumnType("decimal(3,2)"); + + b1.Property("Source") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b1.Property("Value") + .HasColumnType("decimal(3,2)"); + + b1.Property("VoteCount") + .HasColumnType("INTEGER"); + + b1.HasKey("Id"); + + b1.HasIndex("AlbumId"); + + b1.ToTable("AlbumRatings", (string)null); + + b1.WithOwner() + .HasForeignKey("AlbumId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumReleaseTypeEntity", "ReleaseTypes", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("AlbumId") + .HasColumnType("TEXT"); + + b1.Property("ReleaseType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b1.HasKey("Id"); + + b1.HasIndex("AlbumId"); + + b1.ToTable("AlbumReleaseTypes", (string)null); + + b1.WithOwner() + .HasForeignKey("AlbumId"); + }); + + b.Navigation("Artist"); + + b.Navigation("CatalogNumbers"); + + b.Navigation("Ratings"); + + b.Navigation("ReleaseTypes"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.ArtistContributorEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.ArtistEntity", null) + .WithMany("Contributors") + .HasForeignKey("ArtistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.ArtistEntity", b => + { + b.OwnsOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.MusicAreaEntity", "Area", b1 => + { + b1.Property("ArtistEntityId"); + + b1.Property("Disambiguation"); + + b1.Property("Iso3166Code"); + + b1.Property("MusicBrainzAreaId"); + + b1.Property("Name") + .IsRequired(); + + b1.Property("SortName"); + + b1.Property("Type"); + + b1.HasKey("ArtistEntityId"); + + b1.ToTable("Artists"); + + b1 + .ToJson("Area") + .HasColumnType("TEXT"); + + b1.WithOwner() + .HasForeignKey("ArtistEntityId"); + }); + + b.OwnsOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.MusicAreaEntity", "BeginArea", b1 => + { + b1.Property("ArtistEntityId"); + + b1.Property("Disambiguation"); + + b1.Property("Iso3166Code"); + + b1.Property("MusicBrainzAreaId"); + + b1.Property("Name") + .IsRequired(); + + b1.Property("SortName"); + + b1.Property("Type"); + + b1.HasKey("ArtistEntityId"); + + b1.ToTable("Artists"); + + b1 + .ToJson("BeginArea") + .HasColumnType("TEXT"); + + b1.WithOwner() + .HasForeignKey("ArtistEntityId"); + }); + + b.OwnsOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.MusicAreaEntity", "EndArea", b1 => + { + b1.Property("ArtistEntityId"); + + b1.Property("Disambiguation"); + + b1.Property("Iso3166Code"); + + b1.Property("MusicBrainzAreaId"); + + b1.Property("Name") + .IsRequired(); + + b1.Property("SortName"); + + b1.Property("Type"); + + b1.HasKey("ArtistEntityId"); + + b1.ToTable("Artists"); + + b1 + .ToJson("EndArea") + .HasColumnType("TEXT"); + + b1.WithOwner() + .HasForeignKey("ArtistEntityId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.ArtistAliasEntity", "Aliases", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("ArtistId") + .HasColumnType("TEXT"); + + b1.Property("BeginDate") + .HasColumnType("TEXT"); + + b1.Property("EndDate") + .HasColumnType("TEXT"); + + b1.Property("IsEnded") + .HasColumnType("INTEGER"); + + b1.Property("IsPrimary") + .HasColumnType("INTEGER"); + + b1.Property("Locale") + .HasMaxLength(20) + .HasColumnType("TEXT"); + + b1.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b1.Property("SortName") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b1.Property("Type") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b1.HasKey("Id"); + + b1.HasIndex("ArtistId"); + + b1.ToTable("ArtistAliases", (string)null); + + b1.WithOwner() + .HasForeignKey("ArtistId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AudioRatingEntity", "Ratings", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("ArtistId") + .HasColumnType("TEXT"); + + b1.Property("MaxValue") + .HasColumnType("decimal(3,2)"); + + b1.Property("Source") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b1.Property("Value") + .HasColumnType("decimal(3,2)"); + + b1.Property("VoteCount") + .HasColumnType("INTEGER"); + + b1.HasKey("Id"); + + b1.HasIndex("ArtistId"); + + b1.ToTable("ArtistRatings", (string)null); + + b1.WithOwner() + .HasForeignKey("ArtistId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.ArtistIpiEntity", "Ipis", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("ArtistId") + .HasColumnType("TEXT"); + + b1.Property("Value") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT"); + + b1.HasKey("Id"); + + b1.HasIndex("ArtistId"); + + b1.ToTable("ArtistIpis", (string)null); + + b1.WithOwner() + .HasForeignKey("ArtistId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.ArtistIsniEntity", "Isnis", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("ArtistId") + .HasColumnType("TEXT"); + + b1.Property("Value") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT"); + + b1.HasKey("Id"); + + b1.HasIndex("ArtistId"); + + b1.ToTable("ArtistIsnis", (string)null); + + b1.WithOwner() + .HasForeignKey("ArtistId"); + }); + + b.Navigation("Aliases"); + + b.Navigation("Area"); + + b.Navigation("BeginArea"); + + b.Navigation("EndArea"); + + b.Navigation("Ipis"); + + b.Navigation("Isnis"); + + b.Navigation("Ratings"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.TrackContributorEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.TrackEntity", null) + .WithMany("Contributors") + .HasForeignKey("TrackId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.TrackEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumEntity", "Album") + .WithMany("Tracks") + .HasForeignKey("AlbumId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AudioRatingEntity", "Ratings", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("MaxValue") + .HasColumnType("decimal(3,2)"); + + b1.Property("Source") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b1.Property("TrackId") + .HasColumnType("TEXT"); + + b1.Property("Value") + .HasColumnType("decimal(3,2)"); + + b1.Property("VoteCount") + .HasColumnType("INTEGER"); + + b1.HasKey("Id"); + + b1.HasIndex("TrackId"); + + b1.ToTable("TrackRatings", (string)null); + + b1.WithOwner() + .HasForeignKey("TrackId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.TrackIsrcEntity", "Isrcs", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("TrackId") + .HasColumnType("TEXT"); + + b1.Property("Value") + .IsRequired() + .HasMaxLength(12) + .HasColumnType("TEXT") + .HasColumnName("ISRC"); + + b1.HasKey("Id"); + + b1.HasIndex("TrackId"); + + b1.ToTable("TrackIsrcs", (string)null); + + b1.WithOwner() + .HasForeignKey("TrackId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.TrackMoodEntity", "Moods", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b1.Property("TrackId") + .HasColumnType("TEXT"); + + b1.HasKey("Id"); + + b1.HasIndex("TrackId"); + + b1.ToTable("TrackMoods", (string)null); + + b1.WithOwner() + .HasForeignKey("TrackId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.TrackWorkIswcEntity", "WorkIswcs", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("TrackId") + .HasColumnType("TEXT"); + + b1.Property("Value") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT"); + + b1.HasKey("Id"); + + b1.HasIndex("TrackId"); + + b1.ToTable("TrackWorkIswcs", (string)null); + + b1.WithOwner() + .HasForeignKey("TrackId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.TrackWorkLanguageEntity", "WorkLanguages", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("LanguageCode") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("TEXT"); + + b1.Property("LanguageName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b1.Property("NativeName") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b1.Property("TrackId") + .HasColumnType("TEXT"); + + b1.HasKey("Id"); + + b1.HasIndex("TrackId"); + + b1.ToTable("TrackWorkLanguages", (string)null); + + b1.WithOwner() + .HasForeignKey("TrackId"); + }); + + b.Navigation("Album"); + + b.Navigation("Isrcs"); + + b.Navigation("Moods"); + + b.Navigation("Ratings"); + + b.Navigation("WorkIswcs"); + + b.Navigation("WorkLanguages"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.DirectoryScanFingerprintEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", null) + .WithMany() + .HasForeignKey("LibraryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", "User") + .WithMany("Libraries") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryContentLocationEntity", "ContentLocations", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("LibraryId") + .HasColumnType("TEXT"); + + b1.Property("Path") + .IsRequired() + .HasMaxLength(260) + .HasColumnType("TEXT") + .HasColumnName("Path"); + + b1.HasKey("Id"); + + b1.HasIndex("LibraryId"); + + b1.ToTable("LibraryContentLocations", (string)null); + + b1.WithOwner() + .HasForeignKey("LibraryId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryPathTemplatePartEntity", "PathTemplateParts", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("IsOptional") + .HasColumnType("INTEGER"); + + b1.Property("Kind") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("TEXT"); + + b1.Property("LibraryId") + .HasColumnType("TEXT"); + + b1.Property("Position") + .HasColumnType("INTEGER") + .HasColumnName("Position"); + + b1.Property("Representation") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("TEXT"); + + b1.HasKey("Id"); + + b1.HasIndex("LibraryId", "Position") + .IsUnique(); + + b1.ToTable("LibraryPathTemplateParts", (string)null); + + b1.WithOwner() + .HasForeignKey("LibraryId"); + }); + + b.Navigation("ContentLocations"); + + b.Navigation("PathTemplateParts"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", "Library") + .WithMany("LibraryScans") + .HasForeignKey("LibraryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", "User") + .WithMany("LibraryScans") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Library"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanResultEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", "LibraryScan") + .WithMany("LibraryScanResults") + .HasForeignKey("LibraryScanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LibraryScan"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanSnapshotEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", "Library") + .WithMany() + .HasForeignKey("LibraryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Library"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanStagingResultsEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", null) + .WithMany() + .HasForeignKey("LibraryScanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookArtworkEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", null) + .WithMany("Artwork") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookContributorEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", null) + .WithMany("Contributors") + .HasForeignKey("BookId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", b => + { + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookRatingEntity", "Ratings", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("BookId") + .HasColumnType("TEXT"); + + b1.Property("MaxValue") + .HasColumnType("decimal(3,2)"); + + b1.Property("Source") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b1.Property("Value") + .HasColumnType("decimal(3,2)"); + + b1.Property("VoteCount") + .HasColumnType("INTEGER"); + + b1.HasKey("Id"); + + b1.HasIndex("BookId"); + + b1.ToTable("BookRatings", (string)null); + + b1.WithOwner() + .HasForeignKey("BookId"); + }); + + b.OwnsMany("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.IsbnEntity", "ISBNs", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b1.Property("BookId") + .HasColumnType("TEXT"); + + b1.Property("Format") + .IsRequired() + .HasMaxLength(6) + .HasColumnType("TEXT"); + + b1.Property("Value") + .IsRequired() + .HasMaxLength(13) + .HasColumnType("TEXT") + .HasColumnName("ISBN"); + + b1.HasKey("Id"); + + b1.HasIndex("BookId"); + + b1.ToTable("BookISBNs", (string)null); + + b1.WithOwner() + .HasForeignKey("BookId"); + }); + + b.Navigation("ISBNs"); + + b.Navigation("Ratings"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Playlists.PlaylistEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Playlists.PlaylistEntryEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Playlists.PlaylistEntity", null) + .WithMany("Entries") + .HasForeignKey("PlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserSettingsEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", null) + .WithOne() + .HasForeignKey("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserSettingsEntity", "UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("TrackGenres", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Common.GenreEntity", null) + .WithMany() + .HasForeignKey("GenreId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.TrackEntity", null) + .WithMany() + .HasForeignKey("TrackId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("TrackTags", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.Common.TagEntity", null) + .WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.TrackEntity", null) + .WithMany() + .HasForeignKey("TrackId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.PermissionEntity", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("UserPermissions"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Authorization.RoleEntity", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumEntity", b => + { + b.Navigation("Contributors"); + + b.Navigation("Tracks"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.ArtistEntity", b => + { + b.Navigation("Albums"); + + b.Navigation("Contributors"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.TrackEntity", b => + { + b.Navigation("Contributors"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryEntity", b => + { + b.Navigation("LibraryScans"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management.LibraryScanEntity", b => + { + b.Navigation("LibraryScanResults"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.WrittenContentLibrary.BookLibrary.BookEntity", b => + { + b.Navigation("Artwork"); + + b.Navigation("Contributors"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Playlists.PlaylistEntity", b => + { + b.Navigation("Entries"); + }); + + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", b => + { + b.Navigation("Libraries"); + + b.Navigation("LibraryScans"); + + b.Navigation("UserPermissions"); + + b.Navigation("UserRole"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Lumina.DataAccess/Common/Migrations/20261021184608_AddsFavorites.cs b/src/Lumina.DataAccess/Common/Migrations/20261021184608_AddsFavorites.cs new file mode 100644 index 00000000..697baf0b --- /dev/null +++ b/src/Lumina.DataAccess/Common/Migrations/20261021184608_AddsFavorites.cs @@ -0,0 +1,62 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Lumina.DataAccess.Common.Migrations +{ + /// + public partial class AddsFavorites : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Favorites", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + UserId = table.Column(type: "TEXT", nullable: false), + MediaKind = table.Column(type: "TEXT", maxLength: 20, nullable: false), + MediaItemId = table.Column(type: "TEXT", nullable: false), + CreatedOnUtc = table.Column(type: "TEXT", nullable: false), + CreatedBy = table.Column(type: "TEXT", nullable: false), + UpdatedOnUtc = table.Column(type: "TEXT", nullable: true), + UpdatedBy = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Favorites", x => x.Id); + table.ForeignKey( + name: "FK_Favorites_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_Favorites_UserId_CreatedOnUtc", + table: "Favorites", + columns: new[] { "UserId", "CreatedOnUtc" }); + + migrationBuilder.CreateIndex( + name: "IX_Favorites_UserId_MediaKind_CreatedOnUtc", + table: "Favorites", + columns: new[] { "UserId", "MediaKind", "CreatedOnUtc" }); + + migrationBuilder.CreateIndex( + name: "IX_Favorites_UserId_MediaKind_MediaItemId", + table: "Favorites", + columns: new[] { "UserId", "MediaKind", "MediaItemId" }, + unique: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Favorites"); + } + } +} diff --git a/src/Lumina.DataAccess/Common/Migrations/LuminaDbContextModelSnapshot.cs b/src/Lumina.DataAccess/Common/Migrations/LuminaDbContextModelSnapshot.cs index 07b59e53..e715d277 100644 --- a/src/Lumina.DataAccess/Common/Migrations/LuminaDbContextModelSnapshot.cs +++ b/src/Lumina.DataAccess/Common/Migrations/LuminaDbContextModelSnapshot.cs @@ -299,6 +299,54 @@ namespace Lumina.DataAccess.Common.Migrations b.ToTable("Tags", (string)null); }); + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Favorites.FavoriteEntity", b => + { + b.Property("Id") + .HasColumnType("TEXT") + .HasColumnOrder(0); + + b.Property("CreatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(5); + + b.Property("CreatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(4); + + b.Property("MediaItemId") + .HasColumnType("TEXT") + .HasColumnOrder(3); + + b.Property("MediaKind") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("TEXT") + .HasColumnOrder(2); + + b.Property("UpdatedBy") + .HasColumnType("TEXT") + .HasColumnOrder(7); + + b.Property("UpdatedOnUtc") + .HasColumnType("TEXT") + .HasColumnOrder(6); + + b.Property("UserId") + .HasColumnType("TEXT") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("UserId", "CreatedOnUtc"); + + b.HasIndex("UserId", "MediaKind", "CreatedOnUtc"); + + b.HasIndex("UserId", "MediaKind", "MediaItemId") + .IsUnique(); + + b.ToTable("Favorites", (string)null); + }); + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaContributors.MediaContributorEntity", b => { b.Property("Id") @@ -2839,6 +2887,15 @@ namespace Lumina.DataAccess.Common.Migrations b.Navigation("User"); }); + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.Favorites.FavoriteEntity", b => + { + b.HasOne("Lumina.Application.Common.DataAccess.Entities.UsersManagement.UserEntity", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumContributorEntity", b => { b.HasOne("Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary.AlbumEntity", null) diff --git a/src/Lumina.DataAccess/Core/Repositories/Favorites/FavoriteRepository.cs b/src/Lumina.DataAccess/Core/Repositories/Favorites/FavoriteRepository.cs new file mode 100644 index 00000000..9afaf0c8 --- /dev/null +++ b/src/Lumina.DataAccess/Core/Repositories/Favorites/FavoriteRepository.cs @@ -0,0 +1,403 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.DataAccess.Entities.Favorites; +using Lumina.Application.Common.DataAccess.Repositories.Favorites; +using Lumina.Application.Common.DTO.Favorites; +using Lumina.Application.Common.DTO.Pagination; +using Lumina.DataAccess.Core.UoW; +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; +using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using DomainErrors = Lumina.Domain.Common.Errors.Errors; +#endregion + +namespace Lumina.DataAccess.Core.Repositories.Favorites; + +/// +/// Repository for favorites. +/// +/// +/// A favorite references its media item by kind and Id without a foreign key, so reading a page of favorites resolves the display data of +/// the referenced items with one batched query per media kind present in the page, and a favorite whose item no longer exists is kept +/// without display data. Duplicate favorites of the same user on the same item are rejected by the unique (UserId, MediaKind, MediaItemId) index. +/// +internal sealed class FavoriteRepository : IFavoriteRepository +{ + private readonly LuminaDbContext _luminaDbContext; + + /// + /// Initializes a new instance of the class. + /// + /// Injected Entity Framework DbContext. + public FavoriteRepository(LuminaDbContext luminaDbContext) + { + _luminaDbContext = luminaDbContext; + } + + /// + /// Adds a new favorite. + /// + /// The favorite to add. + /// Cancellation token that can be used to stop the execution. + /// An representing either a successful operation, or an error. + public Task> InsertAsync(FavoriteEntity data, CancellationToken cancellationToken) + { + // The handler checks whether the user already favorited the item and creates a new favorite with a new Id, so this always adds a + // row. A retried or concurrent add that passed the handler's check is rejected by the unique (UserId, MediaKind, MediaItemId) + // index when the changes are saved, which is the only check that can observe another request's write. + _luminaDbContext.Favorites.Add(data); + return Task.FromResult>(Result.Created); + } + + /// + /// Deletes the favorite identified by . + /// + /// The Id of the favorite to delete. + /// Cancellation token that can be used to stop the execution. + /// An representing either a successful operation, or an error. + public async Task> DeleteByIdAsync(Guid id, CancellationToken cancellationToken) + { + // A handler may already have loaded the same favorite in this unit of work, so the tracked instance is preferred over materializing a second copy. + FavoriteEntity? favorite = _luminaDbContext.Favorites.Local.FirstOrDefault(trackedFavorite => trackedFavorite.Id == id); + favorite ??= await _luminaDbContext.Favorites.FirstOrDefaultAsync(foundFavorite => foundFavorite.Id == id, cancellationToken).ConfigureAwait(false); + if (favorite is null) + return DomainErrors.Favorites.FavoriteNotFound; + + _luminaDbContext.Favorites.Remove(favorite); + return Result.Deleted; + } + + /// + /// Gets the favorite of the user identified by on the media item identified by and , if it exists. + /// + /// The Id of the user the favorite must belong to. + /// The kind of the favorited media item. + /// The Id of the favorited media item. + /// Whether the retrieved entity should be tracked by the persistence medium, so that changes to it can be saved. + /// Cancellation token that can be used to stop the execution. + /// + /// An containing either the favorite, when the user has not favorited the media item, or an error. + /// + public async Task> GetByMediaItemIdForUserAsync(Guid userId, FavoriteMediaKind mediaKind, Guid mediaItemId, bool shouldTrackEntities = true, CancellationToken cancellationToken = default) + { + // The user is part of the filter rather than a check performed after the read, so the storage medium never returns a favorite that belongs to another user in the first place. + IQueryable query = _luminaDbContext.Favorites; + if (!shouldTrackEntities) + query = query.AsNoTracking(); + return await query + .FirstOrDefaultAsync(favorite => favorite.UserId == userId && favorite.MediaKind == mediaKind && favorite.MediaItemId == mediaItemId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the Id of the media library that contains the media item identified by and , if the media item exists. + /// + /// The kind of the media item. + /// The Id of the media item. + /// Cancellation token that can be used to stop the execution. + /// + /// An containing either the Id of the library that contains the media item, when the + /// media item does not exist or its kind has no catalogued library yet, or an error. + /// + public async Task> GetMediaItemLibraryIdAsync(FavoriteMediaKind mediaKind, Guid mediaItemId, CancellationToken cancellationToken) + { + // Only the library Id is projected, so the check never materializes the media item. The planned kinds have no catalogue table yet, so they have no library. + Guid? libraryId = mediaKind switch + { + FavoriteMediaKind.MusicArtist => await _luminaDbContext.Artists + .AsNoTracking() + .Where(artist => artist.Id == mediaItemId) + .Select(artist => (Guid?)artist.LibraryId) + .FirstOrDefaultAsync(cancellationToken).ConfigureAwait(false), + FavoriteMediaKind.MusicAlbum => await _luminaDbContext.Albums + .AsNoTracking() + .Where(album => album.Id == mediaItemId) + .Select(album => (Guid?)album.LibraryId) + .FirstOrDefaultAsync(cancellationToken).ConfigureAwait(false), + FavoriteMediaKind.MusicTrack => await _luminaDbContext.Tracks + .AsNoTracking() + .Where(track => track.Id == mediaItemId) + .Select(track => (Guid?)track.LibraryId) + .FirstOrDefaultAsync(cancellationToken).ConfigureAwait(false), + FavoriteMediaKind.Book => await _luminaDbContext.Books + .AsNoTracking() + .Where(book => book.Id == mediaItemId) + .Select(book => (Guid?)book.LibraryId) + .FirstOrDefaultAsync(cancellationToken).ConfigureAwait(false), + _ => null, + }; + return Result.Success(libraryId); + } + + /// + /// Gets the paginated favorites of the user identified by , from the most recently favorited, together with the display data of the media items they reference, + /// or all the matching favorites when the pagination data is . + /// + /// The Id of the user whose favorites are retrieved. + /// The kind of media item to restrict the favorites to, or for every kind. + /// The pagination data that includes the current page and the number of items per page to retrieve. If , all matching favorites are returned. + /// Whether the retrieved entities should be tracked by the persistence medium, so that changes to them can be saved. Pass for read-only scenarios, to avoid the tracking overhead. + /// Cancellation token that can be used to stop the execution. + /// An containing either a , or an error. + public async Task>> GetAllForUserAsync(Guid userId, FavoriteMediaKind? mediaKind, PaginationDataDto? paginationData = null, bool shouldTrackEntities = false, CancellationToken cancellationToken = default) + { + // The user is part of the filter rather than a check performed after the read, so the storage medium never returns a favorite that belongs to another user in the first place. + IQueryable favoritesQuery = _luminaDbContext.Favorites; + if (!shouldTrackEntities) + favoritesQuery = favoritesQuery.AsNoTracking(); + favoritesQuery = favoritesQuery.Where(favorite => favorite.UserId == userId); + if (mediaKind is not null) + { + FavoriteMediaKind kindFilter = mediaKind.Value; + favoritesQuery = favoritesQuery.Where(favorite => favorite.MediaKind == kindFilter); + } + + // The Id is the tiebreaker, so favorites created at the same instant keep a stable order between pages. + IOrderedQueryable orderedFavoritesQuery = favoritesQuery + .OrderByDescending(favorite => favorite.CreatedOnUtc) + .ThenBy(favorite => favorite.Id); + + // If no pagination was requested, return all the favorites of the user. + if (paginationData is null) + { + IReadOnlyList allFavorites = await ToFavoriteItemsAsync(orderedFavoritesQuery, cancellationToken).ConfigureAwait(false); + return new PaginatedResultDto + { + Data = allFavorites, + CurrentPage = 1, + PerPage = allFavorites.Count, + Count = allFavorites.Count, + NumberOfPages = 1 + }; + } + + int count = await orderedFavoritesQuery.Select(favorite => favorite.Id).CountAsync(cancellationToken).ConfigureAwait(false); + int numberOfPages = (int)Math.Ceiling((double)count / paginationData.PerPage); + int currentPage = Math.Min(paginationData.CurrentPage, Math.Max(1, numberOfPages)); // Make sure current page doesn't exceed maximum number of pages. + + // Only the requested page is materialized, because a user can favorite any number of items. + IQueryable pageQuery = orderedFavoritesQuery + .Skip((currentPage - 1) * paginationData.PerPage) + .Take(paginationData.PerPage); + IReadOnlyList paginatedResult = await ToFavoriteItemsAsync(pageQuery, cancellationToken).ConfigureAwait(false); + + return new PaginatedResultDto + { + Data = paginatedResult, + CurrentPage = currentPage, + PerPage = paginationData.PerPage, + Count = count, + NumberOfPages = numberOfPages + }; + } + + /// + /// Reads the display data of the media items referenced by the favorites of , one query per media kind present. + /// + /// The query of the favorites to read the display data for. + /// Cancellation token that can be used to stop the execution. + /// The favorites together with the display data of the media items they reference. + private async Task> ToFavoriteItemsAsync(IQueryable favoritesQuery, CancellationToken cancellationToken) + { + List favorites = await favoritesQuery.ToListAsync(cancellationToken).ConfigureAwait(false); + + Dictionary> displayDataByKind = []; + foreach (IGrouping kindGroup in favorites.GroupBy(favorite => favorite.MediaKind)) + { + List mediaItemIds = [.. kindGroup.Select(favorite => favorite.MediaItemId).Distinct()]; + displayDataByKind[kindGroup.Key] = await GetDisplayDataAsync(kindGroup.Key, mediaItemIds, cancellationToken).ConfigureAwait(false); + } + + // A favorite whose item was deleted is kept with no display data, so its owner can still see and remove it instead of it silently disappearing. + List items = []; + foreach (FavoriteEntity favorite in favorites) + { + FavoriteItemDisplayDto? display = null; + if (displayDataByKind[favorite.MediaKind].TryGetValue(favorite.MediaItemId, out FavoriteItemDisplayDto? foundDisplay)) + display = foundDisplay; + items.Add(new FavoriteItemDto(favorite, display)); + } + return items; + } + + /// + /// Gets the Ids, among , of the media items of kind that the user identified by has favorited. + /// + /// The Id of the user whose favorites are checked. + /// The kind of the media items. + /// The Ids of the media items to check. + /// Cancellation token that can be used to stop the execution. + /// An containing either the subset of the Ids that are favorites of the user, or an error. + public async Task>> GetFavoritedMediaItemIdsForUserAsync(Guid userId, FavoriteMediaKind mediaKind, IReadOnlyCollection mediaItemIds, CancellationToken cancellationToken) + { + Guid[] requestedIds = [.. mediaItemIds]; + // The unique (UserId, MediaKind, MediaItemId) index serves this lookup, and the caller bounds the number of requested Ids. + IReadOnlyList favoritedIds = await _luminaDbContext.Favorites + .AsNoTracking() + .Where(favorite => favorite.UserId == userId && favorite.MediaKind == mediaKind && requestedIds.Contains(favorite.MediaItemId)) + .Select(favorite => favorite.MediaItemId) + .Distinct() + .ToListAsync(cancellationToken).ConfigureAwait(false); + return Result.From(favoritedIds); + } + + /// + /// Reads the display data of the media items of kind identified by in one query per bounded chunk. + /// + /// The kind of the media items. + /// The Ids of the media items whose display data is read. + /// Cancellation token that can be used to stop the execution. + /// The display data keyed by media item Id. A media item that no longer exists, or whose kind has no catalogue yet, is absent. + private async Task> GetDisplayDataAsync(FavoriteMediaKind mediaKind, IReadOnlyCollection mediaItemIds, CancellationToken cancellationToken) + { + if (mediaItemIds.Count == 0) + return []; + + // The lookup is split into bounded chunks, so even an unpaginated listing never exceeds the storage parameter limit. + const int LOOKUP_CHUNK_SIZE = 500; + List rows = []; + foreach (Guid[] chunk in mediaItemIds.Chunk(LOOKUP_CHUNK_SIZE)) + rows.AddRange(await GetDisplayRowsAsync(mediaKind, chunk, cancellationToken).ConfigureAwait(false)); + return rows.ToDictionary( + row => row.MediaItemId, + row => new FavoriteItemDisplayDto( + row.LibraryId, + row.Title, + row.CollectionId ?? Guid.Empty, + row.CollectionTitle ?? string.Empty, + row.CreatorId ?? Guid.Empty, + row.CreatorName ?? string.Empty, + row.CoverPath)); + } + + /// + /// Reads the display data of one bounded chunk of media items of kind in a single query. + /// + /// The kind of the media items. + /// The bounded chunk of media item Ids whose display data is read. + /// Cancellation token that can be used to stop the execution. + /// The display rows of the media items that exist. + private async Task> GetDisplayRowsAsync(FavoriteMediaKind mediaKind, Guid[] requestedIds, CancellationToken cancellationToken) + { + List rows; + switch (mediaKind) + { + case FavoriteMediaKind.MusicArtist: + // The cover of the artist is the cover artwork stored for it, if any, the same one the artist listing exposes. + rows = await _luminaDbContext.Artists + .AsNoTracking() + .Where(artist => requestedIds.Contains(artist.Id)) + .Select(artist => new DisplayRow( + artist.Id, + artist.LibraryId, + artist.Name, + null, + null, + null, + null, + _luminaDbContext.MusicArtwork + .Where(artwork => artwork.OwnerType == MusicArtworkOwnerType.Artist && artwork.OwnerId == artist.Id && artwork.ArtworkType == ArtworkType.Cover) + .Select(artwork => artwork.FileName) + .FirstOrDefault())) + .ToListAsync(cancellationToken).ConfigureAwait(false); + break; + case FavoriteMediaKind.MusicAlbum: + rows = await (from album in _luminaDbContext.Albums.AsNoTracking() + join artist in _luminaDbContext.Artists on album.ArtistId equals artist.Id + where requestedIds.Contains(album.Id) + select new DisplayRow( + album.Id, + album.LibraryId, + album.Title, + null, + null, + artist.Id, + artist.Name, + _luminaDbContext.MusicArtwork + .Where(artwork => artwork.OwnerType == MusicArtworkOwnerType.Album && artwork.OwnerId == album.Id && artwork.ArtworkType == ArtworkType.Cover) + .Select(artwork => artwork.FileName) + .FirstOrDefault())) + .ToListAsync(cancellationToken).ConfigureAwait(false); + break; + case FavoriteMediaKind.MusicTrack: + // The cover of a track is the one stored for its album, like in the playlist entries. + rows = await (from track in _luminaDbContext.Tracks.AsNoTracking() + join album in _luminaDbContext.Albums on track.AlbumId equals album.Id + join artist in _luminaDbContext.Artists on album.ArtistId equals artist.Id + where requestedIds.Contains(track.Id) + select new DisplayRow( + track.Id, + track.LibraryId, + track.Title, + album.Id, + album.Title, + artist.Id, + artist.Name, + _luminaDbContext.MusicArtwork + .Where(artwork => artwork.OwnerType == MusicArtworkOwnerType.Album && artwork.OwnerId == album.Id && artwork.ArtworkType == ArtworkType.Cover) + .Select(artwork => artwork.FileName) + .FirstOrDefault())) + .ToListAsync(cancellationToken).ConfigureAwait(false); + break; + case FavoriteMediaKind.Book: + // The book catalogue does not persist series yet, so a book has no collection. The creator is the first author by display name, + // the same author the book listing shows, and the Id is the tiebreaker between authors that share a display name. + rows = await _luminaDbContext.Books + .AsNoTracking() + .Where(book => requestedIds.Contains(book.Id)) + .Select(book => new DisplayRow( + book.Id, + book.LibraryId, + book.Title, + null, + null, + (from bookContributor in _luminaDbContext.BookContributors + join contributor in _luminaDbContext.MediaContributors on bookContributor.MediaContributorId equals contributor.Id + where bookContributor.BookId == book.Id && bookContributor.Role == MediaContributorRole.Author + orderby contributor.DisplayName, contributor.Id + select (Guid?)contributor.Id).FirstOrDefault(), + (from bookContributor in _luminaDbContext.BookContributors + join contributor in _luminaDbContext.MediaContributors on bookContributor.MediaContributorId equals contributor.Id + where bookContributor.BookId == book.Id && bookContributor.Role == MediaContributorRole.Author + orderby contributor.DisplayName, contributor.Id + select contributor.DisplayName).FirstOrDefault(), + book.Artwork + .Where(artwork => artwork.ArtworkType == ArtworkType.Cover) + .Select(artwork => artwork.FileName) + .FirstOrDefault())) + .ToListAsync(cancellationToken).ConfigureAwait(false); + break; + default: + return []; + } + return rows; + } + + /// + /// The display data of one favorited media item as read from storage, before the absent values are normalized to the generic "no value" form. + /// + /// The Id of the media item. + /// The Id of the media library that contains the media item. + /// The title of the media item. + /// The Id of the collection that contains the media item, if any. + /// The title of the collection that contains the media item, if any. + /// The Id of the creator of the media item, if any. + /// The name of the creator of the media item, if any. + /// The path of the cover art of the media item, if available. + private sealed record DisplayRow( + Guid MediaItemId, + Guid LibraryId, + string Title, + Guid? CollectionId, + string? CollectionTitle, + Guid? CreatorId, + string? CreatorName, + string? CoverPath + ); +} diff --git a/src/Lumina.DataAccess/Core/Repositories/Playlists/PlaylistRepository.cs b/src/Lumina.DataAccess/Core/Repositories/Playlists/PlaylistRepository.cs index 66efd106..ee38ba94 100644 --- a/src/Lumina.DataAccess/Core/Repositories/Playlists/PlaylistRepository.cs +++ b/src/Lumina.DataAccess/Core/Repositories/Playlists/PlaylistRepository.cs @@ -3,6 +3,7 @@ using Dapper; using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary; using Lumina.Application.Common.DataAccess.Entities.Playlists; using Lumina.Application.Common.DataAccess.Repositories.Playlists; +using Lumina.Application.Common.DTO.Pagination; using Lumina.Application.Common.DTO.Playlists; using Lumina.DataAccess.Common.Persistence; using Lumina.DataAccess.Core.UoW; @@ -169,18 +170,17 @@ internal sealed class PlaylistRepository : IPlaylistRepository } /// - /// Gets the playlist identified by together with a window of the display details of the media items its entries reference, - /// when the playlist belongs to the user identified by . + /// Gets the playlist identified by together with a page of the display details of the media items its entries reference, + /// when the playlist belongs to the user identified by , or all the entries when the pagination data is . /// /// The Id of the playlist to get. /// The Id of the user the playlist must belong to. - /// The zero based position of the first entry to return. - /// The maximum number of entries to return in this window. + /// The pagination data that includes the current page and the number of items per page to retrieve. If , all matching entries are returned. /// Cancellation token that can be used to stop the execution. /// - /// An containing either the playlist details and its entry count, when no such playlist exists, or an error. + /// An containing either the playlist details and the paginated entries, when no such playlist exists, or an error. /// - public async Task> GetDetailsForUserAsync(Guid id, Guid userId, int offset, int limit, CancellationToken cancellationToken) + public async Task> GetDetailsForUserAsync(Guid id, Guid userId, PaginationDataDto? paginationData = null, CancellationToken cancellationToken = default) { // The user is part of the filter rather than a check performed after the read, so the storage medium never returns a playlist that belongs to another user in the first place. PlaylistEntity? playlist = await _luminaDbContext.Playlists @@ -189,16 +189,58 @@ internal sealed class PlaylistRepository : IPlaylistRepository if (playlist is null) return Result.Success(null); - // Only the requested window is materialized. A playlist can hold any number of entries, so the page never loads the whole list. - List windowEntries = await _luminaDbContext.PlaylistEntries + IQueryable entriesQuery = _luminaDbContext.PlaylistEntries .AsNoTracking() .Where(entry => entry.PlaylistId == id) - .OrderBy(entry => entry.Position) - .Skip(offset) - .Take(limit) - .ToListAsync(cancellationToken).ConfigureAwait(false); + .OrderBy(entry => entry.Position); - List trackIds = [.. windowEntries + // If no pagination was requested, return all the entries of the playlist. + if (paginationData is null) + { + IReadOnlyList allEntries = await ToPlaylistEntriesAsync(entriesQuery, offset: 0, cancellationToken).ConfigureAwait(false); + return new PlaylistDetailsDto(playlist, new PaginatedResultDto + { + Data = allEntries, + CurrentPage = 1, + PerPage = allEntries.Count, + Count = allEntries.Count, + NumberOfPages = 1 + }); + } + + int count = await entriesQuery.Select(entry => entry.Id).CountAsync(cancellationToken).ConfigureAwait(false); + int numberOfPages = (int)Math.Ceiling((double)count / paginationData.PerPage); + int currentPage = Math.Min(paginationData.CurrentPage, Math.Max(1, numberOfPages)); // Make sure current page doesn't exceed maximum number of pages. + int offset = (currentPage - 1) * paginationData.PerPage; + + // Only the requested page is materialized. A playlist can hold any number of entries, so the page never loads the whole list. + IQueryable pageQuery = entriesQuery + .Skip(offset) + .Take(paginationData.PerPage); + IReadOnlyList paginatedResult = await ToPlaylistEntriesAsync(pageQuery, offset, cancellationToken).ConfigureAwait(false); + + return new PlaylistDetailsDto(playlist, new PaginatedResultDto + { + Data = paginatedResult, + CurrentPage = currentPage, + PerPage = paginationData.PerPage, + Count = count, + NumberOfPages = numberOfPages + }); + } + + /// + /// Reads the display data of the tracks referenced by the entries of . + /// + /// The ordered query of the entries to read the display data for. + /// The zero based position of the first entry of the page, used to compute the dense display position. + /// Cancellation token that can be used to stop the execution. + /// The entries together with the display data of the tracks they reference. + private async Task> ToPlaylistEntriesAsync(IQueryable entriesQuery, int offset, CancellationToken cancellationToken) + { + List entries = await entriesQuery.ToListAsync(cancellationToken).ConfigureAwait(false); + + List trackIds = [.. entries .Where(entry => entry.MediaItemType == PlaylistMediaItemType.MusicTrack) .Select(entry => entry.MediaItemId) .Distinct()]; @@ -206,15 +248,14 @@ internal sealed class PlaylistRepository : IPlaylistRepository // An entry whose track was deleted is kept with no display data, so its owner can still see and remove it instead of it silently // disappearing from the playlist. The sparse order key is converted to a dense display position for the response. - List entries = []; - for (int index = 0; index < windowEntries.Count; index++) + List items = []; + for (int index = 0; index < entries.Count; index++) { - PlaylistEntryEntity entry = windowEntries[index]; + PlaylistEntryEntity entry = entries[index]; displayDataByTrackId.TryGetValue(entry.MediaItemId, out PlaylistEntryDisplayDto? displayData); - entries.Add(new PlaylistEntryDto(entry, displayData, offset + index)); + items.Add(new PlaylistEntryDto(entry, displayData, offset + index)); } - - return new PlaylistDetailsDto(playlist, entries); + return items; } /// diff --git a/src/Lumina.DataAccess/Core/UoW/LuminaDbContext.cs b/src/Lumina.DataAccess/Core/UoW/LuminaDbContext.cs index 2d383e42..2b6dd15c 100644 --- a/src/Lumina.DataAccess/Core/UoW/LuminaDbContext.cs +++ b/src/Lumina.DataAccess/Core/UoW/LuminaDbContext.cs @@ -1,5 +1,6 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Application.Common.DataAccess.Entities.Authorization; +using Lumina.Application.Common.DataAccess.Entities.Favorites; using Lumina.Application.Common.DataAccess.Entities.MediaContributors; using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management; using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary; @@ -53,6 +54,7 @@ public class LuminaDbContext : DbContext public virtual DbSet MusicPlayRecords { get; set; } = null!; public virtual DbSet Playlists { get; set; } = null!; public virtual DbSet PlaylistEntries { get; set; } = null!; + public virtual DbSet Favorites { get; set; } = null!; /// /// Initializes a new instance of the class. diff --git a/src/Lumina.DataAccess/Core/UoW/UnitOfWork.cs b/src/Lumina.DataAccess/Core/UoW/UnitOfWork.cs index a0eca8bd..cf9daed8 100644 --- a/src/Lumina.DataAccess/Core/UoW/UnitOfWork.cs +++ b/src/Lumina.DataAccess/Core/UoW/UnitOfWork.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Application.Common.DataAccess.Repositories.Authorization; using Lumina.Application.Common.DataAccess.Repositories.BookLibrary; +using Lumina.Application.Common.DataAccess.Repositories.Favorites; using Lumina.Application.Common.DataAccess.Repositories.MediaContributors; using Lumina.Application.Common.DataAccess.Repositories.MediaLibrary; using Lumina.Application.Common.DataAccess.Repositories.MusicLibrary; @@ -13,6 +14,7 @@ using Lumina.Application.Common.DataAccess.UoW; using Lumina.Application.Common.Errors; using Lumina.DataAccess.Core.Repositories.Authorization; using Lumina.DataAccess.Core.Repositories.BookLibrary; +using Lumina.DataAccess.Core.Repositories.Favorites; using Lumina.DataAccess.Core.Repositories.Libraries; using Lumina.DataAccess.Core.Repositories.MediaContributors; using Lumina.DataAccess.Core.Repositories.MusicLibrary; @@ -68,6 +70,7 @@ public class UnitOfWork : IUnitOfWork, IDisposable private IUserSettingsRepository? _userSettingsRepository; private IMusicPlayRecordRepository? _musicPlayRecordRepository; private IPlaylistRepository? _playlistRepository; + private IFavoriteRepository? _favoriteRepository; /// /// Gets the permission repository. @@ -402,6 +405,18 @@ public class UnitOfWork : IUnitOfWork, IDisposable } } + /// + /// Gets the favorite repository. + /// + public IFavoriteRepository FavoriteRepository + { + get + { + _favoriteRepository ??= new FavoriteRepository(_luminaDbContext); + return _favoriteRepository; + } + } + /// /// Initializes a new instance of the class. /// diff --git a/src/Lumina.Domain.SharedKernel/Common/Enums/Favorites/FavoriteMediaKind.cs b/src/Lumina.Domain.SharedKernel/Common/Enums/Favorites/FavoriteMediaKind.cs new file mode 100644 index 00000000..8f1a7260 --- /dev/null +++ b/src/Lumina.Domain.SharedKernel/Common/Enums/Favorites/FavoriteMediaKind.cs @@ -0,0 +1,42 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.SharedKernel.Common.Enums.Favorites; + +/// +/// Enumeration for the kinds of media item that can be marked as a favorite. +/// +[DebuggerDisplay("{ToString()}")] +public enum FavoriteMediaKind +{ + /// + /// A favorite that references an artist of a music library. + /// + MusicArtist, + + /// + /// A favorite that references an album of a music library. + /// + MusicAlbum, + + /// + /// A favorite that references a track of a music library. + /// + MusicTrack, + + /// + /// A favorite that references a book of a book library. + /// + Book, + + /// + /// A favorite that references a video file. Planned: video libraries are not catalogued yet, so this kind cannot be favorited. + /// + Video, + + /// + /// A favorite that references a photo. Planned: photo libraries are not catalogued yet, so this kind cannot be favorited. + /// + Photo, +} diff --git a/src/Lumina.Domain/Common/Errors/Errors.Favorite.cs b/src/Lumina.Domain/Common/Errors/Errors.Favorite.cs new file mode 100644 index 00000000..9d40ee8e --- /dev/null +++ b/src/Lumina.Domain/Common/Errors/Errors.Favorite.cs @@ -0,0 +1,22 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Primitives; +#endregion + +namespace Lumina.Domain.Common.Errors; + +/// +/// Favorite error types. +/// +public static partial class Errors +{ + public static class Favorites + { + public static Error FavoriteNotFound => Error.NotFound(description: nameof(FavoriteNotFound)); + public static Error FavoriteAlreadyExists => Error.Conflict(description: nameof(FavoriteAlreadyExists)); + public static Error FavoriteMediaKindIsInvalid => Error.Validation(description: nameof(FavoriteMediaKindIsInvalid)); + public static Error FavoriteMediaKindIsNotSupported => Error.Validation(description: nameof(FavoriteMediaKindIsNotSupported)); + public static Error FavoriteMediaItemIdCannotBeEmpty => Error.Validation(description: nameof(FavoriteMediaItemIdCannotBeEmpty)); + public static Error FavoriteMediaItemIdsCannotBeEmpty => Error.Validation(description: nameof(FavoriteMediaItemIdsCannotBeEmpty)); + public static Error FavoriteMediaItemIdsExceedMaximumCount => Error.Validation(description: nameof(FavoriteMediaItemIdsExceedMaximumCount)); + } +} diff --git a/src/Lumina.Domain/Common/Errors/Errors.Playlist.cs b/src/Lumina.Domain/Common/Errors/Errors.Playlist.cs index 0def7b24..01245db5 100644 --- a/src/Lumina.Domain/Common/Errors/Errors.Playlist.cs +++ b/src/Lumina.Domain/Common/Errors/Errors.Playlist.cs @@ -23,7 +23,5 @@ public static partial class Errors public static Error PlaylistEntryNotFound => Error.NotFound(description: nameof(PlaylistEntryNotFound)); public static Error PlaylistEntryPositionsAreInvalid => Error.Validation(description: nameof(PlaylistEntryPositionsAreInvalid)); public static Error PlaylistMoveTargetPositionIsInvalid => Error.Validation(description: nameof(PlaylistMoveTargetPositionIsInvalid)); - public static Error PlaylistEntryWindowOffsetIsInvalid => Error.Validation(description: nameof(PlaylistEntryWindowOffsetIsInvalid)); - public static Error PlaylistEntryWindowLimitIsInvalid => Error.Validation(description: nameof(PlaylistEntryWindowLimitIsInvalid)); } } diff --git a/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/ExternalIdentifiers/MediaLibraryBoundedContext/MediaItemAggregate/MediaItemId.cs b/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/ExternalIdentifiers/MediaLibraryBoundedContext/MediaItemAggregate/MediaItemId.cs new file mode 100644 index 00000000..ae51d775 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/ExternalIdentifiers/MediaLibraryBoundedContext/MediaItemAggregate/MediaItemId.cs @@ -0,0 +1,51 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Models.Core; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.ExternalIdentifiers.MediaLibraryBoundedContext.MediaItemAggregate; + +/// +/// Value Object for the Id of a media item, declared by the favorite bounded context to keep the reference to the catalogue decoupled. +/// +[DebuggerDisplay("{Value}")] +public sealed class MediaItemId : EntityId +{ + /// + /// Initializes a new instance of the class. + /// + /// The value representing this object. + private MediaItemId(Guid value) : base(value) + { + } + + /// + /// Creates a new instance of the class. + /// + /// The created instance. + public static MediaItemId CreateUnique() + { + return new MediaItemId(Guid.NewGuid()); + } + + /// + /// Creates a new instance of the class, from a pre-existing . + /// + /// The value used to create the instance. + /// The created instance. + public static MediaItemId Create(Guid value) + { + return new MediaItemId(value); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Value; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/ExternalIdentifiers/UserManagementBoundedContext/UserAggregate/UserId.cs b/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/ExternalIdentifiers/UserManagementBoundedContext/UserAggregate/UserId.cs new file mode 100644 index 00000000..c39f4000 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/ExternalIdentifiers/UserManagementBoundedContext/UserAggregate/UserId.cs @@ -0,0 +1,51 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Models.Core; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.ExternalIdentifiers.UserManagementBoundedContext.UserAggregate; + +/// +/// Value Object for the Id of a user, duplicated from the UserManagement bounded context to keep the cross bounded context references decoupled. +/// +[DebuggerDisplay("{Value}")] +public sealed class UserId : EntityId +{ + /// + /// Initializes a new instance of the class. + /// + /// The value representing this object. + private UserId(Guid value) : base(value) + { + } + + /// + /// Creates a new instance of the class. + /// + /// The created instance. + public static UserId CreateUnique() + { + return new UserId(Guid.NewGuid()); + } + + /// + /// Creates a new instance of the class, from a pre-existing . + /// + /// The value used to create the instance. + /// The created instance. + public static UserId Create(Guid value) + { + return new UserId(value); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Value; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/Events/FavoriteAddedDomainEvent.cs b/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/Events/FavoriteAddedDomainEvent.cs new file mode 100644 index 00000000..198eee38 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/Events/FavoriteAddedDomainEvent.cs @@ -0,0 +1,30 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Events; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.ExternalIdentifiers.MediaLibraryBoundedContext.MediaItemAggregate; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.ExternalIdentifiers.UserManagementBoundedContext.UserAggregate; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate.ValueObjects; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate.Events; + +/// +/// Domain event raised when a media item is marked as a favorite. +/// +/// The unique identifier of the domain event. +/// The unique identifier of the favorite. +/// The unique identifier of the user that favorited the media item. +/// The unique identifier of the favorited media item. +/// The kind of the favorited media item. +/// The date and time when the domain event occurred. +[DebuggerDisplay("FavoriteId: {FavoriteId.Value}; UserId: {UserId.Value}; MediaKind: {MediaKind}; MediaItemId: {MediaItemId.Value}")] +public record FavoriteAddedDomainEvent( + Guid Id, + FavoriteId FavoriteId, + UserId UserId, + MediaItemId MediaItemId, + FavoriteMediaKind MediaKind, + DateTime OccurredOnUtc +) : IDomainEvent; diff --git a/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/Events/FavoriteRemovedDomainEvent.cs b/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/Events/FavoriteRemovedDomainEvent.cs new file mode 100644 index 00000000..da91c20a --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/Events/FavoriteRemovedDomainEvent.cs @@ -0,0 +1,30 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Events; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.ExternalIdentifiers.MediaLibraryBoundedContext.MediaItemAggregate; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.ExternalIdentifiers.UserManagementBoundedContext.UserAggregate; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate.ValueObjects; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate.Events; + +/// +/// Domain event raised when a media item is removed from the favorites. +/// +/// The unique identifier of the domain event. +/// The unique identifier of the favorite. +/// The unique identifier of the user that owned the favorite. +/// The unique identifier of the media item that was unfavorited. +/// The kind of the media item that was unfavorited. +/// The date and time when the domain event occurred. +[DebuggerDisplay("FavoriteId: {FavoriteId.Value}; UserId: {UserId.Value}; MediaKind: {MediaKind}; MediaItemId: {MediaItemId.Value}")] +public record FavoriteRemovedDomainEvent( + Guid Id, + FavoriteId FavoriteId, + UserId UserId, + MediaItemId MediaItemId, + FavoriteMediaKind MediaKind, + DateTime OccurredOnUtc +) : IDomainEvent; diff --git a/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/Favorite.cs b/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/Favorite.cs new file mode 100644 index 00000000..a8b15f6e --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/Favorite.cs @@ -0,0 +1,163 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Errors; +using Lumina.Domain.Common.Models.Core; +using Lumina.Domain.Common.Primitives; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.ExternalIdentifiers.MediaLibraryBoundedContext.MediaItemAggregate; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.ExternalIdentifiers.UserManagementBoundedContext.UserAggregate; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate.Events; +using Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate.ValueObjects; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate; + +/// +/// Aggregate root for a favorite, the marker a user places on a media item. +/// +[DebuggerDisplay("Id: {Id.Value}; MediaKind: {MediaKind}; MediaItemId: {MediaItemId.Value}")] +public sealed class Favorite : AggregateRoot +{ + /// + /// Gets the object representing the unique identifier of the user that owns the favorite. + /// + public UserId UserId { get; private set; } + + /// + /// Gets the Id of the favorited media item. + /// + public MediaItemId MediaItemId { get; private set; } + + /// + /// Gets the kind of the favorited media item. + /// + public FavoriteMediaKind MediaKind { get; private set; } + + /// + /// Gets a value indicating whether the favorite was marked for removal in this unit of work. + /// + public bool IsRemoved { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + /// The object representing the unique identifier of the favorite. + /// The object representing the unique identifier of the user that owns the favorite. + /// The Id of the favorited media item. + /// The kind of the favorited media item. + /// The date and time when the favorite was created. + /// The date and time when the favorite was last updated. + private Favorite( + FavoriteId id, + UserId userId, + MediaItemId mediaItemId, + FavoriteMediaKind mediaKind, + DateTime createdOnUtc, + Optional updatedOnUtc) : base(id) + { + Id = id; + UserId = userId; + MediaItemId = mediaItemId; + MediaKind = mediaKind; + CreatedOnUtc = createdOnUtc; + UpdatedOnUtc = updatedOnUtc; + } + + /// + /// Creates a new favorite of the media item identified by for the user identified by . + /// + /// The object representing the unique identifier of the user that owns the favorite. + /// The Id of the media item to favorite. + /// The kind of the media item to favorite. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create(UserId userId, MediaItemId mediaItemId, FavoriteMediaKind mediaKind) + { + // A planned media kind is part of the model so the storage and the contracts are ready for it, but its items cannot be favorited until its library exists. + if (!IsSupported(mediaKind)) + return Errors.Favorites.FavoriteMediaKindIsNotSupported; + + DateTime occurredOnUtc = DateTime.UtcNow; + Favorite favorite = new( + FavoriteId.CreateUnique(), + userId, + mediaItemId, + mediaKind, + occurredOnUtc, + Optional.None()); + + favorite._domainEvents.Add(new FavoriteAddedDomainEvent( + Guid.NewGuid(), + favorite.Id, + userId, + mediaItemId, + mediaKind, + occurredOnUtc)); + return favorite; + } + + /// + /// Creates a new instance of the class, with pre-existing data. + /// + /// The object representing the unique identifier of the favorite. + /// The object representing the unique identifier of the user that owns the favorite. + /// The Id of the favorited media item. + /// The kind of the favorited media item. + /// The date and time when the favorite was created. + /// The date and time when the favorite was last updated. + /// + /// An containing either a successfully created , or an error message. + /// + public static Result Create( + FavoriteId id, + UserId userId, + MediaItemId mediaItemId, + FavoriteMediaKind mediaKind, + DateTime createdOnUtc, + Optional updatedOnUtc) + { + // A stored favorite is rehydrated as it was stored, whether or not its media kind is supported today. + return new Favorite(id, userId, mediaItemId, mediaKind, createdOnUtc, updatedOnUtc); + } + + /// + /// Marks the favorite as removed, raising the domain event that announces its removal. + /// + /// An representing either a successful operation, or an error. + public Result Remove() + { + if (IsRemoved) + return Result.Deleted; + + // Earlier events become irrelevant once the favorite is removed. + _domainEvents.Clear(); + IsRemoved = true; + _domainEvents.Add(new FavoriteRemovedDomainEvent( + Guid.NewGuid(), + Id, + UserId, + MediaItemId, + MediaKind, + DateTime.UtcNow)); + return Result.Deleted; + } + + /// + /// Determines whether media items of can be favorited today. + /// + /// The kind of media item. + /// if items of the media kind can be favorited, otherwise. + public static bool IsSupported(FavoriteMediaKind mediaKind) + { + return mediaKind switch + { + FavoriteMediaKind.MusicArtist => true, + FavoriteMediaKind.MusicAlbum => true, + FavoriteMediaKind.MusicTrack => true, + FavoriteMediaKind.Book => true, + _ => false + }; + } +} diff --git a/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/ValueObjects/FavoriteId.cs b/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/ValueObjects/FavoriteId.cs new file mode 100644 index 00000000..d2e89791 --- /dev/null +++ b/src/Lumina.Domain/Core/BoundedContexts/FavoriteBoundedContext/FavoriteAggregate/ValueObjects/FavoriteId.cs @@ -0,0 +1,51 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Domain.Common.Models.Core; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Domain.Core.BoundedContexts.FavoriteBoundedContext.FavoriteAggregate.ValueObjects; + +/// +/// Value Object for the Id of a favorite. +/// +[DebuggerDisplay("{Value}")] +public sealed class FavoriteId : EntityId +{ + /// + /// Initializes a new instance of the class. + /// + /// The value representing this object. + private FavoriteId(Guid value) : base(value) + { + } + + /// + /// Creates a new instance of the class. + /// + /// The created instance. + public static FavoriteId CreateUnique() + { + return new FavoriteId(Guid.NewGuid()); + } + + /// + /// Creates a new instance of the class, from a pre-existing . + /// + /// The value used to create the instance. + /// The created instance. + public static FavoriteId Create(Guid value) + { + return new FavoriteId(value); + } + + /// + /// Gets the list of items that define equality of the object. + /// + /// A list of items defining the equality. + public override IEnumerable GetEqualityComponents() + { + yield return Value; + } +} diff --git a/src/Lumina.Presentation.Api/Common/Routes/Favorites/ApiRoutes.Favorites.cs b/src/Lumina.Presentation.Api/Common/Routes/Favorites/ApiRoutes.Favorites.cs new file mode 100644 index 00000000..4b4c95f3 --- /dev/null +++ b/src/Lumina.Presentation.Api/Common/Routes/Favorites/ApiRoutes.Favorites.cs @@ -0,0 +1,18 @@ +namespace Lumina.Presentation.Api.Common.Routes.Favorites; + +/// +/// Class for the collection of the favorite routes of the API. +/// +public static partial class ApiRoutes +{ + /// + /// Routes for the favorites of the current user. + /// + public static class Favorites + { + public const string GET_FAVORITES = "/users/me/favorites"; + public const string ADD_FAVORITE = "/users/me/favorites"; + public const string REMOVE_FAVORITE = "/users/me/favorites/{mediaKind}/{mediaItemId}"; + public const string GET_FAVORITE_STATUS = "/users/me/favorites/status"; + } +} diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpoint.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpoint.cs new file mode 100644 index 00000000..c73555ea --- /dev/null +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpoint.cs @@ -0,0 +1,61 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.CQRS; +using Lumina.Application.Common.Mapping.Favorites; +using Lumina.Application.Core.Favorites.Commands.AddFavorite; +using Lumina.Contracts.Requests.Favorites; +using Lumina.Contracts.Responses.Favorites; +using Lumina.Domain.Common.Primitives; +using Lumina.Presentation.Api.Common.Routes.Favorites; +using Lumina.Presentation.Api.Core.Endpoints.Common; +using Microsoft.AspNetCore.Http; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Api.Core.Endpoints.Favorites.AddFavorite; + +/// +/// API endpoint for the /users/me/favorites route, for adding a favorite. +/// +/// +/// Uses "me" because it is always for the currently authenticated user. +/// +public class AddFavoriteEndpoint : BaseEndpoint +{ + private readonly ICommandHandler> _addFavoriteCommandHandler; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for handling add favorite commands. + public AddFavoriteEndpoint(ICommandHandler> addFavoriteCommandHandler) + { + _addFavoriteCommandHandler = addFavoriteCommandHandler; + } + + /// + /// Configures the API endpoint. + /// + public override void Configure() + { + Verbs(FastEndpoints.Http.POST); + Routes(ApiRoutes.Favorites.ADD_FAVORITE); + Version(1); + DontCatchExceptions(); + } + + /// + /// Marks a media item as a favorite of the current user. + /// + /// The request containing the kind and the Id of the media item to favorite. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(AddFavoriteRequest request, CancellationToken cancellationToken) + { + // The favorites belong to the authenticated user, so no intermediary may store any response of this route, including its problem + // responses, and every response varies by the bearer token that authorized it. + HttpContext.Response.Headers["Cache-Control"] = "private, no-store"; + HttpContext.Response.Headers["Vary"] = "Authorization"; + Result result = await _addFavoriteCommandHandler.HandleAsync(request.ToCommand(), cancellationToken).ConfigureAwait(false); + return result.Match(success => TypedResults.Ok(success), Problem); + } +} diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpointSummary.cs new file mode 100644 index 00000000..0acb9aa3 --- /dev/null +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpointSummary.cs @@ -0,0 +1,170 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Contracts.Requests.Favorites; +using Lumina.Contracts.Responses.Favorites; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Api.Core.Endpoints.Favorites.AddFavorite; + +/// +/// Class used for providing a textual description for the API endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class AddFavoriteEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public AddFavoriteEndpointSummary() + { + Summary = "Marks a media item as a favorite of the current user."; + Description = "Marks the media item identified by its kind and its Id as a favorite of the currently authenticated user. The supported kinds are MusicArtist, MusicAlbum, MusicTrack and Book. The kinds Video and Photo exist but are planned: they are rejected with a validation error until video and photo libraries are catalogued. The media item must exist and belong to a media library the current user can access; an item that does not exist and an item of a library the user cannot access are reported with the same not found error, so the response cannot be used to find out what another user holds. The operation is idempotent: adding an item that is already a favorite returns the existing favorite and changes nothing."; + + ExampleRequest = new AddFavoriteRequest( + MediaKind: FavoriteMediaKind.MusicTrack, + MediaItemId: Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f") + ); + RequestParam(request => request.MediaKind, "The kind of the media item to favorite. Required. One of MusicArtist, MusicAlbum, MusicTrack or Book."); + RequestParam(request => request.MediaItemId, "The Id of the media item to favorite. Required."); + + ResponseParam(response => response.Id, "The Id of the favorite."); + ResponseParam(response => response.MediaKind, "The kind of the favorited media item."); + ResponseParam(response => response.MediaItemId, "The Id of the favorited media item."); + ResponseParam(response => response.FavoritedOnUtc, "The date and time when the media item was favorited."); + + Response(200, "The media item is a favorite of the current user, and the favorite is returned.", + example: new FavoriteResponse( + Id: Guid.Parse("4d5e6f70-8192-4a3b-9c4d-5e6f708192a3"), + MediaKind: FavoriteMediaKind.MusicTrack, + MediaItemId: Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"), + FavoritedOnUtc: new DateTime(2026, 10, 21, 12, 0, 0, DateTimeKind.Utc) + ) + ); + + Response(401, "Authentication required.", "application/problem+json", + example: new[] + { + new + { + type = "https://tools.ietf.org/html/rfc7235#section-3.1", + status = 401, + title = "Unauthorized", + detail = "Authentication failed", + instance = "/api/v1/users/me/favorites" + }, + new + { + type = "https://tools.ietf.org/html/rfc7235#section-3.1", + status = 401, + title = "Unauthorized", + detail = "The token has expired", + instance = "/api/v1/users/me/favorites" + }, + new + { + type = "https://tools.ietf.org/html/rfc7235#section-3.1", + status = 401, + title = "Unauthorized", + detail = "The token is invalid", + instance = "/api/v1/users/me/favorites" + } + } + ); + + Response(403, "The request failed because the authenticated request does not carry the identity of a user.", "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/users/me/favorites", + traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00" + } + ); + + Response(404, "The request failed because the media item does not exist, or it belongs to a media library the current user cannot access. The error names the kind of the media item.", "application/problem+json", + example: new[] + { + new + { + type = "https://tools.ietf.org/html/rfc9110#section-15.5.5", + title = "General.NotFound", + status = 404, + detail = "ArtistNotFound", + instance = "/api/v1/users/me/favorites", + traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00" + }, + new + { + type = "https://tools.ietf.org/html/rfc9110#section-15.5.5", + title = "General.NotFound", + status = 404, + detail = "AlbumNotFound", + instance = "/api/v1/users/me/favorites", + traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00" + }, + new + { + type = "https://tools.ietf.org/html/rfc9110#section-15.5.5", + title = "General.NotFound", + status = 404, + detail = "TrackNotFound", + instance = "/api/v1/users/me/favorites", + traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00" + }, + new + { + type = "https://tools.ietf.org/html/rfc9110#section-15.5.5", + title = "General.NotFound", + status = 404, + detail = "BookNotFound", + instance = "/api/v1/users/me/favorites", + traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00" + } + } + ); + + Response(409, "The request failed because the favorite could not be stored, because the database is busy or locked. Repeating the request is safe.", "application/problem+json", + example: new[] + { + new + { + type = "https://tools.ietf.org/html/rfc9110#section-15.5.10", + title = "General.Conflict", + status = 409, + detail = "ConcurrencyConflict", + instance = "/api/v1/users/me/favorites", + 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/users/me/favorites", + errors = new Dictionary + { + { + "General.Validation", new[] + { + "FavoriteMediaKindIsInvalid", + "FavoriteMediaItemIdCannotBeEmpty", + "FavoriteMediaKindIsNotSupported" + } + } + }, + traceId = "00-2470be4248a2a5a0c6f70579975a6954-b9c3ba9544a03500-00" + } + ); + } +} diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpoint.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpoint.cs new file mode 100644 index 00000000..1f719ac1 --- /dev/null +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpoint.cs @@ -0,0 +1,61 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.CQRS; +using Lumina.Application.Common.Mapping.Favorites; +using Lumina.Application.Core.Favorites.Queries.GetFavoriteStatus; +using Lumina.Contracts.Requests.Favorites; +using Lumina.Contracts.Responses.Favorites; +using Lumina.Domain.Common.Primitives; +using Lumina.Presentation.Api.Common.Routes.Favorites; +using Lumina.Presentation.Api.Core.Endpoints.Common; +using Microsoft.AspNetCore.Http; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Api.Core.Endpoints.Favorites.GetFavoriteStatus; + +/// +/// API endpoint for the /users/me/favorites/status route. +/// +/// +/// Uses "me" because it is always for the currently authenticated user. +/// +public class GetFavoriteStatusEndpoint : BaseEndpoint +{ + private readonly IQueryHandler> _getFavoriteStatusQueryHandler; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for handling get favorite status queries. + public GetFavoriteStatusEndpoint(IQueryHandler> getFavoriteStatusQueryHandler) + { + _getFavoriteStatusQueryHandler = getFavoriteStatusQueryHandler; + } + + /// + /// Configures the API endpoint. + /// + public override void Configure() + { + Verbs(FastEndpoints.Http.GET); + Routes(ApiRoutes.Favorites.GET_FAVORITE_STATUS); + Version(1); + DontCatchExceptions(); + } + + /// + /// Finds out which media items of one kind are favorites of the current user. + /// + /// The request containing the media kind and the Ids of the media items to check. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(GetFavoriteStatusRequest request, CancellationToken cancellationToken) + { + // The favorites belong to the authenticated user, so no intermediary may store any response of this route, including its problem + // responses, and every response varies by the bearer token that authorized it. + HttpContext.Response.Headers["Cache-Control"] = "private, no-store"; + HttpContext.Response.Headers["Vary"] = "Authorization"; + Result result = await _getFavoriteStatusQueryHandler.HandleAsync(request.ToQuery(), cancellationToken).ConfigureAwait(false); + return result.Match(success => TypedResults.Ok(success), Problem); + } +} diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpointSummary.cs new file mode 100644 index 00000000..32d3bb79 --- /dev/null +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpointSummary.cs @@ -0,0 +1,112 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Contracts.Requests.Favorites; +using Lumina.Contracts.Responses.Favorites; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Api.Core.Endpoints.Favorites.GetFavoriteStatus; + +/// +/// Class used for providing a textual description for the API endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class GetFavoriteStatusEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public GetFavoriteStatusEndpointSummary() + { + Summary = "Finds out which media items are favorites of the current user."; + Description = "Checks up to 100 media items of one kind and returns the Ids, among the checked ones, that are favorites of the currently authenticated user. The media item Ids are sent by repeating the mediaItemIds query parameter once per Id, and the limit of 100 keeps the request line within the size limit of the server. Only the favorites of the current user are consulted, so the answer reveals nothing about the media items of other users. An Id that does not exist, or that is not a favorite, is simply absent from the answer."; + + ExampleRequest = new GetFavoriteStatusRequest( + MediaKind: FavoriteMediaKind.MusicTrack, + MediaItemIds: + [ + Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"), + Guid.Parse("a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d") + ] + ); + RequestParam(request => request.MediaKind, "The kind of the media items to check. Required. One of MusicArtist, MusicAlbum, MusicTrack or Book."); + RequestParam(request => request.MediaItemIds, "The Ids of the media items to check, from 1 to 100, sent as a repeated query parameter. Required."); + + ResponseParam(response => response.FavoritedMediaItemIds, "The Ids, among the checked ones, of the media items that are favorites of the current user."); + + Response(200, "The favorite status of the checked media items is returned.", + example: new FavoriteStatusResponse( + FavoritedMediaItemIds: [Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f")] + ) + ); + + Response(401, "Authentication required.", "application/problem+json", + example: new[] + { + new + { + type = "https://tools.ietf.org/html/rfc7235#section-3.1", + status = 401, + title = "Unauthorized", + detail = "Authentication failed", + instance = "/api/v1/users/me/favorites/status" + }, + new + { + type = "https://tools.ietf.org/html/rfc7235#section-3.1", + status = 401, + title = "Unauthorized", + detail = "The token has expired", + instance = "/api/v1/users/me/favorites/status" + }, + new + { + type = "https://tools.ietf.org/html/rfc7235#section-3.1", + status = 401, + title = "Unauthorized", + detail = "The token is invalid", + instance = "/api/v1/users/me/favorites/status" + } + } + ); + + Response(403, "The request failed because the authenticated request does not carry the identity of a user.", "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/users/me/favorites/status", + 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/users/me/favorites/status", + errors = new Dictionary + { + { + "General.Validation", new[] + { + "FavoriteMediaKindIsInvalid", + "FavoriteMediaItemIdsCannotBeEmpty", + "FavoriteMediaItemIdsExceedMaximumCount", + "FavoriteMediaItemIdCannotBeEmpty" + } + } + }, + traceId = "00-2470be4248a2a5a0c6f70579975a6954-b9c3ba9544a03500-00" + } + ); + } +} diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpoint.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpoint.cs new file mode 100644 index 00000000..23c60218 --- /dev/null +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpoint.cs @@ -0,0 +1,62 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.CQRS; +using Lumina.Application.Common.Mapping.Favorites; +using Lumina.Application.Core.Favorites.Queries.GetFavorites; +using Lumina.Contracts.Requests.Favorites; +using Lumina.Contracts.Responses.Common; +using Lumina.Contracts.Responses.Favorites; +using Lumina.Domain.Common.Primitives; +using Lumina.Presentation.Api.Common.Routes.Favorites; +using Lumina.Presentation.Api.Core.Endpoints.Common; +using Microsoft.AspNetCore.Http; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Api.Core.Endpoints.Favorites.GetFavorites; + +/// +/// API endpoint for the /users/me/favorites route, for getting the favorites. +/// +/// +/// Uses "me" because it is always for the currently authenticated user. +/// +public class GetFavoritesEndpoint : BaseEndpoint +{ + private readonly IQueryHandler>> _getFavoritesQueryHandler; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for handling get favorites queries. + public GetFavoritesEndpoint(IQueryHandler>> getFavoritesQueryHandler) + { + _getFavoritesQueryHandler = getFavoritesQueryHandler; + } + + /// + /// Configures the API endpoint. + /// + public override void Configure() + { + Verbs(FastEndpoints.Http.GET); + Routes(ApiRoutes.Favorites.GET_FAVORITES); + Version(1); + DontCatchExceptions(); + } + + /// + /// Gets a page of the favorites of the current user. + /// + /// The request containing the optional media kind filter and the page bounds. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(GetFavoritesRequest request, CancellationToken cancellationToken) + { + // The favorites belong to the authenticated user, so no intermediary may store any response of this route, including its problem + // responses, and every response varies by the bearer token that authorized it. + HttpContext.Response.Headers["Cache-Control"] = "private, no-store"; + HttpContext.Response.Headers["Vary"] = "Authorization"; + Result> result = await _getFavoritesQueryHandler.HandleAsync(request.ToQuery(), cancellationToken).ConfigureAwait(false); + return result.Match(success => TypedResults.Ok(success), Problem); + } +} diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpointSummary.cs new file mode 100644 index 00000000..34ebcc92 --- /dev/null +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpointSummary.cs @@ -0,0 +1,166 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Contracts.Requests.Favorites; +using Lumina.Contracts.Responses.Common; +using Lumina.Contracts.Responses.Favorites; +using Lumina.Domain.SharedKernel.Common.Enums.Favorites; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Api.Core.Endpoints.Favorites.GetFavorites; + +/// +/// Class used for providing a textual description for the API endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class GetFavoritesEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public GetFavoritesEndpointSummary() + { + Summary = "Gets the favorites of the current user."; + Description = "Gets the favorites of the currently authenticated user, from the most recently favorited, across every kind of media item or restricted to one kind. The currentPage and perPage query parameters select the page, and count reports the number of favorites that match the filter. When neither parameter is provided, every matching favorite is returned in a single page. Each favorite carries the display details of the media item it references: the title, the collection, the creator and the cover art. A favorite whose media item was deleted, or whose media library the user can no longer access, is still returned, with isAvailable set to false and empty display details, so the user can see it and remove it. A favorite of another user is never returned."; + + ExampleRequest = new GetFavoritesRequest( + MediaKind: FavoriteMediaKind.MusicTrack, + CurrentPage: 1, + PerPage: 200 + ); + RequestParam(request => request.MediaKind, "The kind of media item to restrict the favorites to. Optional; every kind is returned when omitted."); + RequestParam(request => request.CurrentPage, "The one based page of favorites to return. Optional; defaults to 1 when a page size is provided."); + RequestParam(request => request.PerPage, "The number of favorites per page. Optional; defaults to 200 when a page is provided. When both pagination parameters are omitted, every matching favorite is returned."); + + ResponseParam>(response => response.Data, "The favorites of the requested page, from the most recently favorited."); + ResponseParam>(response => response.CurrentPage, "The current page number."); + ResponseParam>(response => response.PerPage, "The number of favorites retrieved per page."); + ResponseParam>(response => response.Count, "The total number of favorites that match the filter."); + ResponseParam>(response => response.NumberOfPages, "The total number of pages."); + + ResponseParam(response => response.MediaKind, "The kind of the favorited media item."); + ResponseParam(response => response.MediaItemId, "The Id of the favorited media item."); + ResponseParam(response => response.IsAvailable, "Whether the media item still exists and its library is accessible to the current user."); + ResponseParam(response => response.LibraryId, "The Id of the media library that contains the media item."); + ResponseParam(response => response.Title, "The title of the media item."); + ResponseParam(response => response.CollectionId, "The Id of the collection that contains the media item, or the empty Guid when there is none."); + ResponseParam(response => response.CollectionTitle, "The title of the collection that contains the media item, or an empty string when there is none."); + ResponseParam(response => response.CreatorId, "The Id of the creator of the media item, or the empty Guid when there is none."); + ResponseParam(response => response.CreatorName, "The name of the creator of the media item, or an empty string when there is none."); + ResponseParam(response => response.CoverPath, "The path of the cover art of the media item, if available."); + + Response(200, "The favorites of the current user are returned.", + example: new PaginatedResponse + { + Data = + [ + new FavoriteItemResponse( + MediaKind: FavoriteMediaKind.MusicTrack, + MediaItemId: Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"), + IsAvailable: true, + LibraryId: Guid.Parse("3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a"), + Title: "The Show Must Go On", + CollectionId: Guid.Parse("e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f"), + CollectionTitle: "Innuendo", + CreatorId: Guid.Parse("d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a"), + CreatorName: "Queen", + CoverPath: "/artwork/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/cover.jpg" + ), + new FavoriteItemResponse( + MediaKind: FavoriteMediaKind.Book, + MediaItemId: Guid.Parse("0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"), + IsAvailable: true, + LibraryId: Guid.Parse("6c7d8e9f-0a1b-4c2d-9e3f-4a5b6c7d8e9f"), + Title: "The Fellowship of the Ring", + CollectionId: Guid.Empty, + CollectionTitle: string.Empty, + CreatorId: Guid.Parse("8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b"), + CreatorName: "J. R. R. Tolkien", + CoverPath: "/artwork/books/0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/cover.jpg" + ), + new FavoriteItemResponse( + MediaKind: FavoriteMediaKind.MusicAlbum, + MediaItemId: Guid.Parse("9f0a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c"), + IsAvailable: false, + LibraryId: Guid.Empty, + Title: string.Empty, + CollectionId: Guid.Empty, + CollectionTitle: string.Empty, + CreatorId: Guid.Empty, + CreatorName: string.Empty, + CoverPath: null + ) + ], + CurrentPage = 1, + PerPage = 200, + Count = 3, + NumberOfPages = 1 + } + ); + + Response(401, "Authentication required.", "application/problem+json", + example: new[] + { + new + { + type = "https://tools.ietf.org/html/rfc7235#section-3.1", + status = 401, + title = "Unauthorized", + detail = "Authentication failed", + instance = "/api/v1/users/me/favorites" + }, + new + { + type = "https://tools.ietf.org/html/rfc7235#section-3.1", + status = 401, + title = "Unauthorized", + detail = "The token has expired", + instance = "/api/v1/users/me/favorites" + }, + new + { + type = "https://tools.ietf.org/html/rfc7235#section-3.1", + status = 401, + title = "Unauthorized", + detail = "The token is invalid", + instance = "/api/v1/users/me/favorites" + } + } + ); + + Response(403, "The request failed because the authenticated request does not carry the identity of a user.", "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/users/me/favorites", + 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/users/me/favorites", + errors = new Dictionary + { + { + "General.Validation", new[] + { + "FavoriteMediaKindIsInvalid" + } + } + }, + traceId = "00-2470be4248a2a5a0c6f70579975a6954-b9c3ba9544a03500-00" + } + ); + } +} diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpoint.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpoint.cs new file mode 100644 index 00000000..5cce0411 --- /dev/null +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpoint.cs @@ -0,0 +1,61 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Application.Common.CQRS; +using Lumina.Application.Core.Favorites.Commands.RemoveFavorite; +using Lumina.Domain.Common.Primitives; +using Lumina.Presentation.Api.Common.Routes.Favorites; +using Lumina.Presentation.Api.Core.Endpoints.Common; +using Microsoft.AspNetCore.Http; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Api.Core.Endpoints.Favorites.RemoveFavorite; + +/// +/// API endpoint for the /users/me/favorites/{mediaKind}/{mediaItemId} route. +/// +/// +/// Uses "me" because it is always for the currently authenticated user. +/// +public class RemoveFavoriteEndpoint : BaseEndpoint +{ + private readonly ICommandHandler> _removeFavoriteCommandHandler; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for handling remove favorite commands. + public RemoveFavoriteEndpoint(ICommandHandler> removeFavoriteCommandHandler) + { + _removeFavoriteCommandHandler = removeFavoriteCommandHandler; + } + + /// + /// Configures the API endpoint. + /// + public override void Configure() + { + Verbs(FastEndpoints.Http.DELETE); + Routes(ApiRoutes.Favorites.REMOVE_FAVORITE); + Version(1); + DontCatchExceptions(); + } + + /// + /// Removes a media item from the favorites of the current user. + /// + /// The request object. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(FastEndpoints.EmptyRequest request, CancellationToken cancellationToken) + { + // The favorites belong to the authenticated user, so no intermediary may store any response of this route, including its problem + // responses, and every response varies by the bearer token that authorized it. + HttpContext.Response.Headers["Cache-Control"] = "private, no-store"; + HttpContext.Response.Headers["Vary"] = "Authorization"; + // Take the kind and the unique identifier of the media item from the route, as raw strings so the validator reports a clean error for an unparseable value. + string? mediaKind = HttpContext.Request.RouteValues["mediaKind"]?.ToString(); + string? mediaItemId = HttpContext.Request.RouteValues["mediaItemId"]?.ToString(); + Result result = await _removeFavoriteCommandHandler.HandleAsync(new RemoveFavoriteCommand(mediaKind, mediaItemId), cancellationToken).ConfigureAwait(false); + return result.Match(success => TypedResults.Ok(success), Problem); + } +} diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpointSummary.cs new file mode 100644 index 00000000..559e4b2a --- /dev/null +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpointSummary.cs @@ -0,0 +1,104 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Api.Core.Endpoints.Favorites.RemoveFavorite; + +/// +/// Class used for providing a textual description for the API endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class RemoveFavoriteEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public RemoveFavoriteEndpointSummary() + { + Summary = "Removes a media item from the favorites of the current user."; + Description = "Removes the media item identified by its kind and its Id from the favorites of the currently authenticated user. The kind is the name of a kind of media item, such as MusicTrack, and is matched without regard to case. The media item itself is never deleted. The favorite is always the one of the authenticated user, so this route can never remove another user's favorite. The media library of the item is deliberately not checked, so a user can always remove their own favorite whose item was deleted or is no longer accessible. Removing is idempotent: an item that is not a favorite of the user already has the desired state, so the request succeeds without changing anything and without raising an event."; + + Params["mediaKind"] = "The name of the kind of media item, matched case insensitively: MusicArtist, MusicAlbum, MusicTrack or Book."; + Params["mediaItemId"] = "The Id of the media item to remove from the favorites."; + + Response(200, "The media item was successfully removed from the favorites."); + + Response(401, "Authentication required.", "application/problem+json", + example: new[] + { + new + { + type = "https://tools.ietf.org/html/rfc7235#section-3.1", + status = 401, + title = "Unauthorized", + detail = "Authentication failed", + instance = "/api/v1/users/me/favorites/MusicTrack/9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f" + }, + new + { + type = "https://tools.ietf.org/html/rfc7235#section-3.1", + status = 401, + title = "Unauthorized", + detail = "The token has expired", + instance = "/api/v1/users/me/favorites/MusicTrack/9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f" + }, + new + { + type = "https://tools.ietf.org/html/rfc7235#section-3.1", + status = 401, + title = "Unauthorized", + detail = "The token is invalid", + instance = "/api/v1/users/me/favorites/MusicTrack/9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f" + } + } + ); + + Response(403, "The request failed because the authenticated request does not carry the identity of a user.", "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/users/me/favorites/MusicTrack/9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f", + traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00" + } + ); + + Response(409, "The request failed because the database is busy or locked, or the favorite was changed by another request in a way that could not be reconciled. Removing a favorite that another request removed first succeeds.", "application/problem+json", + example: new + { + type = "https://tools.ietf.org/html/rfc9110#section-15.5.10", + title = "General.Conflict", + status = 409, + detail = "ConcurrencyConflict", + instance = "/api/v1/users/me/favorites/MusicTrack/9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f", + 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/users/me/favorites/Unknown/not-a-guid", + errors = new Dictionary + { + { + "General.Validation", new[] + { + "FavoriteMediaKindIsInvalid", + "FavoriteMediaItemIdCannotBeEmpty" + } + } + }, + traceId = "00-2470be4248a2a5a0c6f70579975a6954-b9c3ba9544a03500-00" + } + ); + } +} diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Playlists/CreatePlaylist/CreatePlaylistEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Playlists/CreatePlaylist/CreatePlaylistEndpointSummary.cs index ac0d1a5e..0c5643f1 100644 --- a/src/Lumina.Presentation.Api/Core/Endpoints/Playlists/CreatePlaylist/CreatePlaylistEndpointSummary.cs +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Playlists/CreatePlaylist/CreatePlaylistEndpointSummary.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using FastEndpoints; using Lumina.Contracts.Requests.Playlists; +using Lumina.Contracts.Responses.Common; using Lumina.Contracts.Responses.Playlists; using Lumina.Domain.SharedKernel.Common.Enums.Playlists; using System; @@ -37,8 +38,7 @@ public class CreatePlaylistEndpointSummary : Summary(response => response.Name, "The name of the playlist."); ResponseParam(response => response.Description, "The description of the playlist, if applicable."); ResponseParam(response => response.Type, "The kind of media the playlist holds."); - ResponseParam(response => response.Entries, "The ordered entries of the playlist."); - ResponseParam(response => response.EntryCount, "The total number of entries the playlist holds, even when only a window of them is returned."); + ResponseParam(response => response.Entries, "The page of ordered entries of the playlist, with its pagination metadata."); ResponseParam(response => response.CreatedOnUtc, "The date and time when the playlist was created."); ResponseParam(response => response.UpdatedOnUtc, "The date and time when the playlist was last updated, if applicable."); @@ -48,8 +48,14 @@ public class CreatePlaylistEndpointSummary : Summary + { + Data = [], + CurrentPage = 1, + PerPage = 200, + Count = 0, + NumberOfPages = 0 + }, CreatedOnUtc: new DateTime(2026, 10, 21, 12, 0, 0, DateTimeKind.Utc), UpdatedOnUtc: null ) diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpoint.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpoint.cs index fbdf19e6..78a354fd 100644 --- a/src/Lumina.Presentation.Api/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpoint.cs +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpoint.cs @@ -1,5 +1,6 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Application.Common.CQRS; +using Lumina.Application.Common.Mapping.Playlists; using Lumina.Application.Core.Playlists.Queries.GetPlaylist; using Lumina.Contracts.Requests.Playlists; using Lumina.Contracts.Responses.Playlists; @@ -7,7 +8,6 @@ using Lumina.Domain.Common.Primitives; using Lumina.Presentation.Api.Common.Routes.Playlists; using Lumina.Presentation.Api.Core.Endpoints.Common; using Microsoft.AspNetCore.Http; -using System; using System.Threading; using System.Threading.Tasks; #endregion @@ -45,7 +45,7 @@ public class GetPlaylistEndpoint : BaseEndpoint } /// - /// Gets a window of the entries of a playlist of the current user. + /// Gets a page of the entries of a playlist of the current user. /// /// The request object. /// Cancellation token that can be used to stop the execution. @@ -57,12 +57,7 @@ public class GetPlaylistEndpoint : BaseEndpoint HttpContext.Response.Headers["Vary"] = "Authorization"; // Take the unique identifier from the route. string? playlistId = HttpContext.Request.RouteValues["playlistId"]?.ToString(); - int offset = request.Offset ?? 0; - // The limit bounds one response window, not the size of the playlist. Clamping it keeps a crafted limit from turning the - // windowed read into one unbounded response, while the handler still validates the value independently. - int limit = Math.Clamp(request.Limit ?? PlaylistWindow.DEFAULT_ENTRY_WINDOW_SIZE, 1, PlaylistWindow.MAXIMUM_ENTRY_WINDOW_SIZE); - Result result = await _getPlaylistQueryHandler - .HandleAsync(new GetPlaylistQuery(playlistId, offset, limit), cancellationToken).ConfigureAwait(false); + Result result = await _getPlaylistQueryHandler.HandleAsync(request.ToQuery(playlistId), cancellationToken).ConfigureAwait(false); return result.Match(success => TypedResults.Ok(success), Problem); } } diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpointSummary.cs index 32df1afd..b832ccb9 100644 --- a/src/Lumina.Presentation.Api/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpointSummary.cs +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpointSummary.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using FastEndpoints; using Lumina.Contracts.Requests.Playlists; +using Lumina.Contracts.Responses.Common; using Lumina.Contracts.Responses.Playlists; using Lumina.Domain.SharedKernel.Common.Enums.Playlists; using System; @@ -22,21 +23,20 @@ public class GetPlaylistEndpointSummary : Summary request.Offset, "The zero based position of the first entry to return. Optional; defaults to 0."); - RequestParam(request => request.Limit, "The maximum number of entries to return, from 1 to 1000. Optional; defaults to 200."); + RequestParam(request => request.CurrentPage, "The one based page of entries to return. Optional; defaults to 1 when a page size is provided."); + RequestParam(request => request.PerPage, "The number of entries per page. Optional; defaults to 200 when a page is provided. When both pagination parameters are omitted, every entry is returned."); ResponseParam(response => response.Id, "The Id of the playlist."); ResponseParam(response => response.Name, "The name of the playlist."); ResponseParam(response => response.Description, "The description of the playlist, if applicable."); ResponseParam(response => response.Type, "The kind of media the playlist holds."); - ResponseParam(response => response.Entries, "The ordered entries of the playlist."); - ResponseParam(response => response.EntryCount, "The total number of entries the playlist holds, even when only a window of them is returned."); + ResponseParam(response => response.Entries, "The page of ordered entries of the playlist, with its pagination metadata."); ResponseParam(response => response.CreatedOnUtc, "The date and time when the playlist was created."); ResponseParam(response => response.UpdatedOnUtc, "The date and time when the playlist was last updated, if applicable."); @@ -46,24 +46,30 @@ public class GetPlaylistEndpointSummary : Summary + { + Data = + [ + new PlaylistEntryResponse( + Id: Guid.Parse("2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d"), + MediaItemId: Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"), + MediaItemType: PlaylistMediaItemType.MusicTrack, + Position: 0, + LibraryId: Guid.Parse("3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a"), + CollectionId: Guid.Parse("e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f"), + CreatorId: Guid.Parse("d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a"), + MediaItemTitle: "The Show Must Go On", + CollectionTitle: "Innuendo", + CreatorName: "Queen", + DurationInSeconds: 262, + CoverPath: "/artwork/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/cover.jpg" + ) + ], + CurrentPage = 1, + PerPage = 200, + Count = 1, + NumberOfPages = 1 + }, CreatedOnUtc: new DateTime(2026, 10, 19, 18, 0, 0, DateTimeKind.Utc), UpdatedOnUtc: new DateTime(2026, 10, 19, 19, 30, 0, DateTimeKind.Utc) ) @@ -124,8 +130,7 @@ public class GetPlaylistEndpointSummary : SummaryN;4Z!0~#@-eH06ba%07sX9{{$76tgi$%e_U;I z<2I81epUA$Fy5(1-jQTaYBwM3(WD&DWHYy(mztMN?oz2UEJ6}visTZcY^|dIe%%d# z1VE6Io!zZESIyX>8V#V){qz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Ek z{waqKPZ|c%qUS;2wZk9@Fwz4h15I z{Ks4RU+m)w!3FxiYT}T8%_0B*iT~i9%l?aFf=iBos38AgEByzI^!OJH`G>+p1eYHH hJpupI2&IomMl=B6@$&yKib~+?BOoxQPbui}^nZ&N&A0#n diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDto.cs deleted file mode 100644 index 19cfaa36..00000000 --- a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDto.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using System.Collections.Generic; -using System.Diagnostics; -#endregion - -namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; - -/// -/// Data transfer object for a paginated collection of lightweight album elements, together with pagination metadata. -/// -[DebuggerDisplay("CurrentPage: {CurrentPage}; Count: {Count}")] -public class PaginatedMusicAlbumLiteDto -{ - /// - /// Gets or sets the collection of lightweight album elements associated with this instance. - /// - public IReadOnlyList Data { get; set; } = []; - - /// - /// Gets or sets the current page number in a paginated collection. - /// - public int CurrentPage { get; set; } - - /// - /// Gets or sets the number of items to include per page in paginated results. - /// - public int PerPage { get; set; } - - /// - /// Gets or sets the total number of elements available in the paginated result set. - /// - public int Count { get; set; } - - /// - /// Gets or sets the total number of pages based on elements available in the result set and per page. - /// - public int NumberOfPages { get; set; } -} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicArtistLiteDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicArtistLiteDto.cs deleted file mode 100644 index 780e6638..00000000 --- a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicArtistLiteDto.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using System.Collections.Generic; -using System.Diagnostics; -#endregion - -namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; - -/// -/// Data transfer object for a paginated collection of lightweight music artist elements, together with pagination metadata. -/// -[DebuggerDisplay("CurrentPage: {CurrentPage}; Count: {Count}")] -public class PaginatedMusicArtistLiteDto -{ - /// - /// Gets or sets the collection of lightweight music artist elements associated with this instance. - /// - public IReadOnlyList Data { get; set; } = []; - - /// - /// Gets or sets the current page number in a paginated collection. - /// - public int CurrentPage { get; set; } - - /// - /// Gets or sets the number of items to include per page in paginated results. - /// - public int PerPage { get; set; } - - /// - /// Gets or sets the total number of elements available in the paginated result set. - /// - public int Count { get; set; } - - /// - /// Gets or sets the total number of pages based on elements available in the result set and per page. - /// - public int NumberOfPages { get; set; } -} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicTrackLiteDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicTrackLiteDto.cs deleted file mode 100644 index 6c112daa..00000000 --- a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicTrackLiteDto.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using System.Collections.Generic; -using System.Diagnostics; -#endregion - -namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; - -/// -/// Data transfer object for a paginated collection of lightweight track elements, together with pagination metadata. -/// -[DebuggerDisplay("CurrentPage: {CurrentPage}; Count: {Count}")] -public class PaginatedMusicTrackLiteDto -{ - /// - /// Gets or sets the collection of lightweight track elements associated with this instance. - /// - public IReadOnlyList Data { get; set; } = []; - - /// - /// Gets or sets the current page number in a paginated collection. - /// - public int CurrentPage { get; set; } - - /// - /// Gets or sets the number of items to include per page in paginated results. - /// - public int PerPage { get; set; } - - /// - /// Gets or sets the total number of elements available in the paginated result set. - /// - public int Count { get; set; } - - /// - /// Gets or sets the total number of pages based on elements available in the result set and per page. - /// - public int NumberOfPages { get; set; } -} diff --git a/src/Lumina.Presentation.Web/Common/DTO/Common/PaginatedDto.cs b/src/Lumina.Presentation.Web/Common/DTO/Common/PaginatedDto.cs new file mode 100644 index 00000000..7973410c --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/Common/PaginatedDto.cs @@ -0,0 +1,24 @@ +#region ========================================================================= USING ===================================================================================== +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.Common; + +/// +/// Data transfer object for a page of elements together with its pagination metadata. +/// +/// The type of the elements of the page. +/// The elements of the requested page. +/// The one based number of the returned page. +/// The number of elements requested per page. +/// The total number of elements that match the filter, even when only a page of them is returned. +/// The total number of pages that match the filter. +[DebuggerDisplay("CurrentPage: {CurrentPage}; PerPage: {PerPage}; Count: {Count}")] +public sealed record PaginatedDto( + List Data, + int CurrentPage, + int PerPage, + int Count, + int NumberOfPages +); diff --git a/src/Lumina.Presentation.Web/Common/DTO/Favorites/FavoriteDto.cs b/src/Lumina.Presentation.Web/Common/DTO/Favorites/FavoriteDto.cs new file mode 100644 index 00000000..9030ed24 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/Favorites/FavoriteDto.cs @@ -0,0 +1,22 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Enums.Favorites; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.Favorites; + +/// +/// Data transfer object for a favorite of the current user. +/// +/// The Id of the favorite. +/// The kind of the favorited media item. +/// The Id of the favorited media item. +/// The date and time when the media item was favorited. +[DebuggerDisplay("Id: {Id}; MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")] +public sealed record FavoriteDto( + Guid Id, + FavoriteMediaKind MediaKind, + Guid MediaItemId, + DateTime FavoritedOnUtc +); diff --git a/src/Lumina.Presentation.Web/Common/DTO/Favorites/FavoriteItemDto.cs b/src/Lumina.Presentation.Web/Common/DTO/Favorites/FavoriteItemDto.cs new file mode 100644 index 00000000..337abd18 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/Favorites/FavoriteItemDto.cs @@ -0,0 +1,34 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Enums.Favorites; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.Favorites; + +/// +/// Data transfer object for a favorite of the current user together with the display details of the media item it references. +/// +/// The kind of the favorited media item. +/// The Id of the favorited media item. +/// Whether the media item still exists and can be accessed by the user. When , every display field is empty. +/// The Id of the media library that contains the media item, or an empty Guid when the item is not available. +/// The title of the media item, or an empty string when the item is not available. +/// The Id of the collection that contains the media item, or an empty Guid when there is none. +/// The title of the collection that contains the media item, or an empty string when there is none. +/// The Id of the creator of the media item, or an empty Guid when there is none. +/// The name of the creator of the media item, or an empty string when there is none. +/// The path of the cover art of the media item, if available. +[DebuggerDisplay("MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")] +public sealed record FavoriteItemDto( + FavoriteMediaKind MediaKind, + Guid MediaItemId, + bool IsAvailable, + Guid LibraryId, + string Title, + Guid CollectionId, + string CollectionTitle, + Guid CreatorId, + string CreatorName, + string? CoverPath +); diff --git a/src/Lumina.Presentation.Web/Common/DTO/Favorites/FavoriteStatusDto.cs b/src/Lumina.Presentation.Web/Common/DTO/Favorites/FavoriteStatusDto.cs new file mode 100644 index 00000000..faf78733 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/Favorites/FavoriteStatusDto.cs @@ -0,0 +1,16 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.Favorites; + +/// +/// Data transfer object that tells which of the checked media items are favorites of the current user. +/// +/// The Ids, among the checked ones, of the media items that are favorites of the current user. +[DebuggerDisplay("Favorited: {FavoritedMediaItemIds.Count}")] +public sealed record FavoriteStatusDto( + List FavoritedMediaItemIds +); diff --git a/src/Lumina.Presentation.Web/Common/DTO/Libraries/PaginatedBookLiteDto.cs b/src/Lumina.Presentation.Web/Common/DTO/Libraries/PaginatedBookLiteDto.cs deleted file mode 100644 index 763276e0..00000000 --- a/src/Lumina.Presentation.Web/Common/DTO/Libraries/PaginatedBookLiteDto.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using System.Collections.Generic; -using System.Diagnostics; -#endregion - -namespace Lumina.Presentation.Web.Common.DTO.Libraries; - -/// -/// Data transfer object for a paginated collection of lightweight book elements, together with pagination metadata. -/// -[DebuggerDisplay("CurrentPage: {CurrentPage}; Count: {Count}")] -public class PaginatedBookLiteDto -{ - /// - /// Gets or sets the collection of lightweight book elements associated with this instance. - /// - public IReadOnlyList Data { get; set; } = []; - - /// - /// Gets or sets the current page number in a paginated collection. - /// - public int CurrentPage { get; set; } - - /// - /// Gets or sets the number of items to include per page in paginated results. - /// - public int PerPage { get; set; } - - /// - /// Gets or sets the total number of elements available in the paginated result set. - /// - public int Count { get; set; } - - /// - /// Gets or sets the total number of pages based on elements available in the result set and per page. - /// - public int NumberOfPages { get; set; } -} diff --git a/src/Lumina.Presentation.Web/Common/DTO/Playlists/PlaylistDto.cs b/src/Lumina.Presentation.Web/Common/DTO/Playlists/PlaylistDto.cs index e6c22402..8ce52ef0 100644 --- a/src/Lumina.Presentation.Web/Common/DTO/Playlists/PlaylistDto.cs +++ b/src/Lumina.Presentation.Web/Common/DTO/Playlists/PlaylistDto.cs @@ -1,21 +1,20 @@ #region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.Enums.Playlists; using System; -using System.Collections.Generic; using System.Diagnostics; #endregion namespace Lumina.Presentation.Web.Common.DTO.Playlists; /// -/// Data transfer object for a playlist together with its ordered entries. +/// Data transfer object for a playlist together with a page of its ordered entries. /// /// The Id of the playlist. /// The name of the playlist. /// The description of the playlist, if applicable. /// The kind of media the playlist holds. -/// The number of entries the playlist holds, even when only a window of them is returned. -/// The ordered entries of the requested window of the playlist. +/// The page of ordered entries of the playlist, together with its pagination metadata. /// The date and time when the playlist was created. /// The date and time when the playlist was last updated, if applicable. [DebuggerDisplay("Id: {Id}; Name: {Name}; Entries: {Entries.Count}")] @@ -24,8 +23,7 @@ public sealed record PlaylistDto( string Name, string? Description, PlaylistType Type, - int EntryCount, - List Entries, + PaginatedDto Entries, DateTime CreatedOnUtc, DateTime? UpdatedOnUtc ); diff --git a/src/Lumina.Presentation.Web/Common/Enums/Favorites/FavoriteMediaKind.cs b/src/Lumina.Presentation.Web/Common/Enums/Favorites/FavoriteMediaKind.cs new file mode 100644 index 00000000..c228ced0 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Enums/Favorites/FavoriteMediaKind.cs @@ -0,0 +1,42 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Enums.Favorites; + +/// +/// Enumeration for the kinds of media item that can be marked as a favorite. +/// +[DebuggerDisplay("{ToString()}")] +public enum FavoriteMediaKind +{ + /// + /// A favorite that references an artist of a music library. + /// + MusicArtist, + + /// + /// A favorite that references an album of a music library. + /// + MusicAlbum, + + /// + /// A favorite that references a track of a music library. + /// + MusicTrack, + + /// + /// A favorite that references a book of a book library. + /// + Book, + + /// + /// A favorite that references a video file. Planned: video libraries are not catalogued yet, so this kind cannot be favorited. + /// + Video, + + /// + /// A favorite that references a photo. Planned: photo libraries are not catalogued yet, so this kind cannot be favorited. + /// + Photo, +} diff --git a/src/Lumina.Presentation.Web/Common/Requests/Favorites/AddFavoriteRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Favorites/AddFavoriteRequest.cs new file mode 100644 index 00000000..23183831 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Favorites/AddFavoriteRequest.cs @@ -0,0 +1,18 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Enums.Favorites; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Favorites; + +/// +/// Represents a request for marking a media item as a favorite of the current user. +/// +/// The kind of the media item to favorite. Required. +/// The Id of the media item to favorite. Required. +[DebuggerDisplay("MediaKind: {MediaKind}; MediaItemId: {MediaItemId}")] +public record AddFavoriteRequest( + FavoriteMediaKind? MediaKind, + Guid? MediaItemId +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Favorites/GetFavoriteStatusRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Favorites/GetFavoriteStatusRequest.cs new file mode 100644 index 00000000..a01b9111 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Favorites/GetFavoriteStatusRequest.cs @@ -0,0 +1,19 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Enums.Favorites; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Favorites; + +/// +/// Represents a request for finding out which media items of one kind are favorites of the current user. +/// +/// The kind of the media items to check. Required. +/// The Ids of the media items to check, from 1 to 100. Required. +[DebuggerDisplay("MediaKind: {MediaKind}")] +public record GetFavoriteStatusRequest( + FavoriteMediaKind? MediaKind, + List? MediaItemIds +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Favorites/GetFavoritesRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Favorites/GetFavoritesRequest.cs new file mode 100644 index 00000000..baef0067 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Favorites/GetFavoritesRequest.cs @@ -0,0 +1,19 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Enums.Favorites; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Favorites; + +/// +/// Represents a request for getting a page of the favorites of the current user. +/// +/// The kind of media item to restrict the favorites to. Optional; every kind is returned when omitted. +/// The one based page of favorites to return. Optional; defaults to 1. +/// The number of favorites per page. Optional; defaults to 200. +[DebuggerDisplay("MediaKind: {MediaKind}; CurrentPage: {CurrentPage}; PerPage: {PerPage}")] +public record GetFavoritesRequest( + FavoriteMediaKind? MediaKind, + int? CurrentPage, + int? PerPage +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Playlists/GetPlaylistRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Playlists/GetPlaylistRequest.cs index 7f39ba2a..2ca534d2 100644 --- a/src/Lumina.Presentation.Web/Common/Requests/Playlists/GetPlaylistRequest.cs +++ b/src/Lumina.Presentation.Web/Common/Requests/Playlists/GetPlaylistRequest.cs @@ -5,12 +5,12 @@ using System.Diagnostics; namespace Lumina.Presentation.Web.Common.Requests.Playlists; /// -/// Represents a request for getting a window of the entries of a playlist of the current user. +/// Represents a request for getting a page of the entries of a playlist of the current user. /// -/// The zero based position of the first entry to return. Optional; defaults to 0. -/// The maximum number of entries to return, from 1 to 1000. Optional; defaults to 200. -[DebuggerDisplay("Offset: {Offset}; Limit: {Limit}")] +/// The one based page of entries to return. Optional; defaults to 1. +/// The number of entries per page. Optional; defaults to 200. +[DebuggerDisplay("CurrentPage: {CurrentPage}; PerPage: {PerPage}")] public record GetPlaylistRequest( - int? Offset, - int? Limit + int? CurrentPage, + int? PerPage ); diff --git a/src/Lumina.Presentation.Web/Common/Routes/ApiRoutes.Favorites.cs b/src/Lumina.Presentation.Web/Common/Routes/ApiRoutes.Favorites.cs new file mode 100644 index 00000000..5631c035 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Routes/ApiRoutes.Favorites.cs @@ -0,0 +1,18 @@ +namespace Lumina.Presentation.Web.Common.Routes; + +/// +/// Class for the collection of remote API routes called by this Web application. +/// +public static partial class ApiRoutes +{ + /// + /// Routes for the favorites endpoints of the remote API. + /// + public static class Favorites + { + public const string GET_FAVORITES = "users/me/favorites"; + public const string ADD_FAVORITE = "users/me/favorites"; + public const string REMOVE_FAVORITE = "users/me/favorites/{mediaKind}/{mediaItemId}"; + public const string GET_FAVORITE_STATUS = "users/me/favorites/status"; + } +} diff --git a/src/Lumina.Presentation.Web/Common/Routes/WebRoutes.Favorites.cs b/src/Lumina.Presentation.Web/Common/Routes/WebRoutes.Favorites.cs new file mode 100644 index 00000000..f9b59e20 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Routes/WebRoutes.Favorites.cs @@ -0,0 +1,19 @@ +namespace Lumina.Presentation.Web.Common.Routes; + +/// +/// Class for the collection of routes defined in the Web application. +/// +public static partial class WebRoutes +{ + /// + /// Routes for the favorites pages. + /// + public static class Favorites + { + public const string INDEX = "{culture}/favorites"; + public const string GET_FAVORITES = "{culture}/favorites/api-get-favorites"; + public const string GET_FAVORITE_STATUS = "{culture}/favorites/api-get-favorite-status"; + public const string ADD_FAVORITE = "{culture}/favorites/api-add-favorite"; + public const string REMOVE_FAVORITE = "{culture}/favorites/{mediaKind}/{mediaItemId}/api-remove-favorite"; + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpoint.cs new file mode 100644 index 00000000..e8c7e82e --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpoint.cs @@ -0,0 +1,55 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.Favorites; +using Lumina.Presentation.Web.Common.Requests.Favorites; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Common; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Favorites.AddFavorite; + +/// +/// API endpoint for the /{culture}/favorites/api-add-favorite route. +/// +public class AddFavoriteEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public AddFavoriteEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.POST); + Routes(WebRoutes.Favorites.ADD_FAVORITE); + DontAutoTag(); + Options(options => options.WithTags("Favorites")); + EnableAntiforgery(); + } + + /// + /// Marks a media item as a favorite of the current user. + /// + /// The request containing the kind and the Id of the media item to favorite. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(AddFavoriteRequest request, CancellationToken cancellationToken) + { + FavoriteDto favorite = await _apiHttpClient.PostAsync(ApiRoutes.Favorites.ADD_FAVORITE, request, cancellationToken).ConfigureAwait(false); + return JsonSuccess(favorite); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpointSummary.cs new file mode 100644 index 00000000..c4d7590b --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/AddFavorite/AddFavoriteEndpointSummary.cs @@ -0,0 +1,42 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.DTO.Favorites; +using Lumina.Presentation.Web.Common.Enums.Favorites; +using Lumina.Presentation.Web.Common.Requests.Favorites; +using System; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Favorites.AddFavorite; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class AddFavoriteEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public AddFavoriteEndpointSummary() + { + Summary = "Marks a media item as a favorite of the current user."; + Description = "Proxies the request that marks a media item as a favorite to the API server. Adding an item that is already a favorite is not an error: the existing favorite is returned."; + + ExampleRequest = new AddFavoriteRequest( + MediaKind: FavoriteMediaKind.MusicTrack, + MediaItemId: Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f") + ); + RequestParam(request => request.MediaKind, "The kind of the media item to favorite: MusicArtist, MusicAlbum, MusicTrack or Book. Required."); + RequestParam(request => request.MediaItemId, "The Id of the media item to favorite. Required."); + + Response(200, "The media item is a favorite and the favorite is returned.", + example: new SuccessResponse(true, new FavoriteDto( + Id: Guid.Parse("4b7a2c10-5d3e-4f68-9a1b-0c2d3e4f5a6b"), + MediaKind: FavoriteMediaKind.MusicTrack, + MediaItemId: Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"), + FavoritedOnUtc: new DateTime(2026, 10, 21, 9, 30, 0, DateTimeKind.Utc))) + ); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpoint.cs new file mode 100644 index 00000000..9da4de1a --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpoint.cs @@ -0,0 +1,72 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.Favorites; +using Lumina.Presentation.Web.Common.Requests.Favorites; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Common; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Favorites.GetFavoriteStatus; + +/// +/// API endpoint for the /{culture}/favorites/api-get-favorite-status route. +/// +public class GetFavoriteStatusEndpoint : BaseEndpoint +{ + // The API accepts at most 100 Ids per check, so one more is forwarded to let its validator report an oversized list. + private const int MAXIMUM_FORWARDED_MEDIA_ITEM_COUNT = 101; + + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public GetFavoriteStatusEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.GET); + Routes(WebRoutes.Favorites.GET_FAVORITE_STATUS); + DontAutoTag(); + Options(options => options.WithTags("Favorites")); + } + + /// + /// Retrieves which of the given media items are favorites of the current user. + /// + /// The request containing the kind and the Ids of the media items to check. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(GetFavoriteStatusRequest request, CancellationToken cancellationToken) + { + // The favorites belong to the authenticated user, so no intermediary may store them, and the response varies by the sign in cookie. + HttpContext.Response.Headers["Cache-Control"] = "private, no-store"; + HttpContext.Response.Headers["Vary"] = "Cookie"; + // The query string is rebuilt from the typed request values instead of forwarding the raw one, so that crafted text can never alter the upstream URL. + // A missing kind or Id list is left out, so that the API reports the validation error itself. + List queryParameters = []; + if (request.MediaKind is not null) + queryParameters.Add($"mediaKind={Uri.EscapeDataString(request.MediaKind.Value.ToString())}"); + // The forwarded list is bounded, so the upstream URL stays bounded too. + foreach (Guid mediaItemId in (request.MediaItemIds ?? []).Take(MAXIMUM_FORWARDED_MEDIA_ITEM_COUNT)) + queryParameters.Add($"mediaItemIds={mediaItemId}"); + string url = queryParameters.Count == 0 ? ApiRoutes.Favorites.GET_FAVORITE_STATUS : $"{ApiRoutes.Favorites.GET_FAVORITE_STATUS}?{string.Join('&', queryParameters)}"; + FavoriteStatusDto status = await _apiHttpClient.GetAsync(url, cancellationToken).ConfigureAwait(false); + return JsonSuccess(status); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpointSummary.cs new file mode 100644 index 00000000..5e51c588 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavoriteStatus/GetFavoriteStatusEndpointSummary.cs @@ -0,0 +1,43 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.DTO.Favorites; +using Lumina.Presentation.Web.Common.Enums.Favorites; +using Lumina.Presentation.Web.Common.Requests.Favorites; +using System; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Favorites.GetFavoriteStatus; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class GetFavoriteStatusEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public GetFavoriteStatusEndpointSummary() + { + Summary = "Gets which media items are favorites of the current user."; + Description = "Proxies the request that finds out which of the given media items of one kind are favorites of the current user to the API server. The mediaItemIds query parameter is repeated, once per Id."; + + ExampleRequest = new GetFavoriteStatusRequest( + MediaKind: FavoriteMediaKind.MusicTrack, + MediaItemIds: + [ + Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"), + Guid.Parse("5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d") + ] + ); + RequestParam(request => request.MediaKind, "The kind of the media items to check: MusicArtist, MusicAlbum, MusicTrack or Book. Required."); + RequestParam(request => request.MediaItemIds, "The Ids of the media items to check, from 1 to 100, sent as a repeated mediaItemIds query parameter. Required."); + + Response(200, "The Ids, among the checked ones, of the media items that are favorites of the current user are returned.", + example: new SuccessResponse(true, new FavoriteStatusDto( + FavoritedMediaItemIds: [Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f")])) + ); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpoint.cs new file mode 100644 index 00000000..db023ad4 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpoint.cs @@ -0,0 +1,69 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.DTO.Favorites; +using Lumina.Presentation.Web.Common.Requests.Favorites; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Common; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Favorites.GetFavorites; + +/// +/// API endpoint for the /{culture}/favorites/api-get-favorites route. +/// +public class GetFavoritesEndpoint : BaseEndpoint +{ + private const int DEFAULT_FAVORITE_PAGE_SIZE = 200; + + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public GetFavoritesEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.GET); + Routes(WebRoutes.Favorites.GET_FAVORITES); + DontAutoTag(); + Options(options => options.WithTags("Favorites")); + } + + /// + /// Retrieves a page of the favorites of the current user. + /// + /// The request object. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(GetFavoritesRequest request, CancellationToken cancellationToken) + { + // The favorites belong to the authenticated user, so no intermediary may store them, and the response varies by the sign in cookie. + HttpContext.Response.Headers["Cache-Control"] = "private, no-store"; + HttpContext.Response.Headers["Vary"] = "Cookie"; + // The query string is rebuilt from the typed request values instead of forwarding the raw one, so that crafted text can never alter the upstream URL. + // The page bounds are normalized by the API pagination data, exactly like every other paginated collection of the application. + int currentPage = request.CurrentPage ?? 1; + int perPage = request.PerPage ?? DEFAULT_FAVORITE_PAGE_SIZE; + string url = ApiRoutes.Favorites.GET_FAVORITES + $"?currentPage={currentPage.ToString(CultureInfo.InvariantCulture)}&perPage={perPage.ToString(CultureInfo.InvariantCulture)}"; + if (request.MediaKind is not null) + url += $"&mediaKind={Uri.EscapeDataString(request.MediaKind.Value.ToString())}"; + PaginatedDto favorites = await _apiHttpClient.GetAsync>(url, cancellationToken).ConfigureAwait(false); + return JsonSuccess(favorites); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpointSummary.cs new file mode 100644 index 00000000..8bc35307 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/GetFavorites/GetFavoritesEndpointSummary.cs @@ -0,0 +1,58 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.DTO.Favorites; +using Lumina.Presentation.Web.Common.Enums.Favorites; +using Lumina.Presentation.Web.Common.Requests.Favorites; +using System; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Favorites.GetFavorites; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class GetFavoritesEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public GetFavoritesEndpointSummary() + { + Summary = "Gets the favorites of the current user."; + Description = "Proxies the request that gets a page of the favorites of the current user, from the most recently favorited, to the API server. The currentPage and perPage query parameters select the page, and count reports the total number of favorites that match the filter. Each favorite carries the display details of its media item."; + + ExampleRequest = new GetFavoritesRequest( + MediaKind: FavoriteMediaKind.MusicTrack, + CurrentPage: 1, + PerPage: 200 + ); + RequestParam(request => request.MediaKind, "The kind of media item to restrict the favorites to: MusicArtist, MusicAlbum, MusicTrack or Book. Optional; every kind is returned when omitted."); + RequestParam(request => request.CurrentPage, "The one based page of favorites to return. Optional; defaults to 1."); + RequestParam(request => request.PerPage, "The number of favorites per page. Optional; defaults to 200."); + + Response(200, "The requested page of the favorites of the current user is returned.", + example: new SuccessResponse>(true, new PaginatedDto( + Data: + [ + new FavoriteItemDto( + MediaKind: FavoriteMediaKind.MusicTrack, + MediaItemId: Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"), + IsAvailable: true, + LibraryId: Guid.Parse("1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"), + Title: "Time", + CollectionId: Guid.Parse("7c6b5a49-3827-4165-9d0e-1f2a3b4c5d6e"), + CollectionTitle: "The Dark Side of the Moon", + CreatorId: Guid.Parse("2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f6a"), + CreatorName: "Pink Floyd", + CoverPath: "covers/dark-side-of-the-moon.jpg") + ], + CurrentPage: 1, + PerPage: 200, + Count: 1, + NumberOfPages: 1)) + ); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/Index/FavoritesIndexViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/Index/FavoritesIndexViewEndpoint.cs new file mode 100644 index 00000000..3f2ecd6c --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/Index/FavoritesIndexViewEndpoint.cs @@ -0,0 +1,108 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.DTO.Themes; +using Lumina.Presentation.Web.Common.Primitives; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Common.Services; +using Lumina.Presentation.Web.Core.Endpoints.Common; +using Lumina.Presentation.Web.Core.Themes; +using Microsoft.AspNetCore.Antiforgery; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Localization; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Favorites.Index; + +/// +/// API endpoint for the /{culture}/favorites route. +/// +public class FavoritesIndexViewEndpoint : BaseEndpoint +{ + // The resource base name deliberately excludes the "Core.Resources" segment: the localization factory re-roots it with the configured ResourcesPath. + private const string VIEW_RESOURCE_BASE_NAME = "Lumina.Presentation.Web.Views.Favorites.Index"; + private const string VIEW_RESOURCE_LOCATION = "Lumina.Presentation.Web"; + // The page key mirrors the path of the Razor view under Core/Views, so that theme templates can override it at the page, section or default scope. + private const string VIEW_PAGE_KEY = "favorites/index"; + + private readonly IUrlService _urlService; + private readonly ThemePageRenderer _themePageRenderer; + private readonly IAntiforgery _antiforgery; + private readonly IStringLocalizer _localizer; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for generating URLs from action and controller names, with localization. + /// Injected service for rendering themed pages. + /// Injected service for anti-forgery token handling. + /// Injected factory used to create the localizer of the view resources. + public FavoritesIndexViewEndpoint(IUrlService urlService, ThemePageRenderer themePageRenderer, IAntiforgery antiforgery, IStringLocalizerFactory stringLocalizerFactory) + { + _urlService = urlService; + _themePageRenderer = themePageRenderer; + _antiforgery = antiforgery; + _localizer = stringLocalizerFactory.Create(VIEW_RESOURCE_BASE_NAME, VIEW_RESOURCE_LOCATION); + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.GET); + Routes(WebRoutes.Favorites.INDEX); + DontAutoTag(); + Options(options => options.WithTags("Favorites")); + } + + /// + /// Displays the favorites of the current user across media kinds, rendered by the active theme with a fallback to the Razor view. + /// + /// The request object. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken) + { + // The page shows the favorites of the authenticated user, so no intermediary may store it, and the response varies by the sign in cookie. + HttpContext.Response.Headers["Cache-Control"] = "private, no-store"; + HttpContext.Response.Headers["Vary"] = "Cookie"; + // The page removes favorites, which submit through the form anti-forgery token, so a fresh token is issued for it. + AntiforgeryTokenSet antiforgeryTokens = _antiforgery.GetAndStoreTokens(HttpContext); + string title = _localizer["Title"].Value; + + // The media item link templates carry the all-zero Guid placeholders of their route values, in route order, which the page replaces + // one at a time. The remove template keeps its named mediaKind and mediaItemId route placeholders instead, so those two values do not + // depend on the segment order. The detail pages of the media items expect the Id of their media library in the libraryId query + // parameter, which the page appends to the link from the favorite item. + ThemePageDto pageModel = new() + { + PageKey = VIEW_PAGE_KEY, + Title = title, + Description = string.Empty, + PageData = new Dictionary + { + ["getFavoritesUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Favorites.GET_FAVORITES) ?? string.Empty, + ["getFavoriteStatusUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Favorites.GET_FAVORITE_STATUS) ?? string.Empty, + ["addFavoriteUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Favorites.ADD_FAVORITE) ?? string.Empty, + ["removeFavoriteUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Favorites.REMOVE_FAVORITE) ?? string.Empty, + ["artistUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.ARTIST, new { artistId = default(Guid) }) ?? string.Empty, + ["albumUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.ALBUM, new { artistId = default(Guid), albumId = default(Guid) }) ?? string.Empty, + ["trackUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.TRACK, new { artistId = default(Guid), albumId = default(Guid), trackId = default(Guid) }) ?? string.Empty, + ["bookUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.EDIT_BOOK, new { bookId = default(Guid) }) ?? string.Empty, + ["antiforgeryToken"] = antiforgeryTokens.RequestToken, + ["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer) + } + }; + + Result sectionResult = await _themePageRenderer.RenderAsync(pageModel, requestedThemeId: null, cancellationToken).ConfigureAwait(false); + if (sectionResult.IsFailure) + return View("/Core/Views/Favorites/Index.cshtml", viewData: new Dictionary { ["Title"] = title }); + + return View("/Core/Views/Shared/_ThemedView.cshtml", new ThemeViewDto(sectionResult.Value.Content, sectionResult.Value.Script), new Dictionary { ["Title"] = title }); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/Index/FavoritesIndexViewEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/Index/FavoritesIndexViewEndpointSummary.cs new file mode 100644 index 00000000..171ea8d7 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/Index/FavoritesIndexViewEndpointSummary.cs @@ -0,0 +1,24 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Favorites.Index; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class FavoritesIndexViewEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public FavoritesIndexViewEndpointSummary() + { + Summary = "Renders the favorites page."; + Description = "Renders the page that lists the favorites of the current user across media kinds and removes them."; + + Response(200, "The favorites page is rendered."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpoint.cs new file mode 100644 index 00000000..570e4268 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpoint.cs @@ -0,0 +1,71 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.Enums.Favorites; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Common; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using System; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Favorites.RemoveFavorite; + +/// +/// API endpoint for the /{culture}/favorites/{mediaKind}/{mediaItemId}/api-remove-favorite route. +/// +public class RemoveFavoriteEndpoint : BaseEndpoint +{ + // A value that is not a name of FavoriteMediaKind, so the API rejects a crafted route value with its own validation error. + private const string INVALID_MEDIA_KIND_PLACEHOLDER = "Invalid"; + + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public RemoveFavoriteEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.DELETE); + Routes(WebRoutes.Favorites.REMOVE_FAVORITE); + DontAutoTag(); + Options(options => options.WithTags("Favorites")); + EnableAntiforgery(); + } + + /// + /// Removes a media item from the favorites of the current user. + /// + /// The request object. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(FastEndpoints.EmptyRequest request, CancellationToken cancellationToken) + { + // The route values are normalized before they are substituted into the upstream URL, so that a crafted value can never escape its URL segment. + // The media kind must be the name of a FavoriteMediaKind member, which also rejects numeric strings and comma separated flag lists, and the Id must be a Guid. + string routeMediaKind = HttpContext.Request.RouteValues["mediaKind"]?.ToString() ?? string.Empty; + string mediaKind = INVALID_MEDIA_KIND_PLACEHOLDER; + foreach (string mediaKindName in Enum.GetNames()) + if (string.Equals(mediaKindName, routeMediaKind, StringComparison.OrdinalIgnoreCase)) + mediaKind = mediaKindName; + string routeMediaItemId = HttpContext.Request.RouteValues["mediaItemId"]?.ToString() ?? string.Empty; + string mediaItemId = Guid.TryParse(routeMediaItemId, out Guid parsedMediaItemId) ? parsedMediaItemId.ToString() : Guid.Empty.ToString(); + await _apiHttpClient.DeleteAsync( + ApiRoutes.Favorites.REMOVE_FAVORITE + .Replace("{mediaKind}", mediaKind) + .Replace("{mediaItemId}", mediaItemId), + cancellationToken).ConfigureAwait(false); + return JsonSuccess(); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpointSummary.cs new file mode 100644 index 00000000..c176a59b --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Favorites/RemoveFavorite/RemoveFavoriteEndpointSummary.cs @@ -0,0 +1,30 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.DTO.Common; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Favorites.RemoveFavorite; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class RemoveFavoriteEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public RemoveFavoriteEndpointSummary() + { + Summary = "Removes a media item from the favorites of the current user."; + Description = "Proxies the request that removes a favorite to the API server. The media item itself is not deleted. The favorite belongs to the current user, so this route cannot remove another user's favorite. Removing is idempotent: a media item that is not a favorite of the current user already has the desired state, so the request succeeds."; + + Params["mediaKind"] = "The kind of the favorited media item: MusicArtist, MusicAlbum, MusicTrack or Book."; + Params["mediaItemId"] = "The Id of the favorited media item."; + + Response(200, "The media item was removed from the favorites, or the item was already not a favorite.", + example: new SuccessResponse(true) + ); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpoint.cs index 11ddeb00..b91a1c92 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpoint.cs @@ -2,6 +2,7 @@ using FastEndpoints; using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; using Lumina.Presentation.Web.Common.Routes; using Lumina.Presentation.Web.Core.Endpoints.Common; @@ -50,7 +51,7 @@ public class GetArtistAlbumsEndpoint : BaseEndpointCancellation token that can be used to stop the execution. public override async Task ExecuteAsync(GetArtistAlbumsLiteRequest request, CancellationToken cancellationToken) { - PaginatedMusicAlbumLiteDto response = await _apiHttpClient.GetAsync(BuildItemsEndpoint(request), cancellationToken).ConfigureAwait(false); + PaginatedDto response = await _apiHttpClient.GetAsync>(BuildItemsEndpoint(request), cancellationToken).ConfigureAwait(false); return JsonSuccess(response); } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpoint.cs index 843fae20..f15a7039 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpoint.cs @@ -2,6 +2,7 @@ using FastEndpoints; using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; using Lumina.Presentation.Web.Common.Routes; using Lumina.Presentation.Web.Core.Endpoints.Common; @@ -50,7 +51,7 @@ public class GetMusicArtistsEndpoint : BaseEndpointCancellation token that can be used to stop the execution. public override async Task ExecuteAsync(GetMusicArtistsLiteRequest request, CancellationToken cancellationToken) { - PaginatedMusicArtistLiteDto response = await _apiHttpClient.GetAsync(BuildItemsEndpoint(request), cancellationToken).ConfigureAwait(false); + PaginatedDto response = await _apiHttpClient.GetAsync>(BuildItemsEndpoint(request), cancellationToken).ConfigureAwait(false); return JsonSuccess(response); } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpoint.cs index 8cdc19b4..1fede253 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpoint.cs @@ -2,6 +2,7 @@ using FastEndpoints; using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; using Lumina.Presentation.Web.Common.Routes; using Lumina.Presentation.Web.Core.Endpoints.Common; @@ -50,7 +51,7 @@ public class GetAlbumTracksEndpoint : BaseEndpointCancellation token that can be used to stop the execution. public override async Task ExecuteAsync(GetAlbumTracksLiteRequest request, CancellationToken cancellationToken) { - PaginatedMusicTrackLiteDto response = await _apiHttpClient.GetAsync(BuildItemsEndpoint(request), cancellationToken).ConfigureAwait(false); + PaginatedDto response = await _apiHttpClient.GetAsync>(BuildItemsEndpoint(request), cancellationToken).ConfigureAwait(false); return JsonSuccess(response); } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpoint.cs index ff26b11a..029743e8 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpoint.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using FastEndpoints; using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.DTO.Libraries; using Lumina.Presentation.Web.Common.Requests.Libraries; using Lumina.Presentation.Web.Common.Routes; @@ -50,7 +51,7 @@ public class GetLibraryItemsEndpoint : BaseEndpointCancellation token that can be used to stop the execution. public override async Task ExecuteAsync(GetBooksLiteRequest request, CancellationToken cancellationToken) { - PaginatedBookLiteDto response = await _apiHttpClient.GetAsync(BuildItemsEndpoint(request), cancellationToken).ConfigureAwait(false); + PaginatedDto response = await _apiHttpClient.GetAsync>(BuildItemsEndpoint(request), cancellationToken).ConfigureAwait(false); return JsonSuccess(response); } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointSummary.cs index 4e610fb3..91e12d04 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointSummary.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointSummary.cs @@ -44,6 +44,6 @@ public class GetLibraryItemsEndpointSummary : Summary(true, default)); + Response(200, "The lightweight details of the books of the media library are returned.", example: new SuccessResponse>(true, default)); } } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpoint.cs index 6dbc18ff..57039770 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpoint.cs @@ -19,8 +19,7 @@ namespace Lumina.Presentation.Web.Core.Endpoints.Playlists.GetPlaylist; /// public class GetPlaylistEndpoint : BaseEndpoint { - private const int DEFAULT_ENTRY_WINDOW_SIZE = 200; - private const int MAXIMUM_ENTRY_WINDOW_SIZE = 1000; + private const int DEFAULT_ENTRY_PAGE_SIZE = 200; private readonly IApiHttpClient _apiHttpClient; @@ -46,7 +45,7 @@ public class GetPlaylistEndpoint : BaseEndpoint } /// - /// Retrieves a window of the entries of a playlist of the current user. + /// Retrieves a page of the entries of a playlist of the current user. /// /// The request object. /// Cancellation token that can be used to stop the execution. @@ -58,11 +57,10 @@ public class GetPlaylistEndpoint : BaseEndpoint // The route value is normalized to a Guid before it is substituted into the upstream URL, so that a crafted value can never escape its URL segment. string routePlaylistId = HttpContext.Request.RouteValues["playlistId"]?.ToString() ?? string.Empty; string playlistId = Guid.TryParse(routePlaylistId, out Guid parsedPlaylistId) ? parsedPlaylistId.ToString() : Guid.Empty.ToString(); - int offset = request.Offset ?? 0; - // The web tier enforces the same response-window bound before forwarding, so a crafted value cannot make this proxy buffer an - // unbounded playlist response even if it never reaches the API validator. - int limit = Math.Clamp(request.Limit ?? DEFAULT_ENTRY_WINDOW_SIZE, 1, MAXIMUM_ENTRY_WINDOW_SIZE); - string url = ApiRoutes.Playlists.GET_PLAYLIST.Replace("{playlistId}", playlistId) + $"?offset={offset}&limit={limit}"; + int currentPage = request.CurrentPage ?? 1; + // The page bounds are normalized by the API pagination data. + int perPage = request.PerPage ?? DEFAULT_ENTRY_PAGE_SIZE; + string url = ApiRoutes.Playlists.GET_PLAYLIST.Replace("{playlistId}", playlistId) + $"?currentPage={currentPage}&perPage={perPage}"; PlaylistDto playlist = await _apiHttpClient.GetAsync(url, cancellationToken).ConfigureAwait(false); return JsonSuccess(playlist); } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpointSummary.cs index c2d5bd5f..7c45aaca 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpointSummary.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/GetPlaylist/GetPlaylistEndpointSummary.cs @@ -2,7 +2,9 @@ using FastEndpoints; using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.DTO.Playlists; +using Lumina.Presentation.Web.Common.Enums.Playlists; using Lumina.Presentation.Web.Common.Requests.Playlists; +using System; using System.Diagnostics.CodeAnalysis; #endregion @@ -20,19 +22,46 @@ public class GetPlaylistEndpointSummary : Summary request.Offset, "The zero based position of the first entry to return. Optional; defaults to 0."); - RequestParam(request => request.Limit, "The maximum number of entries to return, from 1 to 1000. Optional; defaults to 200."); + RequestParam(request => request.CurrentPage, "The one based page of entries to return. Optional; defaults to 1."); + RequestParam(request => request.PerPage, "The number of entries per page. Optional; defaults to 200."); Response(200, "The playlist and its ordered entries are returned.", - example: new SuccessResponse(true, default) + example: new SuccessResponse(true, new PlaylistDto( + Id: Guid.Parse("1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a5b"), + Name: "Evening listening", + Description: "Quiet tracks for the end of the day.", + Type: PlaylistType.Music, + Entries: new PaginatedDto( + Data: + [ + new PlaylistEntryDto( + Id: Guid.Parse("2a3b4c5d-6e7f-4a8b-9c0d-1e2f3a4b5c6d"), + MediaItemId: Guid.Parse("9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f"), + MediaItemType: PlaylistMediaItemType.MusicTrack, + Position: 0, + LibraryId: Guid.Parse("3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a"), + CollectionId: Guid.Parse("e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f"), + CreatorId: Guid.Parse("d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a"), + MediaItemTitle: "The Show Must Go On", + CollectionTitle: "Innuendo", + CreatorName: "Queen", + DurationInSeconds: 262, + CoverPath: "/artwork/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/cover.jpg") + ], + CurrentPage: 1, + PerPage: 200, + Count: 1, + NumberOfPages: 1), + CreatedOnUtc: new DateTime(2026, 10, 19, 18, 0, 0, DateTimeKind.Utc), + UpdatedOnUtc: new DateTime(2026, 10, 19, 19, 30, 0, DateTimeKind.Utc))) ); } } diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/Item/AddPlaylistViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/Item/AddPlaylistViewEndpoint.cs index 42579d9a..04d79d2e 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/Item/AddPlaylistViewEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/Item/AddPlaylistViewEndpoint.cs @@ -1,5 +1,6 @@ #region ========================================================================= USING ===================================================================================== using FastEndpoints; +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.DTO.Playlists; using Lumina.Presentation.Web.Common.DTO.Themes; using Lumina.Presentation.Web.Common.Enums.Playlists; @@ -31,6 +32,8 @@ public class AddPlaylistViewEndpoint : BaseEndpoint private const string VIEW_RESOURCE_LOCATION = "Lumina.Presentation.Web"; // The page key mirrors the path of the Razor view under Core/Views, so that theme templates can override it at the page, section or default scope. private const string VIEW_PAGE_KEY = "playlists/item"; + // A new playlist has no entries yet, but its serialized page still carries the shape the page script expects. + private const int DEFAULT_ENTRY_PAGE_SIZE = 200; private static readonly JsonSerializerOptions s_camelCaseJsonOptions = new() { @@ -88,8 +91,12 @@ public class AddPlaylistViewEndpoint : BaseEndpoint Name: string.Empty, Description: null, Type: PlaylistType.Music, - EntryCount: 0, - Entries: [], + Entries: new PaginatedDto( + Data: [], + CurrentPage: 1, + PerPage: DEFAULT_ENTRY_PAGE_SIZE, + Count: 0, + NumberOfPages: 0), CreatedOnUtc: default, UpdatedOnUtc: null ); @@ -105,6 +112,7 @@ public class AddPlaylistViewEndpoint : BaseEndpoint ["isNew"] = true, ["playlistId"] = playlist.Id.ToString(), ["playlistJson"] = JsonSerializer.Serialize(playlist, s_camelCaseJsonOptions), + ["entriesPerPage"] = DEFAULT_ENTRY_PAGE_SIZE, ["createPlaylistUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Playlists.CREATE_PLAYLIST) ?? string.Empty, ["itemUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Playlists.ITEM, new { playlistId = default(Guid) }) ?? string.Empty, ["getEnabledLibrariesUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.GET_ENABLED_LIBRARIES) ?? string.Empty, diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/Item/PlaylistItemViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/Item/PlaylistItemViewEndpoint.cs index 355452d0..2a261b68 100644 --- a/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/Item/PlaylistItemViewEndpoint.cs +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Playlists/Item/PlaylistItemViewEndpoint.cs @@ -31,8 +31,8 @@ public class PlaylistItemViewEndpoint : BaseEndpoint private const string VIEW_RESOURCE_LOCATION = "Lumina.Presentation.Web"; // The page key mirrors the path of the Razor view under Core/Views, so that theme templates can override it at the page, section or default scope. private const string VIEW_PAGE_KEY = "playlists/item"; - // The page renders one window at a time; the client asks for the next window through getPlaylistUrl. - private const int ENTRY_WINDOW_SIZE = 200; + // The page renders one page at a time; the client asks for the next page through getPlaylistUrl. + private const int ENTRY_PAGE_SIZE = 200; private static readonly JsonSerializerOptions s_camelCaseJsonOptions = new() { @@ -91,7 +91,7 @@ public class PlaylistItemViewEndpoint : BaseEndpoint string playlistId = Guid.TryParse(routePlaylistId, out Guid parsedPlaylistId) ? parsedPlaylistId.ToString() : Guid.Empty.ToString(); PlaylistDto playlist = await _apiHttpClient .GetAsync( - ApiRoutes.Playlists.GET_PLAYLIST.Replace("{playlistId}", playlistId) + $"?offset=0&limit={ENTRY_WINDOW_SIZE}", + ApiRoutes.Playlists.GET_PLAYLIST.Replace("{playlistId}", playlistId) + $"?currentPage=1&perPage={ENTRY_PAGE_SIZE}", cancellationToken).ConfigureAwait(false); // The page edits, reorders and deletes the playlist, which submit through the form anti-forgery token, so a fresh token is issued for it. @@ -107,7 +107,7 @@ public class PlaylistItemViewEndpoint : BaseEndpoint ["isNew"] = false, ["playlistId"] = playlist.Id.ToString(), ["playlistJson"] = JsonSerializer.Serialize(playlist, s_camelCaseJsonOptions), - ["entriesWindowSize"] = ENTRY_WINDOW_SIZE, + ["entriesPerPage"] = ENTRY_PAGE_SIZE, ["createPlaylistUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Playlists.CREATE_PLAYLIST) ?? string.Empty, ["itemUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Playlists.ITEM, new { playlistId = default(Guid) }) ?? string.Empty, ["getPlaylistUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Playlists.GET_PLAYLIST, new { playlistId = playlist.Id }) ?? string.Empty, diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.ar-SA.resx new file mode 100644 index 00000000..79accd37 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.ar-SA.resx @@ -0,0 +1,66 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + المفضلة + + + ليست لديك أي عناصر مفضلة بعد. + + + ليست لديك أي عناصر مفضلة من هذا النوع بعد. + + + هذا العنصر لم يعد متاحًا. + + + الكل + + + الفنانون + + + الألبومات + + + المقاطع + + + الكتب + + + فنان + + + ألبوم + + + مقطع + + + كتاب + + + تحميل المزيد + + + عناصر + + + تعذر تحميل المفضلة. + + + إعادة المحاولة + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.de-DE.resx new file mode 100644 index 00000000..803ad0f7 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.de-DE.resx @@ -0,0 +1,66 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Favoriten + + + Du hast noch keine Favoriten. + + + Du hast noch keine Favoriten dieser Art. + + + Dieses Element ist nicht mehr verfügbar. + + + Alle + + + Künstler + + + Alben + + + Titel + + + Bücher + + + Künstler + + + Album + + + Titel + + + Buch + + + Mehr laden + + + Einträge + + + Die Favoriten konnten nicht geladen werden. + + + Wiederholen + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.en-US.resx new file mode 100644 index 00000000..0e9fa75e --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.en-US.resx @@ -0,0 +1,66 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Favorites + + + You have no favorites yet. + + + You have no favorites of this kind yet. + + + This item is no longer available. + + + All + + + Artists + + + Albums + + + Tracks + + + Books + + + Artist + + + Album + + + Track + + + Book + + + Load more + + + items + + + The favorites could not be loaded. + + + Retry + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.es-ES.resx new file mode 100644 index 00000000..6aabc3f4 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.es-ES.resx @@ -0,0 +1,66 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Favoritos + + + Todavía no tienes favoritos. + + + Todavía no tienes favoritos de este tipo. + + + Este elemento ya no está disponible. + + + Todos + + + Artistas + + + Álbumes + + + Pistas + + + Libros + + + Artista + + + Álbum + + + Pista + + + Libro + + + Cargar más + + + elementos + + + No se pudieron cargar los favoritos. + + + Reintentar + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.fr-FR.resx new file mode 100644 index 00000000..eb2bb104 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.fr-FR.resx @@ -0,0 +1,66 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Favoris + + + Vous n'avez encore aucun favori. + + + Vous n'avez encore aucun favori de ce type. + + + Cet élément n'est plus disponible. + + + Tous + + + Artistes + + + Albums + + + Pistes + + + Livres + + + Artiste + + + Album + + + Piste + + + Livre + + + Charger plus + + + éléments + + + Les favoris n'ont pas pu être chargés. + + + Réessayer + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.it-IT.resx new file mode 100644 index 00000000..150812de --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.it-IT.resx @@ -0,0 +1,66 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Preferiti + + + Non hai ancora preferiti. + + + Non hai ancora preferiti di questo tipo. + + + Questo elemento non è più disponibile. + + + Tutti + + + Artisti + + + Album + + + Brani + + + Libri + + + Artista + + + Album + + + Brano + + + Libro + + + Carica altri + + + elementi + + + Non è stato possibile caricare i preferiti. + + + Riprova + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.ja-JP.resx new file mode 100644 index 00000000..a108d82e --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.ja-JP.resx @@ -0,0 +1,66 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + お気に入り + + + お気に入りはまだありません。 + + + この種類のお気に入りはまだありません。 + + + この項目は利用できなくなりました。 + + + すべて + + + アーティスト + + + アルバム + + + 曲 + + + 書籍 + + + アーティスト + + + アルバム + + + 曲 + + + 書籍 + + + さらに読み込む + + + 件 + + + お気に入りを読み込めませんでした。 + + + 再試行 + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.resx new file mode 100644 index 00000000..0e9fa75e --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.resx @@ -0,0 +1,66 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Favorites + + + You have no favorites yet. + + + You have no favorites of this kind yet. + + + This item is no longer available. + + + All + + + Artists + + + Albums + + + Tracks + + + Books + + + Artist + + + Album + + + Track + + + Book + + + Load more + + + items + + + The favorites could not be loaded. + + + Retry + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.ro-RO.resx new file mode 100644 index 00000000..836e1e16 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.ro-RO.resx @@ -0,0 +1,66 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Favorite + + + Nu ai încă favorite. + + + Nu ai încă favorite de acest fel. + + + Acest element nu mai este disponibil. + + + Toate + + + Artiști + + + Albume + + + Piese + + + Cărți + + + Artist + + + Album + + + Piesă + + + Carte + + + Încarcă mai multe + + + elemente + + + Favoritele nu au putut fi încărcate. + + + Reîncercare + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.uk-UA.resx new file mode 100644 index 00000000..279a0f00 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.uk-UA.resx @@ -0,0 +1,66 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Улюблене + + + У вас ще немає улюбленого. + + + У вас ще немає улюбленого цього типу. + + + Цей елемент більше недоступний. + + + Усе + + + Виконавці + + + Альбоми + + + Треки + + + Книги + + + Виконавець + + + Альбом + + + Трек + + + Книга + + + Завантажити ще + + + елементів + + + Не вдалося завантажити улюблене. + + + Повторити + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.zh-CN.resx new file mode 100644 index 00000000..51b2f888 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Favorites/Index.zh-CN.resx @@ -0,0 +1,66 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 收藏夹 + + + 你还没有收藏。 + + + 你还没有此类收藏。 + + + 此项目已不可用。 + + + 全部 + + + 艺术家 + + + 专辑 + + + 曲目 + + + 图书 + + + 艺术家 + + + 专辑 + + + 曲目 + + + 图书 + + + 加载更多 + + + 项 + + + 无法加载收藏。 + + + 重试 + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.ar-SA.resx index fa3b2c2b..f448727c 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.ar-SA.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.ar-SA.resx @@ -66,6 +66,9 @@ تعذر إضافة المقطع. + + تم تحديث قائمة التشغيل، لكن تعذر تحديث القائمة. أعد تحميل الصفحة لرؤية التغيير. + اختر مكتبة diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.de-DE.resx index f4ff23be..be3e2533 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.de-DE.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.de-DE.resx @@ -66,6 +66,9 @@ Der Titel konnte nicht hinzugefügt werden. + + Die Wiedergabeliste wurde aktualisiert, aber die Liste konnte nicht neu geladen werden. Laden Sie die Seite neu, um die Änderung zu sehen. + Bibliothek auswählen diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.en-US.resx index 34541b79..746dff1e 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.en-US.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.en-US.resx @@ -66,6 +66,9 @@ The track could not be added. + + The playlist was updated, but the list could not be refreshed. Reload the page to see the change. + Select a library diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.es-ES.resx index 786a8423..b2828c99 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.es-ES.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.es-ES.resx @@ -66,6 +66,9 @@ No se pudo añadir la pista. + + La lista de reproducción se actualizó, pero no se pudo actualizar la lista. Recarga la página para ver el cambio. + Selecciona una biblioteca diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.fr-FR.resx index a802ac12..0eda70c0 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.fr-FR.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.fr-FR.resx @@ -66,6 +66,9 @@ La piste n'a pas pu être ajoutée. + + La liste de lecture a été mise à jour, mais la liste n'a pas pu être actualisée. Rechargez la page pour voir la modification. + Choisir une bibliothèque diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.it-IT.resx index aa542530..c8260727 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.it-IT.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.it-IT.resx @@ -66,6 +66,9 @@ Non è stato possibile aggiungere il brano. + + La playlist è stata aggiornata, ma non è stato possibile aggiornare l'elenco. Ricarica la pagina per vedere la modifica. + Seleziona una libreria diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.ja-JP.resx index b41745ef..767a80c5 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.ja-JP.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.ja-JP.resx @@ -66,6 +66,9 @@ 曲を追加できませんでした。 + + プレイリストは更新されましたが、一覧を更新できませんでした。変更を確認するにはページを再読み込みしてください。 + ライブラリを選択 diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.resx index 34541b79..746dff1e 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.resx @@ -66,6 +66,9 @@ The track could not be added. + + The playlist was updated, but the list could not be refreshed. Reload the page to see the change. + Select a library diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.ro-RO.resx index 1ccaf967..c7e00005 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.ro-RO.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.ro-RO.resx @@ -66,6 +66,9 @@ Piesa nu a putut fi adăugată. + + Lista de redare a fost actualizată, dar lista nu a putut fi reîmprospătată. Reîncarcă pagina pentru a vedea modificarea. + Selectează o bibliotecă diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.uk-UA.resx index 747a3756..b56daba1 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.uk-UA.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.uk-UA.resx @@ -66,6 +66,9 @@ Не вдалося додати трек. + + Список відтворення оновлено, але список не вдалося оновити. Перезавантажте сторінку, щоб побачити зміну. + Виберіть бібліотеку diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.zh-CN.resx index d4e2c3e8..e6709f48 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.zh-CN.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Playlists/Item.zh-CN.resx @@ -66,6 +66,9 @@ 无法添加曲目。 + + 播放列表已更新,但无法刷新列表。请重新加载页面以查看更改。 + 选择库 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 6796047c..c8a3a711 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 @@ -255,4 +255,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 0e2fb338..63c3df36 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 @@ -255,4 +255,10 @@ Es gibt keine Titel zum Hinzufügen. + + Zu Favoriten hinzufügen + + + Aus Favoriten entfernen + \ 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 adfbf502..9de9fcdb 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 @@ -255,4 +255,10 @@ There are no tracks to add. + + Add to favorites + + + Remove from favorites + \ 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 5cc273c3..163914b0 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 @@ -255,4 +255,10 @@ No hay pistas para añadir. + + Añadir a favoritos + + + Quitar de favoritos + \ 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 1b80c9b9..08eda57f 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 @@ -255,4 +255,10 @@ Il n'y a aucune piste à ajouter. + + Ajouter aux favoris + + + Retirer des favoris + \ 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 a4a82f09..d5d44b24 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 @@ -255,4 +255,10 @@ Non ci sono tracce da aggiungere. + + Aggiungi ai preferiti + + + Rimuovi dai preferiti + \ 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 53c23663..b73e0545 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 @@ -255,4 +255,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 adfbf502..9de9fcdb 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_Layout.resx @@ -255,4 +255,10 @@ There are no tracks to add. + + Add to favorites + + + Remove from favorites + \ 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 225cccd7..14c96319 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 @@ -255,4 +255,10 @@ Nu există piese de adăugat. + + Adaugă la favorite + + + Elimină din favorite + \ 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 32e66a50..5d0637f9 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 @@ -255,4 +255,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 95f8d2e7..b1b0cc51 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 @@ -255,4 +255,10 @@ 没有可添加的曲目。 + + 添加到收藏 + + + 取消收藏 + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.ar-SA.resx index bb2a1368..81c36666 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.ar-SA.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.ar-SA.resx @@ -222,4 +222,7 @@ قوائم التشغيل + + المفضلة + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.de-DE.resx index 9c6a08e7..6cdfb7f4 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.de-DE.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.de-DE.resx @@ -222,4 +222,7 @@ Wiedergabelisten + + Favoriten + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.en-US.resx index 7f886cd6..810eb0e5 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.en-US.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.en-US.resx @@ -222,4 +222,7 @@ Playlists + + Favorites + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.es-ES.resx index 236c905b..10beb8e4 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.es-ES.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.es-ES.resx @@ -222,4 +222,7 @@ Listas de reproducción + + Favoritos + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.fr-FR.resx index 82fc9d3f..9bae909c 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.fr-FR.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.fr-FR.resx @@ -222,4 +222,7 @@ Listes de lecture + + Favoris + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.it-IT.resx index d77a860c..5425e91b 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.it-IT.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.it-IT.resx @@ -222,4 +222,7 @@ Playlist + + Preferiti + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.ja-JP.resx index 1d7aab75..45b75ddc 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.ja-JP.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.ja-JP.resx @@ -222,4 +222,7 @@ プレイリスト + + お気に入り + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.resx index 7f886cd6..810eb0e5 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.resx @@ -222,4 +222,7 @@ Playlists + + Favorites + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.ro-RO.resx index 26115285..93a29ca1 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.ro-RO.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.ro-RO.resx @@ -222,4 +222,7 @@ Liste de redare + + Favorite + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.uk-UA.resx index 926a6e54..5d49bea2 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.uk-UA.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.uk-UA.resx @@ -222,4 +222,7 @@ Списки відтворення + + Улюблене + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.zh-CN.resx index 359add67..36e4b023 100644 --- a/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.zh-CN.resx +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Shared/_NavMenu.zh-CN.resx @@ -222,4 +222,7 @@ 播放列表 + + 收藏夹 + \ No newline at end of file diff --git a/src/Lumina.Presentation.Web/Core/Themes/ThemeNavBuilder.cs b/src/Lumina.Presentation.Web/Core/Themes/ThemeNavBuilder.cs index 52e1bd95..4424234d 100644 --- a/src/Lumina.Presentation.Web/Core/Themes/ThemeNavBuilder.cs +++ b/src/Lumina.Presentation.Web/Core/Themes/ThemeNavBuilder.cs @@ -152,6 +152,7 @@ public sealed class ThemeNavBuilder ]; if (canCreateLibraries) items.Add(new ThemeNavEntryDto(Localize("AddNewLibrary"), _urlService.GetAbsoluteUrl(WebRoutes.LibraryManagement.ADD_LIBRARY), "nav-link", [])); + items.Add(new ThemeNavEntryDto(Localize("Favorites"), _urlService.GetAbsoluteUrl(WebRoutes.Favorites.INDEX), "nav-link", [])); // The written content and audio entries open the home page filtered to the libraries of their category, so that browsing starts // from the libraries the user owns (or from every library, for administrators), instead of from a single library picked upfront. string librariesCatalogUrl = _urlService.GetAbsoluteUrl(WebRoutes.Home.INDEX_CULTURED) ?? string.Empty; diff --git a/src/Lumina.Presentation.Web/Core/Views/Favorites/Index.cshtml b/src/Lumina.Presentation.Web/Core/Views/Favorites/Index.cshtml new file mode 100644 index 00000000..c1ed1828 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Views/Favorites/Index.cshtml @@ -0,0 +1,534 @@ +@* + FALLBACK FAVORITES PAGE - READ BEFORE EDITING + + This view is the application fallback of the favorites page, rendered only when the theme template of the page cannot be + loaded. The bundled themes ship no template for it, so this view is what the user sees on a healthy site as well. It keeps + the DOM contract and the client script a theme template would mirror, so that listing, filtering and removing favorites + keep working with any theme. + + The page lists the favorites of the current user across every media kind, from the most recently favorited, in pages of + 50 items, and the kind filter restricts the list to one kind. Every card links to the page of its item, and carries a + favorite heart (a card-favorite-toggle button, always visible, in the place the actions trigger has on the library cards) + that the global favorites script drives, so a favorite is removed from the card itself. The page listens to + the lumina:favorite-changed event the script dispatches and removes the card of an item that is no longer a favorite, so + the counter and the empty state follow without another request. A favorite whose item was deleted, or whose library the + user can no longer access, is kept as an unavailable card without a link, so the owner can still remove it. + + The element hooks the script needs are favorites-container, no-favorites, favorite-count, favorites-kind-filter, + load-more-favorites-button and retry-favorites-button, and the classes of the cards are media-card, media-panel and + card-favorite-toggle. A failed reload clears the rendered window and shows the retry button, so the page never keeps the cards + of a filter the combo no longer shows. + + To restyle the page, edit the theme files. This fallback is intentionally plain, so that a broken theme is obvious to the user while the page still functions. + + /favorites +*@ + +@using Lumina.Presentation.Web.Common.Services +@using Microsoft.AspNetCore.Mvc.Localization +@using System +@using System.Collections.Generic +@using System.Text.Json +@using System.Text.Json.Serialization + +@inject IViewLocalizer _localizer +@inject IUrlService _urlService + +@{ + // Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler. + var scriptId = ScriptIdentifierHelper.GenerateScriptId(); + var strings = new Dictionary + { + ["title"] = _localizer["Title"].Value, + ["noFavorites"] = _localizer["NoFavorites"].Value, + ["noFavoritesInKind"] = _localizer["NoFavoritesInKind"].Value, + ["unavailable"] = _localizer["Unavailable"].Value, + ["itemsCount"] = _localizer["ItemsCount"].Value, + ["loadFailed"] = _localizer["LoadFailed"].Value, + ["kindMusicArtist"] = _localizer["KindArtist"].Value, + ["kindMusicAlbum"] = _localizer["KindAlbum"].Value, + ["kindMusicTrack"] = _localizer["KindTrack"].Value, + ["kindBook"] = _localizer["KindBook"].Value + }; + var jsonOptions = new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + Converters = { new JsonStringEnumConverter() } + }; +} + +@Html.AntiForgeryToken() + +
+
+
+
+
+

@_localizer["Title"]

+
+ +
+
+
+ + +
+
+
@_localizer["FilterAll"]
+
@_localizer["FilterArtists"]
+
@_localizer["FilterAlbums"]
+
@_localizer["FilterTracks"]
+
@_localizer["FilterBooks"]
+
+
+
+
+ +
+
+ +
+ + +
+
+
+
+ +@section Scripts { + + +} 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 181a7326..f02da968 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 @@ -137,6 +137,7 @@ + @@ -995,7 +996,7 @@ } // Creates a row of the tracks table, with the play trigger, the number, the name of the track linking to its own page, - // the duration and the actions menu of the track. + // the duration, the favorite heart and the actions menu of the track. function createTrackRow(track) { const row = document.createElement('tr'); row.className = 'track-row'; @@ -1021,10 +1022,26 @@ row.appendChild(numberCell); row.appendChild(nameCell); row.appendChild(durationCell); + row.appendChild(createTrackFavoriteCell(track)); row.appendChild(createTrackActionsCell(track)); return row; } + // Creates the favorite cell of a track row, right after the duration. The heart is a plain button: the global favorites + // script finds it by its data attributes, hydrates its state and handles its click. + function createTrackFavoriteCell(track) { + const cell = document.createElement('td'); + cell.className = 'track-favorite-cell'; + const favoriteToggle = document.createElement('button'); + favoriteToggle.type = 'button'; + favoriteToggle.className = 'card-favorite-toggle track-favorite-toggle'; + favoriteToggle.setAttribute('data-favorite-toggle', ''); + favoriteToggle.setAttribute('data-favorite-media-kind', 'MusicTrack'); + favoriteToggle.setAttribute('data-favorite-media-item-id', track.id); + cell.appendChild(favoriteToggle); + return cell; + } + // Gets the singleton audio player, or null when the layout did not render it. function getAudioPlayer() { return window.LuminaAudioPlayer && window.LuminaAudioPlayer.instance 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 f178db14..cc63e49b 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 @@ -298,7 +298,16 @@ await updateContentAsync(menuItem.href, true); }); + // The favorite heart is a plain button: the global favorites script finds it by its data attributes, hydrates its state and handles its click. + const favoriteToggle = document.createElement('button'); + favoriteToggle.type = 'button'; + favoriteToggle.className = 'card-favorite-toggle'; + favoriteToggle.setAttribute('data-favorite-toggle', ''); + favoriteToggle.setAttribute('data-favorite-media-kind', 'MusicArtist'); + favoriteToggle.setAttribute('data-favorite-media-item-id', artist.id); + card.appendChild(cardLink); + card.appendChild(favoriteToggle); card.appendChild(trigger); card.appendChild(menu); 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 13e7eda0..378344c2 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 @@ -1159,7 +1159,16 @@ await deleteAlbumAsync(card.dataset.albumId); }); + // The favorite heart is a plain button: the global favorites script finds it by its data attributes, hydrates its state and handles its click. + const favoriteToggle = document.createElement('button'); + favoriteToggle.type = 'button'; + favoriteToggle.className = 'card-favorite-toggle'; + favoriteToggle.setAttribute('data-favorite-toggle', ''); + favoriteToggle.setAttribute('data-favorite-media-kind', 'MusicAlbum'); + favoriteToggle.setAttribute('data-favorite-media-item-id', album.id); + card.appendChild(cardLink); + card.appendChild(favoriteToggle); card.appendChild(trigger); card.appendChild(menu); diff --git a/src/Lumina.Presentation.Web/Core/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.cshtml b/src/Lumina.Presentation.Web/Core/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.cshtml index 5708fa28..c4c87525 100644 --- a/src/Lumina.Presentation.Web/Core/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.cshtml +++ b/src/Lumina.Presentation.Web/Core/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.cshtml @@ -226,7 +226,16 @@ await updateContentAsync(menuItem.href, true); }); + // The favorite heart is a plain button: the global favorites script finds it by its data attributes, hydrates its state and handles its click. + const favoriteToggle = document.createElement('button'); + favoriteToggle.type = 'button'; + favoriteToggle.className = 'card-favorite-toggle'; + favoriteToggle.setAttribute('data-favorite-toggle', ''); + favoriteToggle.setAttribute('data-favorite-media-kind', 'Book'); + favoriteToggle.setAttribute('data-favorite-media-item-id', book.id); + card.appendChild(cardLink); + card.appendChild(favoriteToggle); card.appendChild(trigger); card.appendChild(menu); diff --git a/src/Lumina.Presentation.Web/Core/Views/Playlists/Item.cshtml b/src/Lumina.Presentation.Web/Core/Views/Playlists/Item.cshtml index 032310ce..434e1a19 100644 --- a/src/Lumina.Presentation.Web/Core/Views/Playlists/Item.cshtml +++ b/src/Lumina.Presentation.Web/Core/Views/Playlists/Item.cshtml @@ -54,6 +54,7 @@ ["track"] = _localizer["Track"].Value, ["add"] = _localizer["Add"].Value, ["addFailed"] = _localizer["AddFailed"].Value, + ["refreshFailed"] = _localizer["RefreshFailed"].Value, ["selectLibrary"] = _localizer["SelectLibrary"].Value, ["selectArtist"] = _localizer["SelectArtist"].Value, ["selectAlbum"] = _localizer["SelectAlbum"].Value, @@ -276,10 +277,23 @@ const addTrackButton = document.getElementById('add-track-button'); const noMusicLibrariesMessage = document.getElementById('no-music-libraries'); const loadMoreEntriesButton = document.getElementById('load-more-entries-button'); - const entriesWindowSize = 200; - // The global position of the first row currently on screen. Local row indexes are only meaningful after adding this offset, which - // is why the move and Load more logic use it for every comparison against the whole playlist. + const DEFAULT_PAGE_SIZE = 200; + // The page the first rendered row belongs to, the size of each page and the total number of pages. The global position of the + // first row currently on screen is derived from the page, and local row indexes are only meaningful after adding this offset, + // which is why the move and Load more logic use it for every comparison against the whole playlist. + let currentPage = 1; + let perPage = DEFAULT_PAGE_SIZE; + let numberOfPages = 0; let entriesOffset = 0; + if (playlist && playlist.entries) { + if (Number.isInteger(playlist.entries.currentPage) && playlist.entries.currentPage > 0) + currentPage = playlist.entries.currentPage; + if (Number.isInteger(playlist.entries.perPage) && playlist.entries.perPage > 0) + perPage = playlist.entries.perPage; + if (Number.isInteger(playlist.entries.numberOfPages)) + numberOfPages = playlist.entries.numberOfPages; + entriesOffset = (currentPage - 1) * perPage; + } let isInitialized = false; let draggedEntryId = null; let dragWasDropped = false; @@ -289,6 +303,32 @@ return itemUrlTemplate.replace(`/${EMPTY_GUID}`, `/${playlistId}`); } + // The entries of the page currently rendered, and the total the server reported for the whole playlist. + function getPlaylistEntries() { + return playlist && playlist.entries && Array.isArray(playlist.entries.data) ? playlist.entries.data : []; + } + + function getPlaylistEntryCount() { + return playlist && playlist.entries && Number.isFinite(playlist.entries.count) ? playlist.entries.count : getPlaylistEntries().length; + } + + function findEntryRow(entryId) { + if (!entriesContainer) + return null; + return Array.from(entriesContainer.querySelectorAll('.playlist-entry')) + .find(row => row.dataset.entryId === entryId) || null; + } + + // Applies a playlist read back from the server and derives the global position of its first row. + function applyPlaylistPage(page) { + playlist = page; + const entries = page && page.entries ? page.entries : null; + currentPage = entries && Number.isInteger(entries.currentPage) && entries.currentPage > 0 ? entries.currentPage : 1; + perPage = entries && Number.isInteger(entries.perPage) && entries.perPage > 0 ? entries.perPage : DEFAULT_PAGE_SIZE; + numberOfPages = entries && Number.isInteger(entries.numberOfPages) ? entries.numberOfPages : 0; + entriesOffset = (currentPage - 1) * perPage; + } + function formatDuration(totalSeconds) { const seconds = Number.isFinite(Number(totalSeconds)) ? Math.max(0, Math.floor(Number(totalSeconds))) : 0; const minutes = Math.floor(seconds / 60); @@ -387,12 +427,12 @@ } } - // Shows the load more control only while the page has entry windows left to fetch. + // Shows the load more control only while the page has entry pages left to fetch. function updateLoadMoreButton() { if (!loadMoreEntriesButton) return; - const loaded = Array.isArray(playlist.entries) ? playlist.entries.length : 0; - const total = Number.isFinite(playlist.entryCount) ? playlist.entryCount : loaded; + const loaded = getPlaylistEntries().length; + const total = getPlaylistEntryCount(); // The rows on screen start at entriesOffset, not at the beginning of the playlist, so the loaded count alone cannot tell // whether the whole playlist is on screen. const hasMore = entriesOffset + loaded < total; @@ -413,37 +453,89 @@ if (!entriesContainer) return; entriesContainer.querySelectorAll('.playlist-entry').forEach(row => row.remove()); - const entries = Array.isArray(playlist.entries) ? playlist.entries : []; - const total = Number.isFinite(playlist.entryCount) ? playlist.entryCount : entries.length; + const entries = getPlaylistEntries(); + const total = getPlaylistEntryCount(); if (total === 0) { noTracksMessage.classList.remove('hidden'); return; } noTracksMessage.classList.add('hidden'); - entries.forEach((entry, index) => entriesContainer.appendChild(createEntryRow(entry, index, entries.length))); + entries.forEach((entry, index) => entriesContainer.appendChild(createEntryRow(entry, index))); updateLoadMoreButton(); } - // Fetches the next window of entries and appends it to the rows already on screen. + // Whether the fetched page proves that the rendered window no longer matches the server. A page behind the requested one means + // the server clamped it because the playlist shrank, and a total smaller than the rendered rows means the rows themselves are + // stale. Neither can be fixed by appending, so the caller reloads the first page instead. + function pageShrankBeforeWindow(page, requestedPage) { + if (!page || !page.entries) + return false; + const resolvedPage = Number.isInteger(page.entries.currentPage) && page.entries.currentPage > 0 + ? page.entries.currentPage + : requestedPage; + return resolvedPage < requestedPage + || (Number.isInteger(page.entries.count) && page.entries.count < entriesOffset + getPlaylistEntries().length); + } + + // Replaces the rendered rows with the first page, which is the only window that is valid after the playlist shrank. + async function reloadFirstPageAsync() { + const page = await callApiGetAsync(`${getPlaylistUrl}?currentPage=1&perPage=${perPage}`); + if (!page || !page.entries || !Array.isArray(page.entries.data)) + return false; + applyPlaylistPage(page); + renderPlaylist(); + return true; + } + + // Merges the entries of one fetched page into the rows already on screen, without replacing them. A page that starts after the + // first entry that is not on screen would leave a hole in the rendered rows, so it is not merged and the Load more state stays + // responsible for reaching it. The rows are numbered from entriesOffset, which is only valid while the rendered entries are + // contiguous, so a page that overlaps the rendered rows is merged by Id and a page after a gap is left for Load more. + function mergeEntriesPage(page, pageNumber) { + if (!entriesContainer || !page || !page.entries || !Array.isArray(page.entries.data)) + return false; + // The server can clamp the requested page to the last one, so its answer is the page that actually arrived. + const resolvedPage = Number.isInteger(page.entries.currentPage) && page.entries.currentPage > 0 ? page.entries.currentPage : pageNumber; + const pageStart = (resolvedPage - 1) * perPage; + const entries = getPlaylistEntries(); + if (pageStart < entriesOffset || pageStart > entriesOffset + entries.length) + return false; + page.entries.data.forEach(entry => { + if (findEntryRow(entry.id)) + return; + entries.push(entry); + entriesContainer.appendChild(createEntryRow(entry, entries.length - 1)); + }); + playlist.entries.count = page.entries.count; + playlist.entries.numberOfPages = page.entries.numberOfPages; + numberOfPages = Number.isInteger(page.entries.numberOfPages) ? page.entries.numberOfPages : numberOfPages; + refreshEntryRows(); + return true; + } + + // Fetches the next page of entries and appends it to the rows already on screen. async function loadMoreEntriesAsync() { if (!entriesContainer || !loadMoreEntriesButton || isEntryMutationInFlight) return; - const loaded = Array.isArray(playlist.entries) ? playlist.entries.length : 0; - const total = Number.isFinite(playlist.entryCount) ? playlist.entryCount : loaded; + const loaded = getPlaylistEntries().length; + const total = getPlaylistEntryCount(); // The loaded rows begin at entriesOffset, so they cover the playlist only when offset plus loaded reaches the total. if (entriesOffset + loaded >= total) return; + // The next page is the one that contains the first entry that is not on screen yet. A removal shifts the entries by one, + // so this page can overlap the rows already rendered; rows are appended by Id, so the overlap is skipped and the shifted entry is not lost. + const nextPage = Math.floor((entriesOffset + loaded) / perPage) + 1; + if (numberOfPages > 0 && nextPage > numberOfPages) + return; setEntryMutationInFlight(true); try { - const page = await callApiGetAsync(`${getPlaylistUrl}?offset=${entriesOffset + loaded}&limit=${entriesWindowSize}`); - if (!page || !Array.isArray(page.entries)) + const page = await callApiGetAsync(`${getPlaylistUrl}?currentPage=${nextPage}&perPage=${perPage}`); + if (pageShrankBeforeWindow(page, nextPage)) { + if (!await reloadFirstPageAsync()) + notificationService.show(strings.refreshFailed, NotificationType.ERROR); return; - playlist.entryCount = page.entryCount; - page.entries.forEach(entry => { - playlist.entries.push(entry); - entriesContainer.appendChild(createEntryRow(entry, playlist.entries.length - 1, playlist.entries.length)); - }); - refreshEntryRows(); + } + mergeEntriesPage(page, nextPage); } finally { setEntryMutationInFlight(false); } @@ -454,7 +546,7 @@ if (!entriesContainer) return; const rows = Array.from(entriesContainer.querySelectorAll('.playlist-entry')); - const total = Number.isFinite(playlist.entryCount) ? playlist.entryCount : rows.length; + const total = getPlaylistEntryCount(); rows.forEach((row, index) => { // The move controls are guarded by the global position of the row, not by its index inside the loaded window. const globalIndex = entriesOffset + index; @@ -483,7 +575,7 @@ return; // Use the rows already on screen, not the post-push entries length, so the new row is numbered correctly before refreshEntryRows. const index = entriesContainer.querySelectorAll('.playlist-entry').length; - entriesContainer.appendChild(createEntryRow(entry, index, index + 1)); + entriesContainer.appendChild(createEntryRow(entry, index)); refreshEntryRows(); } @@ -514,11 +606,11 @@ // Keeps the in-memory entries in the same order as the rows, so playback and later moves use the order on screen. function syncPlaylistEntriesFromOrder(orderedEntryIds) { - const entriesById = new Map((playlist.entries || []).map(entry => [entry.id, entry])); - playlist.entries = orderedEntryIds + const entriesById = new Map(getPlaylistEntries().map(entry => [entry.id, entry])); + playlist.entries.data = orderedEntryIds .map(entryId => entriesById.get(entryId)) .filter(entry => !!entry); - playlist.entries.forEach((entry, index) => entry.position = entriesOffset + index); + playlist.entries.data.forEach((entry, index) => entry.position = entriesOffset + index); } // Applies a details update without touching the rows of the playlist. @@ -534,7 +626,7 @@ playlistDescriptionInput.value = playlist.description; } - function createEntryRow(entry, index, count) { + function createEntryRow(entry, index) { const row = document.createElement('div'); row.className = 'playlist-entry form-row'; row.dataset.entryId = entry.id; @@ -576,7 +668,7 @@ else // Escape, or a drop outside the list, cancels the drag. The DOM was already reordered while dragging, so it is // restored to the last order the server accepted instead of persisting the cancelled order. - applyEntryOrderByIds((playlist.entries || []).map(entry => entry.id)); + applyEntryOrderByIds(getPlaylistEntries().map(entry => entry.id)); }); row.appendChild(dragHandle); @@ -663,7 +755,7 @@ // The index passed to this function is local to the rendered rows. Disabling the move controls requires the global position, // otherwise the first row of a window that does not start at zero looks like the first row of the whole playlist. - const total = Number.isFinite(playlist.entryCount) ? playlist.entryCount : entriesOffset + count; + const total = getPlaylistEntryCount(); const globalIndex = entriesOffset + index; const moveUpButton = document.createElement('button'); @@ -701,7 +793,7 @@ return; const orderedEntryIds = Array.from(entriesContainer.querySelectorAll('.playlist-entry')) .map(row => row.dataset.entryId); - const currentEntryIds = (playlist.entries || []).map(entry => entry.id); + const currentEntryIds = getPlaylistEntries().map(entry => entry.id); if (orderedEntryIds.length !== currentEntryIds.length) { applyEntryOrderByIds(currentEntryIds); return; @@ -748,26 +840,40 @@ return; if (detail.playlist && detail.playlist.id && detail.playlist.id !== playlist.id) return; - // An append made elsewhere only announces the playlist Id. Re-read the window the user is currently looking at, instead of - // resetting the view to the first window and throwing a user who is deep in a large playlist back to the top. - const currentOffset = entriesOffset; - const updatedPlaylist = await callApiGetAsync(`${getPlaylistUrl}?offset=${currentOffset}&limit=${entriesWindowSize}`); - if (!updatedPlaylist) + // A local mutation already refreshes the view, so an external event that arrives while one is running must not read a + // playlist that the mutation is still changing. Dropping it avoids replacing the rows with an answer taken mid-write. + if (isEntryMutationInFlight) return; - if (currentOffset > 0 && updatedPlaylist.entries.length === 0 && updatedPlaylist.entryCount > 0) { - // The playlist shrank past this window. Show the last window instead of an empty page. - const lastWindowOffset = Math.max(0, updatedPlaylist.entryCount - entriesWindowSize); - const lastWindow = await callApiGetAsync(`${getPlaylistUrl}?offset=${lastWindowOffset}&limit=${entriesWindowSize}`); - if (!lastWindow) + setEntryMutationInFlight(true); + try { + // An append made elsewhere announces either a batch result with addedCount, or a single entry result with entry. + // The rows on screen start at currentPage, which is the first rendered page and never advances when more pages are + // loaded. The page to read is therefore the first page that is not fully rendered, not currentPage. Reading it merges + // the appended entries into the rows already on screen instead of replacing pages 2 and later with page 1. + const addedCount = Number.isInteger(detail.addedCount) ? detail.addedCount : (detail.entry ? 1 : 0); + if (addedCount > 0) { + playlist.entries.count = getPlaylistEntryCount() + addedCount; + playlist.entries.numberOfPages = perPage > 0 ? Math.ceil(playlist.entries.count / perPage) : 0; + numberOfPages = playlist.entries.numberOfPages; + } + if (detail.updatedOnUtc) + playlist.updatedOnUtc = detail.updatedOnUtc; + const loaded = getPlaylistEntries().length; + const nextPage = Math.floor((entriesOffset + loaded) / perPage) + 1; + if (nextPage > numberOfPages) return; - entriesOffset = lastWindowOffset; - playlist = lastWindow; - renderPlaylist(); - return; + const page = await callApiGetAsync(`${getPlaylistUrl}?currentPage=${nextPage}&perPage=${perPage}`); + if (!page || !page.entries || !Array.isArray(page.entries.data)) + return; + if (pageShrankBeforeWindow(page, nextPage)) { + if (!await reloadFirstPageAsync()) + notificationService.show(strings.refreshFailed, NotificationType.ERROR); + return; + } + mergeEntriesPage(page, nextPage); + } finally { + setEntryMutationInFlight(false); } - entriesOffset = currentOffset; - playlist = updatedPlaylist; - renderPlaylist(); } async function saveDetailsAsync(event) { @@ -823,7 +929,7 @@ // The server accepts a target position anywhere in the whole playlist. The target is therefore compared with the global // position of the row, so the first row of a shifted window can still move up and the last loaded row can still move down into // the entries that are not loaded yet. - const total = Number.isFinite(playlist.entryCount) ? playlist.entryCount : orderedEntryIds.length; + const total = getPlaylistEntryCount(); const targetGlobalIndex = entriesOffset + index + offset; if (targetGlobalIndex < 0 || targetGlobalIndex >= total) return; @@ -834,11 +940,11 @@ playlist.updatedOnUtc = result.data.updatedOnUtc; const isOutsideLoadedWindow = targetGlobalIndex < entriesOffset || targetGlobalIndex >= entriesOffset + orderedEntryIds.length; if (isOutsideLoadedWindow) { - // The row moved into a window that is not loaded, so another entry moved into its place. Re-read the current window + // The row moved into a page that is not loaded, so another entry moved into its place. Re-read the current page // instead of leaving an order on screen that the next Load more would duplicate. - const refreshedWindow = await callApiGetAsync(`${getPlaylistUrl}?offset=${entriesOffset}&limit=${entriesWindowSize}`); - if (refreshedWindow && Array.isArray(refreshedWindow.entries)) { - playlist = refreshedWindow; + const refreshedWindow = await callApiGetAsync(`${getPlaylistUrl}?currentPage=${currentPage}&perPage=${perPage}`); + if (refreshedWindow && refreshedWindow.entries && Array.isArray(refreshedWindow.entries.data)) { + applyPlaylistPage(refreshedWindow); renderPlaylist(); } else notificationService.show(strings.reorderFailed, NotificationType.ERROR); @@ -867,11 +973,13 @@ try { const removed = await callApiDeleteAsync(buildRemoveEntryUrl(entryId)); if (removed) { - // The row is removed from the existing DOM and the remaining rows are renumbered, so the page does not read the whole - // playlist back for a single removed entry. - playlist.entries = (playlist.entries || []).filter(entry => entry.id !== entryId); - playlist.entries.forEach((entry, index) => entry.position = entriesOffset + index); - playlist.entryCount = Math.max(0, (Number.isFinite(playlist.entryCount) ? playlist.entryCount : playlist.entries.length) - 1); + // The row is removed from the existing DOM and the remaining rows are renumbered, so the page does not read the whole playlist back for a single removed entry. + const totalBefore = getPlaylistEntryCount(); + playlist.entries.data = getPlaylistEntries().filter(entry => entry.id !== entryId); + playlist.entries.data.forEach((entry, index) => entry.position = entriesOffset + index); + playlist.entries.count = Math.max(0, totalBefore - 1); + playlist.entries.numberOfPages = perPage > 0 ? Math.ceil(playlist.entries.count / perPage) : 0; + numberOfPages = playlist.entries.numberOfPages; removeEntryRow(entryId); } else notificationService.show(strings.removeFailed, NotificationType.ERROR); @@ -880,18 +988,21 @@ } } - // Fetches every entry of the playlist in windows, for the explicit play action. A large playlist is never loaded for the page itself. + // Fetches every entry of the playlist page by page, for the explicit play action. A large playlist is never loaded for the page itself. async function fetchAllPlaylistEntriesAsync() { const allEntries = []; - let offset = 0; + let pageNumber = 1; while (true) { - const page = await callApiGetAsync(`${getPlaylistUrl}?offset=${offset}&limit=1000`); - if (!page || !Array.isArray(page.entries) || page.entries.length === 0) + const page = await callApiGetAsync(`${getPlaylistUrl}?currentPage=${pageNumber}&perPage=1000`); + if (!page || !page.entries || !Array.isArray(page.entries.data) || page.entries.data.length === 0) break; - allEntries.push(...page.entries); - offset += page.entries.length; - if (offset >= page.entryCount) + allEntries.push(...page.entries.data); + const totalPages = Number.isInteger(page.entries.numberOfPages) && page.entries.numberOfPages > 0 + ? page.entries.numberOfPages + : Math.max(1, Math.ceil(page.entries.count / 1000)); + if (allEntries.length >= page.entries.count || pageNumber >= totalPages) break; + pageNumber++; } return allEntries; } @@ -984,22 +1095,45 @@ try { const added = await callApiPostAsync(addEntryUrl, { trackId }); if (added && added.entry) { - playlist.entries = Array.isArray(playlist.entries) ? playlist.entries : []; - const totalBefore = Number.isFinite(playlist.entryCount) ? playlist.entryCount : playlist.entries.length; - if (playlist.entries.length >= totalBefore) { - playlist.entries.push(added.entry); - playlist.entryCount = totalBefore + 1; + const entries = getPlaylistEntries(); + const totalBefore = getPlaylistEntryCount(); + if (entries.length >= totalBefore) { + entries.push(added.entry); + playlist.entries.count = totalBefore + 1; + playlist.entries.numberOfPages = perPage > 0 ? Math.ceil(playlist.entries.count / perPage) : 0; + numberOfPages = playlist.entries.numberOfPages; playlist.updatedOnUtc = added.updatedOnUtc; appendEntryRow(added.entry); } else { - // The new entry is at the global end, beyond the loaded window, so the last window is loaded to show it. + // The new entry is at the global end, beyond the rendered rows. The count and the number of pages change even + // when the page that contains the new entry cannot be merged, because that page may start after the first entry + // that is not on screen. Keeping the optimistic values means Load more still leads to it. const newCount = totalBefore + 1; - const newOffset = Math.max(0, newCount - entriesWindowSize); - const page = await callApiGetAsync(`${getPlaylistUrl}?offset=${newOffset}&limit=${entriesWindowSize}`); - if (page) { - entriesOffset = newOffset; - playlist = page; - renderPlaylist(); + const newNumberOfPages = perPage > 0 ? Math.ceil(newCount / perPage) : 0; + playlist.entries.count = newCount; + playlist.entries.numberOfPages = newNumberOfPages; + numberOfPages = newNumberOfPages; + playlist.updatedOnUtc = added.updatedOnUtc; + // The last page is fetched to show the new entry, and merged only when it is the page that directly follows the + // rendered rows. When several pages are not on screen, replacing the rows with only the last page would hide the + // entries that were already rendered, so the page is left to Load more instead. + const lastPage = Math.max(1, Math.ceil(newCount / perPage)); + const page = await callApiGetAsync(`${getPlaylistUrl}?currentPage=${lastPage}&perPage=${perPage}`); + if (!page || !page.entries || !Array.isArray(page.entries.data)) { + // The add is committed and the counts above already include it, but the rows could not be read back. Saying so + // is what keeps the user from adding the same track again because the list still looks unchanged. + notificationService.show(strings.refreshFailed, NotificationType.ERROR); + } else if (pageShrankBeforeWindow(page, lastPage)) { + // Another client shrank the playlist while the rows were on screen, and the server clamped the requested page + // behind them. Appending would keep rows that no longer exist, so the whole window is read again. + if (!await reloadFirstPageAsync()) + notificationService.show(strings.refreshFailed, NotificationType.ERROR); + } else { + // The fetched page is authoritative for the totals, which can differ from the optimistic values when another request changed the playlist in the meantime. + playlist.entries.count = page.entries.count; + playlist.entries.numberOfPages = page.entries.numberOfPages; + numberOfPages = Number.isInteger(page.entries.numberOfPages) ? page.entries.numberOfPages : numberOfPages; + mergeEntriesPage(page, lastPage); } } resetCombobox(trackCombobox, strings.selectTrack); diff --git a/src/Lumina.Presentation.Web/Core/Views/Shared/_ThemeLayoutScripts.cshtml b/src/Lumina.Presentation.Web/Core/Views/Shared/_ThemeLayoutScripts.cshtml index aa01491c..6bc45064 100644 --- a/src/Lumina.Presentation.Web/Core/Views/Shared/_ThemeLayoutScripts.cshtml +++ b/src/Lumina.Presentation.Web/Core/Views/Shared/_ThemeLayoutScripts.cshtml @@ -104,6 +104,20 @@ add: '@localizer["AudioPlayerAdd"]' } }; + // The endpoints and labels of the favorite toggles that every media page and theme template can render. The script reads which + // items of a kind are favorites of the current user, adds a favorite, and removes one through the culture aware web routes, so + // the pages never hardcode a path. The remove route is rendered with its named mediaKind and mediaItemId placeholders intact, which + // the script fills in, so the two values keep their meaning even if the route segment order changes. The labels are serialized as + // script literals, because a localized text can contain characters that would end a quoted literal. + var favoritesConfiguration = { + getFavoriteStatusUrl: '@_urlService.GetRelativeUrl(WebRoutes.Favorites.GET_FAVORITE_STATUS)', + addFavoriteUrl: '@_urlService.GetRelativeUrl(WebRoutes.Favorites.ADD_FAVORITE)', + removeFavoriteUrlTemplate: '@_urlService.GetRelativeUrl(WebRoutes.Favorites.REMOVE_FAVORITE)', + strings: { + add: @Json.Serialize(localizer["FavoritesAdd"].Value), + remove: @Json.Serialize(localizer["FavoritesRemove"].Value) + } + }; @if (User?.Identity?.IsAuthenticated == true) { @@ -118,6 +132,7 @@ + diff --git a/src/Lumina.Presentation.Web/wwwroot/css/site.css b/src/Lumina.Presentation.Web/wwwroot/css/site.css index 2c57fdcf..0031ff53 100644 --- a/src/Lumina.Presentation.Web/wwwroot/css/site.css +++ b/src/Lumina.Presentation.Web/wwwroot/css/site.css @@ -1203,11 +1203,13 @@ body { } .tracks-table .track-play-column, + .tracks-table .track-favorite-column, .tracks-table .track-actions-column { width: 40px; } .tracks-table .track-play-cell, + .tracks-table .track-favorite-cell, .tracks-table .track-actions-cell { width: 40px; padding-left: 0; @@ -1264,6 +1266,68 @@ body { margin: 0 auto; } +/* The favorite heart of a media card: the box of the actions trigger, placed immediately on its left. The global favorites script writes the state attributes. */ +.card-favorite-toggle { + position: absolute; + right: 28px; + bottom: 28px; + width: 22px; + height: 22px; + display: none; + align-items: center; + justify-content: center; + cursor: pointer; + color: #6DCBFE; + border: 1px solid #777777; + border-bottom-color: #000000; + border-right-color: #000000; + background: linear-gradient(to bottom, #505050 0%, #464646 35%, #404040 55%, #363636 100%); + font-size: 16px; + line-height: 1; +} + +.card-favorite-toggle::after { + content: '\2665'; +} + +.media-card:hover .card-favorite-toggle, +.media-card.open .card-favorite-toggle, +.media-card:focus-within .card-favorite-toggle { + display: flex; +} + +.card-favorite-toggle:hover { + color: #FFFFFF; +} + +.card-favorite-toggle[aria-pressed="true"], +.card-favorite-toggle.is-favorite { + color: #FF5D5D; +} + +.card-favorite-toggle[data-favorite-state="loading"] { + opacity: 0.5; + cursor: progress; +} + +.card-favorite-toggle[data-favorite-state="failed"] { + border-color: #FF5D5D; +} + +/* A card without an actions trigger, like the cards of the favorites page, gives its place to the heart. The heart is the + only action of such a card, so it is always visible: a touch screen has no hover to reveal it, and a display: none control cannot be reached with the keyboard. */ +.media-card:not(:has(.card-actions-trigger)) > .card-favorite-toggle { + right: 2px; + display: flex; +} + +/* The track row places the same heart inline and always visible, instead of on a media card. */ +.track-favorite-cell .card-favorite-toggle { + position: static; + display: flex; + margin: 0 auto; +} + .card-actions-menu { display: none; position: fixed; diff --git a/src/Lumina.Presentation.Web/wwwroot/js/favorites.js b/src/Lumina.Presentation.Web/wwwroot/js/favorites.js new file mode 100644 index 00000000..637e7650 --- /dev/null +++ b/src/Lumina.Presentation.Web/wwwroot/js/favorites.js @@ -0,0 +1,553 @@ +/** + * Favorite toggles: the hearts of the media cards (books, artists and albums, and the cards of the favorites page) and of the + * track rows of the album page. The detail pages of an item have no toggle. + * + * A toggle is any focusable element, normally a button, that carries the `data-favorite-toggle` marker together with the + * `data-favorite-media-kind` (`MusicArtist`, `MusicAlbum`, `MusicTrack` or `Book`) and `data-favorite-media-item-id` + * attributes. The module owns the whole behavior of such an element, so a page or a theme template only renders the markup: + * it finds the toggles, asks the server which of their items the current user favorited, writes the state on them, and + * adds or removes the favorite when one is clicked. The state is exposed as `aria-pressed`, `data-favorite-state` + * (`favorited`, `not-favorited`, `loading` or `failed`) and the `is-favorite` class, so a theme owns the look. The module + * writes the localized text of the next action ("Add to favorites" or "Remove from favorites") as the `aria-label` and as + * the `title`, which is the hover text of a heart that has no visible text, and also as the text of the optional + * `.favorite-toggle-label` element. The module never renders markup: it only sets those attributes, the class and the text. + * + * Everything is attached once, to the document. The click listener uses event delegation and a MutationObserver hydrates + * the toggles that are added later, by a page script or by the in-place navigation that swaps the page content, so no page + * has to bind or unbind anything and loading this script a second time changes nothing. The state lives only on the + * elements and in the requests in flight: nothing is cached or stored in the browser, so the favorites of one user can + * never be shown to another user who signs in without a page reload. + * + * After every successful change the module dispatches the `lumina:favorite-changed` DOM event on the document, with + * `detail = { mediaKind, mediaItemId, isFavorite }`, so a page that lists favorites can react while it stays decoupled + * from the toggle that caused the change. + */ +(function () { + 'use strict'; + + // The layout may render this script on a page that already ran it, and the in-place navigation can evaluate scripts + // again. A second set of listeners would send every request twice, so the first load owns the document. + if (window.LuminaFavorites) + return; + + // The layout renders the route templates with empty Guids because the kind and the item are not known until a toggle + // is clicked. Replacing this sentinel keeps the route construction in one place and avoids hand-built paths. + const EMPTY_GUID = '00000000-0000-0000-0000-000000000000'; + // The favorite kinds the server supports today. Anything else is rejected here, so a typo in a template shows up as a + // failed toggle instead of as a request that the server would reject. + const MEDIA_KINDS = ['MusicArtist', 'MusicAlbum', 'MusicTrack', 'Book']; + // The server accepts up to 100 ids per status request, because the ids travel in the query string: 200 Guids are about + // 10 KB, which is more than the 8 KB request line the web server accepts by default, while 100 ids stay under 6 KB. + const MAX_STATUS_IDS_PER_REQUEST = 100; + const TOGGLE_SELECTOR = '[data-favorite-toggle]'; + const FAVORITE_CHANGED_EVENT = 'lumina:favorite-changed'; + const GUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/; + + // The status checks asked for in the current tick, grouped by kind and then by item Id. They are sent together on the + // next macrotask, so the toggles a page renders in a loop cost one request per kind instead of one per toggle. + let pendingStatus = new Map(); + let statusFlushHandle = null; + // The add or remove request of every item that is being changed. It makes a second click on the same item a no-op + // while the first request is in flight, whichever toggle of the item it comes from. + const mutationsInFlight = new Map(); + // A counter per item that moves every time the item changes. A status answer that was asked for before a change + // describes an old state, so it is dropped when the counter moved while the request was in flight. + const revisions = new Map(); + + /** + * Gets the favorites configuration the layout renders for every page. + * + * The configuration is the only contract between the layout and this module: it carries the routes and the localized + * labels. Reading it lazily, instead of capturing it when the script loads, lets the layout render the configuration + * after this deferred script has been parsed. + * @returns {Object|null} The configuration, or null when the layout did not render it. + */ + function getConfiguration() { + return window.favoritesConfiguration || null; + } + + /** + * Gets the localized strings of the favorites, with empty values when the layout did not render them. + * @returns {Object} The localized strings. + */ + function getStrings() { + const configuration = getConfiguration(); + return configuration && configuration.strings ? configuration.strings : {}; + } + + /** + * Normalizes a media kind to its canonical name. + * + * The comparison ignores the case, so a template that renders `musicalbum` still works, and the canonical name is what the routes and the request bodies carry. + * @param {*} mediaKind - The kind to normalize. + * @returns {string} The canonical kind name, or an empty string when the kind is not supported. + */ + function normalizeMediaKind(mediaKind) { + if (typeof mediaKind !== 'string') + return ''; + const lowered = mediaKind.trim().toLowerCase(); + return MEDIA_KINDS.find(kind => kind.toLowerCase() === lowered) || ''; + } + + /** + * Normalizes the Id of a media item to its lowercase Guid text. + * + * Ids are compared as text across the DOM and the server answers, and the casing of a Guid is not significant, so the + * lowercase form is the one key. An empty Guid is rejected because it never identifies an item. + * @param {*} mediaItemId - The Id to normalize. + * @returns {string} The lowercase Guid, or an empty string when the value is not a valid, non empty Guid. + */ + function normalizeMediaItemId(mediaItemId) { + if (typeof mediaItemId !== 'string') + return ''; + const lowered = mediaItemId.trim().toLowerCase(); + return GUID_PATTERN.test(lowered) && lowered !== EMPTY_GUID ? lowered : ''; + } + + /** + * Describes a media item by its normalized kind and Id. + * @param {*} mediaKind - The kind of the item. + * @param {*} mediaItemId - The Id of the item. + * @returns {Object|null} The item, with its kind, its Id and the key that identifies it, or null when either is invalid. + */ + function describeItem(mediaKind, mediaItemId) { + const kind = normalizeMediaKind(mediaKind); + const id = normalizeMediaItemId(mediaItemId); + if (!kind || !id) + return null; + return { kind, id, key: `${kind}:${id}` }; + } + + /** + * Reads the item a toggle element refers to from its data attributes. + * @param {Element} toggle - The toggle element. + * @returns {Object|null} The item, or null when the attributes are missing or invalid. + */ + function readToggleItem(toggle) { + return describeItem(toggle.getAttribute('data-favorite-media-kind'), toggle.getAttribute('data-favorite-media-item-id')); + } + + /** + * Collects the toggles inside an element, including the element itself. + * @param {Element|Document|DocumentFragment} root - The element to search. + * @returns {Array} The toggles that were found. + */ + function collectToggles(root) { + const toggles = []; + if (root.nodeType === Node.ELEMENT_NODE && root.matches(TOGGLE_SELECTOR)) + toggles.push(root); + if (typeof root.querySelectorAll === 'function') + root.querySelectorAll(TOGGLE_SELECTOR).forEach(toggle => toggles.push(toggle)); + return toggles; + } + + /** + * Finds every toggle of the document that refers to an item. + * + * A page can render the same item more than once, for example the artist in a header and in a list, and every one of + * them must show the same state. The toggles are looked up when a state is written, not remembered, so a toggle that + * was added while a request was in flight is also updated and a removed one is not touched. + * @param {string} key - The key of the item. + * @returns {Array} The toggles of the item. + */ + function findToggles(key) { + return collectToggles(document).filter(toggle => { + const item = readToggleItem(toggle); + return item !== null && item.key === key; + }); + } + + /** + * Gets the revision counter of an item. + * @param {string} key - The key of the item. + * @returns {number} The current revision. + */ + function getRevision(key) { + return revisions.get(key) || 0; + } + + /** + * Moves the revision counter of an item, which invalidates the status answers that are still in flight for it. + * @param {string} key - The key of the item. + */ + function bumpRevision(key) { + revisions.set(key, getRevision(key) + 1); + } + + /** + * Writes a state on a toggle: the pressed state, the state attribute, the class, and the localized label and hover text. + * + * The loading and failed states keep the pressed state the toggle already had, so the toggle does not flicker to + * "not favorite" while a request is in flight, and the label always names the action the next click performs. + * @param {Element} toggle - The toggle element. + * @param {string} state - The state to write: favorited, not-favorited, loading or failed. + * @param {boolean} isFavorite - Whether the toggle must show the item as a favorite. + */ + function renderToggle(toggle, state, isFavorite) { + toggle.setAttribute('data-favorite-state', state); + toggle.setAttribute('aria-pressed', isFavorite ? 'true' : 'false'); + toggle.classList.toggle('is-favorite', isFavorite); + if (state === 'loading') + toggle.setAttribute('aria-busy', 'true'); + else + toggle.removeAttribute('aria-busy'); + const label = isFavorite ? getStrings().remove : getStrings().add; + if (!label) + return; + toggle.setAttribute('aria-label', label); + toggle.setAttribute('title', label); + const labelElement = toggle.querySelector('.favorite-toggle-label'); + // The text is written only when it changes, so the observer of the document does not see a change per state write. + if (labelElement && labelElement.textContent !== label) + labelElement.textContent = label; + } + + /** + * Gets whether a toggle currently shows its item as a favorite. + * @param {Element} toggle - The toggle element. + * @returns {boolean} True when the toggle is pressed. + */ + function isPressed(toggle) { + return toggle.getAttribute('aria-pressed') === 'true'; + } + + /** + * Writes the settled state of an item on every toggle that shows it. + * @param {string} key - The key of the item. + * @param {boolean} isFavorite - Whether the item is a favorite of the current user. + */ + function applyFavoriteState(key, isFavorite) { + findToggles(key).forEach(toggle => renderToggle(toggle, isFavorite ? 'favorited' : 'not-favorited', isFavorite)); + } + + /** + * Builds the status request route of a batch of items of one kind. + * @param {string} kind - The kind of the items. + * @param {Array} ids - The Ids of the items to check. + * @returns {string} The route with its query string, or an empty string when the layout did not render the route. + */ + function buildStatusUrl(kind, ids) { + const configuration = getConfiguration(); + const url = configuration ? configuration.getFavoriteStatusUrl : ''; + if (typeof url !== 'string' || url.length === 0) + return ''; + const parameters = new URLSearchParams(); + parameters.set('mediaKind', kind); + ids.forEach(id => parameters.append('mediaItemIds', id)); + return `${url}${url.includes('?') ? '&' : '?'}${parameters.toString()}`; + } + + /** + * Builds the route that removes a favorite by replacing its named mediaKind and mediaItemId route placeholders. + * + * The layout renders the route template with the placeholders of the route intact, so each value is filled in by name and a change + * in the segment order cannot silently swap them. Both values are encoded so they stay single path segments even if the DOM value is malformed. + * @param {Object} item - The item to remove from the favorites. + * @returns {string} The route, or an empty string when the layout did not render the template. + */ + function buildRemoveUrl(item) { + const configuration = getConfiguration(); + const template = configuration ? configuration.removeFavoriteUrlTemplate : ''; + if (typeof template !== 'string' || template.length === 0) + return ''; + return template + .replace('{mediaKind}', encodeURIComponent(item.kind)) + .replace('{mediaItemId}', encodeURIComponent(item.id)); + } + + /** + * Asks the server which items of one kind are favorites of the current user, in one request. + * @param {string} kind - The kind of the items. + * @param {Array} ids - The Ids of the items to check. + * @returns {Promise>} The lowercase Ids, among the checked ones, that are favorites. + * @throws {Error} When the route is not available or the request failed. + */ + async function requestStatusAsync(kind, ids) { + const url = buildStatusUrl(kind, ids); + if (!url) + throw new Error('Favorites: the status route was not rendered by the layout.'); + if (typeof callApiGetAsync !== 'function') + throw new Error('Favorites: the global API helper is not available.'); + const data = await callApiGetAsync(url); + // The API helper resolves to undefined after it reported a failed request, and a malformed answer would let a toggle show a wrong state, so both are failures. + if (!data || !Array.isArray(data.favoritedMediaItemIds)) + throw new Error('Favorites: the status request failed.'); + return new Set(data.favoritedMediaItemIds.map(normalizeMediaItemId).filter(id => id !== '')); + } + + /** + * Resolves the waiters of one chunk of a status batch from a single request. + * @param {string} kind - The kind of the items of the chunk. + * @param {Array} ids - The Ids of the chunk. + * @param {Map>} waiters - The waiters of the whole batch, by item Id. + * @returns {Promise} A promise that completes when every waiter of the chunk was settled. + */ + async function resolveStatusChunkAsync(kind, ids, waiters) { + try { + const favorited = await requestStatusAsync(kind, ids); + ids.forEach(id => waiters.get(id).forEach(waiter => waiter.resolve(favorited.has(id)))); + } catch (error) { + console.error('Favorites: reading the favorite state failed.', error); + ids.forEach(id => waiters.get(id).forEach(waiter => waiter.reject(error))); + } + } + + /** + * Sends the status checks queued in the current tick, one request per kind and per chunk of ids. + * + * The ids of a kind are deduplicated by the queue, and split into chunks so the query string stays below the request line limit of the server. + */ + function flushStatusQueue() { + statusFlushHandle = null; + const batches = pendingStatus; + pendingStatus = new Map(); + batches.forEach((waiters, kind) => { + const ids = Array.from(waiters.keys()); + for (let start = 0; start < ids.length; start += MAX_STATUS_IDS_PER_REQUEST) + resolveStatusChunkAsync(kind, ids.slice(start, start + MAX_STATUS_IDS_PER_REQUEST), waiters); + }); + } + + /** + * Queues the status check of an item, so it is sent in one request together with the items asked for in the same tick. + * @param {Object} item - The item to check. + * @returns {Promise} A promise that resolves to whether the item is a favorite, and rejects when the check failed. + */ + function queueStatusCheck(item) { + return new Promise((resolve, reject) => { + if (!pendingStatus.has(item.kind)) + pendingStatus.set(item.kind, new Map()); + const waiters = pendingStatus.get(item.kind); + if (!waiters.has(item.id)) + waiters.set(item.id, []); + waiters.get(item.id).push({ resolve, reject }); + if (statusFlushHandle === null) + statusFlushHandle = setTimeout(flushStatusQueue, 0); + }); + } + + /** + * Reads the favorite state of the toggles from the server and writes it on them. + * + * A toggle with a settled state keeps showing it while the state is checked again, which is what happens when the + * in-place navigation renders a page again, so nothing flickers. A toggle without a settled state shows the loading state. An item that is being + * changed is skipped, because its change writes the state when it completes, and an answer that was overtaken by a change is dropped. + * A failed check marks the toggles that have no settled state as failed, and a click on such a toggle checks it again. + * @param {Array} toggles - The toggles to hydrate. + * @returns {Promise} A promise that completes when every check has finished. It never rejects. + */ + async function hydrateToggles(toggles) { + const checks = new Map(); + for (const toggle of toggles) { + const item = readToggleItem(toggle); + if (!item) { + console.warn('Favorites: a toggle has an invalid media kind or media item Id.', toggle); + renderToggle(toggle, 'failed', false); + continue; + } + if (mutationsInFlight.has(item.key)) + continue; + const state = toggle.getAttribute('data-favorite-state'); + if (state !== 'favorited' && state !== 'not-favorited') + renderToggle(toggle, 'loading', isPressed(toggle)); + if (!checks.has(item.key)) + checks.set(item.key, { item, revision: getRevision(item.key) }); + } + await Promise.all(Array.from(checks.values(), check => queueStatusCheck(check.item).then( + isFavorite => { + if (getRevision(check.item.key) === check.revision && !mutationsInFlight.has(check.item.key)) + applyFavoriteState(check.item.key, isFavorite); + }, + () => { + findToggles(check.item.key) + .filter(toggle => toggle.getAttribute('data-favorite-state') === 'loading') + .forEach(toggle => renderToggle(toggle, 'failed', isPressed(toggle))); + }))); + } + + /** + * Adds or removes the favorite on the server, and writes the result on every toggle of the item. + * + * Every toggle of the item shows the loading state meanwhile. On success they show the new state and the change event + * is dispatched. On failure they get back the state they had, because a failed request changed nothing, and the failure is reported by the global API helper. + * @param {Object} item - The item to change. + * @param {boolean} shouldFavorite - True to add the favorite, false to remove it. + * @returns {Promise} A promise that resolves to whether the change was made. + */ + async function changeFavoriteAsync(item, shouldFavorite) { + const previousStates = new Map(); + findToggles(item.key).forEach(toggle => { + previousStates.set(toggle, { state: toggle.getAttribute('data-favorite-state'), isFavorite: isPressed(toggle) }); + renderToggle(toggle, 'loading', isPressed(toggle)); + }); + bumpRevision(item.key); + + let isChanged = false; + try { + const configuration = getConfiguration(); + if (shouldFavorite) { + const addUrl = configuration ? configuration.addFavoriteUrl : ''; + if (addUrl) { + const result = await callApiPostAsync(addUrl, { mediaKind: item.kind, mediaItemId: item.id }); + isChanged = Boolean(result); + } + } else { + const removeUrl = buildRemoveUrl(item); + if (removeUrl) + isChanged = Boolean(await callApiDeleteAsync(removeUrl)); + } + } catch (error) { + // The API helpers normally resolve to a falsy value on failure; this catch is for unexpected errors, such as a + // rejected promise from a test double. The toggles must leave the loading state either way. + console.error('Favorites: changing the favorite failed.', error); + } + + bumpRevision(item.key); + if (isChanged) { + applyFavoriteState(item.key, shouldFavorite); + document.dispatchEvent(new CustomEvent(FAVORITE_CHANGED_EVENT, { + detail: { mediaKind: item.kind, mediaItemId: item.id, isFavorite: shouldFavorite } + })); + return true; + } + + // A toggle added while the request was in flight has no remembered state, so it gets the state that was true before the change. + findToggles(item.key).forEach(toggle => { + const previous = previousStates.get(toggle) || { state: shouldFavorite ? 'not-favorited' : 'favorited', isFavorite: !shouldFavorite }; + const state = previous.state === 'favorited' || previous.state === 'not-favorited' ? previous.state : 'failed'; + renderToggle(toggle, state, previous.isFavorite); + }); + return false; + } + + /** + * Adds a media item to the favorites of the current user, or removes it. + * + * A second call for an item that is already being changed is ignored: it resolves to the result of the running change + * when it asks for the same state, and to false when it asks for the opposite one, so a double click can never send two requests. + * @param {string} mediaKind - The kind of the item: MusicArtist, MusicAlbum, MusicTrack or Book. + * @param {string} mediaItemId - The Id of the item. + * @param {boolean} shouldFavorite - True to add the favorite, false to remove it. + * @returns {Promise} A promise that resolves to true when the favorite state of the item is now the requested + * one, and to false when the change was not made. A failure is reported to the user, so the caller only needs to react to the result. + */ + function setFavoriteAsync(mediaKind, mediaItemId, shouldFavorite) { + const item = describeItem(mediaKind, mediaItemId); + if (!item) { + console.error('Favorites: the media kind or the media item Id is invalid.', mediaKind, mediaItemId); + return Promise.resolve(false); + } + const wanted = Boolean(shouldFavorite); + const running = mutationsInFlight.get(item.key); + if (running) + return running.shouldFavorite === wanted ? running.promise : Promise.resolve(false); + const promise = changeFavoriteAsync(item, wanted).finally(() => mutationsInFlight.delete(item.key)); + mutationsInFlight.set(item.key, { shouldFavorite: wanted, promise }); + return promise; + } + + /** + * Gets whether a media item is a favorite of the current user. + * + * The answer always comes from the server, never from a cache, and the check is batched with the other checks asked for in the same tick. + * @param {string} mediaKind - The kind of the item: MusicArtist, MusicAlbum, MusicTrack or Book. + * @param {string} mediaItemId - The Id of the item. + * @returns {Promise} A promise that resolves to whether the item is a favorite. It rejects when the kind or the + * Id is invalid or the request failed; the failure of a request is also reported to the user. + */ + function isFavorite(mediaKind, mediaItemId) { + const item = describeItem(mediaKind, mediaItemId); + if (!item) + return Promise.reject(new Error('Favorites: the media kind or the media item Id is invalid.')); + return queueStatusCheck(item); + } + + /** + * Hydrates the favorite toggles inside an element: reads which of their items are favorites and writes the state. + * + * The module already hydrates the toggles of the page and the ones that are added to it, so a page only needs this + * for toggles that live in an element that is not attached to the document yet. + * @param {Element|Document} [rootElement] - The element to search for toggles. Defaults to the whole document. + * @returns {Promise} A promise that completes when the state of the toggles was written. It never rejects. + */ + function hydrate(rootElement) { + const root = rootElement || document; + if (!root || typeof root.querySelectorAll !== 'function') + return Promise.resolve(); + return hydrateToggles(collectToggles(root)); + } + + /** + * Handles a click on the document and toggles the favorite when the click happened on a favorite toggle. + * + * The click is handled by delegation, so a toggle works wherever it is rendered, even inside a link or a card, and a + * toggle that is added later needs no listener. The default action is prevented, so a toggle inside a link does not also navigate. + * @param {MouseEvent} event - The click event. + */ + function handleClick(event) { + const target = event.target; + if (!target || typeof target.closest !== 'function') + return; + const toggle = target.closest(TOGGLE_SELECTOR); + if (!toggle) + return; + event.preventDefault(); + const item = readToggleItem(toggle); + if (!item) + return; + const state = toggle.getAttribute('data-favorite-state'); + if (state === 'loading' || mutationsInFlight.has(item.key)) + return; + // The real state of the item is not known, because the toggle was not hydrated yet or its hydration failed, so a + // click would guess the direction. The click reads the state again instead, and the next click acts on it. + if (state !== 'favorited' && state !== 'not-favorited') { + hydrateToggles([toggle]); + return; + } + setFavoriteAsync(item.kind, item.id, !isPressed(toggle)); + } + + /** + * Hydrates the toggles that were added to the document, and the toggles whose item attributes changed. + * + * This is how the toggles that a page script renders, or that the in-place navigation swaps in, get their state + * without any call from the page. The writes of this module only touch attributes that are not observed and text nodes, so the observer cannot trigger itself. + * @param {Array} mutations - The mutations of the document. + */ + function handleMutations(mutations) { + const toggles = new Set(); + for (const mutation of mutations) { + if (mutation.type === 'attributes') { + if (mutation.target.nodeType === Node.ELEMENT_NODE && mutation.target.matches(TOGGLE_SELECTOR)) { + // The element now refers to another item, so the state it shows belongs to the old one. + mutation.target.removeAttribute('data-favorite-state'); + toggles.add(mutation.target); + } + continue; + } + mutation.addedNodes.forEach(node => { + if (node.nodeType === Node.ELEMENT_NODE) + collectToggles(node).forEach(toggle => toggles.add(toggle)); + }); + } + if (toggles.size > 0) + hydrateToggles(Array.from(toggles)); + } + + document.addEventListener('click', handleClick); + new MutationObserver(handleMutations).observe(document.documentElement, { + childList: true, + subtree: true, + attributes: true, + attributeFilter: ['data-favorite-toggle', 'data-favorite-media-kind', 'data-favorite-media-item-id'] + }); + + window.LuminaFavorites = { + hydrate, + isFavorite, + setFavoriteAsync + }; + + // The script is deferred, so the toggles that the server rendered are already in the document. + hydrate(document); +})(); diff --git a/src/Lumina.sln b/src/Lumina.sln index 25d0deee..5a54227f 100644 --- a/src/Lumina.sln +++ b/src/Lumina.sln @@ -78,6 +78,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "authorization", "authorizat ..\docs\technical\api\admin\authorization\Api.Roles.md = ..\docs\technical\api\admin\authorization\Api.Roles.md EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "favorites", "favorites", "{A841E8D2-F3C9-403D-BAE1-A087B8040C61}" + ProjectSection(SolutionItems) = preProject + ..\docs\technical\api\favorites\Api.Favorites.md = ..\docs\technical\api\favorites\Api.Favorites.md + EndProjectSection +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "file-system-management", "file-system-management", "{2FA735A6-2141-44AB-B34C-F65E4195B1EB}" ProjectSection(SolutionItems) = preProject ..\docs\technical\api\file-system-management\Api.Directories.md = ..\docs\technical\api\file-system-management\Api.Directories.md @@ -178,6 +183,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "architecture-decision-log", ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0014.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0014.md ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0015.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0015.md ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0016.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0016.md + ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0017.md = ..\docs\technical\architecture\architecture-knowledge-management\architecture-decision-log\architecture-decision-record-0017.md EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "domain", "domain", "{3EE8EFDF-4D55-4EA3-BEE2-74D00CB50570}" @@ -214,6 +220,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "roles", "roles", "{3BCFBE37 ..\docs\technical\requests\admin\authorization\roles\UpdateRole.http = ..\docs\technical\requests\admin\authorization\roles\UpdateRole.http EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "favorites", "favorites", "{8D16AB83-DE2B-4527-AFFC-9F3292AC4CA9}" + ProjectSection(SolutionItems) = preProject + ..\docs\technical\requests\favorites\AddFavorite.http = ..\docs\technical\requests\favorites\AddFavorite.http + ..\docs\technical\requests\favorites\GetFavoriteStatus.http = ..\docs\technical\requests\favorites\GetFavoriteStatus.http + ..\docs\technical\requests\favorites\GetFavorites.http = ..\docs\technical\requests\favorites\GetFavorites.http + ..\docs\technical\requests\favorites\RemoveFavorite.http = ..\docs\technical\requests\favorites\RemoveFavorite.http + EndProjectSection +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "file-system-management", "file-system-management", "{6D5C6E19-67A1-4327-A958-1EC0DA6E9D7D}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directories", "directories", "{B6A1AB2C-766F-4DC2-894A-4DF1FE102AED}" @@ -1389,6 +1403,7 @@ Global {D78A725D-C3AE-420B-ABA8-255A000D7324} = {64570222-A5AC-49EE-BEBC-25D61B989A20} {459EF701-AB73-40ED-81E6-144D3587C667} = {D78A725D-C3AE-420B-ABA8-255A000D7324} {08113205-695B-4DA4-8355-6C5377BBD8C0} = {459EF701-AB73-40ED-81E6-144D3587C667} + {A841E8D2-F3C9-403D-BAE1-A087B8040C61} = {D78A725D-C3AE-420B-ABA8-255A000D7324} {2FA735A6-2141-44AB-B34C-F65E4195B1EB} = {D78A725D-C3AE-420B-ABA8-255A000D7324} {6A5D3BED-AE4A-4D26-B12A-5DE996152A64} = {D78A725D-C3AE-420B-ABA8-255A000D7324} {252D7F8D-991F-4C62-9BB1-D13988D7B4E2} = {6A5D3BED-AE4A-4D26-B12A-5DE996152A64} @@ -1410,6 +1425,7 @@ Global {A9BD996E-E8E8-4C34-B792-5E6A00BD5938} = {48BAE4E1-B3E7-4517-82BF-51D5B884E2E4} {7DC07C5C-4877-45DF-86C2-D93069EA7608} = {A9BD996E-E8E8-4C34-B792-5E6A00BD5938} {3BCFBE37-A64D-4F3C-9D18-E37E89CB490F} = {A9BD996E-E8E8-4C34-B792-5E6A00BD5938} + {8D16AB83-DE2B-4527-AFFC-9F3292AC4CA9} = {B45637D3-840C-4898-A047-C6FB568FFFE6} {6D5C6E19-67A1-4327-A958-1EC0DA6E9D7D} = {B45637D3-840C-4898-A047-C6FB568FFFE6} {B6A1AB2C-766F-4DC2-894A-4DF1FE102AED} = {6D5C6E19-67A1-4327-A958-1EC0DA6E9D7D} {82D80C8B-593E-4E54-BDC2-26931EA3E2D6} = {6D5C6E19-67A1-4327-A958-1EC0DA6E9D7D} diff --git a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDtoFixture.cs deleted file mode 100644 index a3d75dc1..00000000 --- a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDtoFixture.cs +++ /dev/null @@ -1,55 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Bogus; -using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -#endregion - -namespace Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; - -/// -/// Fixture class for the class. -/// -[ExcludeFromCodeCoverage] -public class PaginatedMusicAlbumLiteDtoFixture -{ - private readonly Faker _faker = new(); - private readonly MusicAlbumLiteDtoFixture _musicAlbumLiteDtoFixture = new(); - - /// - /// Creates a new instance with randomized test data. - /// - /// Optional. The collection of lightweight album elements. - /// Optional. The current page number in the paginated collection. - /// Optional. The number of items to include per page. - /// Optional. The total number of elements available in the result set. - /// Optional. The total number of pages available. - /// A configured instance. - public PaginatedMusicAlbumLiteDto Create( - IReadOnlyList? data = null, - int? currentPage = null, - int? perPage = null, - int? count = null, - int? numberOfPages = null) - { - return new PaginatedMusicAlbumLiteDto - { - Data = data ?? [.. _musicAlbumLiteDtoFixture.CreateMany(_faker.Random.Number(1, 3))], - CurrentPage = currentPage ?? _faker.Random.Int(1, 10), - PerPage = perPage ?? _faker.Random.Int(1, 100), - Count = count ?? _faker.Random.Int(0, 1000), - NumberOfPages = numberOfPages ?? _faker.Random.Int(1, 100) - }; - } - - /// - /// Creates multiple instances with randomized test data. - /// - /// Number of instances to create. - /// List of configured instances. - public List CreateMany(int count = 3) - { - return [.. Enumerable.Range(0, count).Select(_ => Create())]; - } -} diff --git a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicArtistLiteDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicArtistLiteDtoFixture.cs deleted file mode 100644 index dea5fd9e..00000000 --- a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicArtistLiteDtoFixture.cs +++ /dev/null @@ -1,55 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Bogus; -using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -#endregion - -namespace Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; - -/// -/// Fixture class for the class. -/// -[ExcludeFromCodeCoverage] -public class PaginatedMusicArtistLiteDtoFixture -{ - private readonly Faker _faker = new(); - private readonly MusicArtistLiteDtoFixture _musicArtistLiteDtoFixture = new(); - - /// - /// Creates a new instance with randomized test data. - /// - /// Optional. The collection of lightweight artist elements. - /// Optional. The current page number in the paginated collection. - /// Optional. The number of items to include per page. - /// Optional. The total number of elements available in the result set. - /// Optional. The total number of pages available. - /// A configured instance. - public PaginatedMusicArtistLiteDto Create( - IReadOnlyList? data = null, - int? currentPage = null, - int? perPage = null, - int? count = null, - int? numberOfPages = null) - { - return new PaginatedMusicArtistLiteDto - { - Data = data ?? [.. _musicArtistLiteDtoFixture.CreateMany(_faker.Random.Number(1, 3))], - CurrentPage = currentPage ?? _faker.Random.Int(1, 10), - PerPage = perPage ?? _faker.Random.Int(1, 100), - Count = count ?? _faker.Random.Int(0, 1000), - NumberOfPages = numberOfPages ?? _faker.Random.Int(1, 100) - }; - } - - /// - /// Creates multiple instances with randomized test data. - /// - /// Number of instances to create. - /// List of configured instances. - public List CreateMany(int count = 3) - { - return [.. Enumerable.Range(0, count).Select(_ => Create())]; - } -} diff --git a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicTrackLiteDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicTrackLiteDtoFixture.cs deleted file mode 100644 index c034f61c..00000000 --- a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicTrackLiteDtoFixture.cs +++ /dev/null @@ -1,55 +0,0 @@ -#region ========================================================================= USING ===================================================================================== -using Bogus; -using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -#endregion - -namespace Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; - -/// -/// Fixture class for the class. -/// -[ExcludeFromCodeCoverage] -public class PaginatedMusicTrackLiteDtoFixture -{ - private readonly Faker _faker = new(); - private readonly MusicTrackLiteDtoFixture _musicTrackLiteDtoFixture = new(); - - /// - /// Creates a new instance with randomized test data. - /// - /// Optional. The collection of lightweight track elements. - /// Optional. The current page number in the paginated collection. - /// Optional. The number of items to include per page. - /// Optional. The total number of elements available in the result set. - /// Optional. The total number of pages available. - /// A configured instance. - public PaginatedMusicTrackLiteDto Create( - IReadOnlyList? data = null, - int? currentPage = null, - int? perPage = null, - int? count = null, - int? numberOfPages = null) - { - return new PaginatedMusicTrackLiteDto - { - Data = data ?? [.. _musicTrackLiteDtoFixture.CreateMany(_faker.Random.Number(1, 3))], - CurrentPage = currentPage ?? _faker.Random.Int(1, 10), - PerPage = perPage ?? _faker.Random.Int(1, 100), - Count = count ?? _faker.Random.Int(0, 1000), - NumberOfPages = numberOfPages ?? _faker.Random.Int(1, 100) - }; - } - - /// - /// Creates multiple instances with randomized test data. - /// - /// Number of instances to create. - /// List of configured instances. - public List CreateMany(int count = 3) - { - return [.. Enumerable.Range(0, count).Select(_ => Create())]; - } -} diff --git a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Libraries/PaginatedBookLiteDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Common/PaginatedDtoFixture.cs similarity index 50% rename from tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Libraries/PaginatedBookLiteDtoFixture.cs rename to tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Common/PaginatedDtoFixture.cs index 77b8f2f1..82f8e5a7 100644 --- a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Libraries/PaginatedBookLiteDtoFixture.cs +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Common/PaginatedDtoFixture.cs @@ -1,53 +1,52 @@ #region ========================================================================= USING ===================================================================================== using Bogus; -using Lumina.Presentation.Web.Common.DTO.Libraries; +using Lumina.Presentation.Web.Common.DTO.Common; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; #endregion -namespace Lumina.Presentation.Web.Fixtures.Common.DTO.Libraries; +namespace Lumina.Presentation.Web.Fixtures.Common.DTO.Common; /// -/// Fixture class for the class. +/// Fixture class for the class. /// +/// The type of the elements of the page. [ExcludeFromCodeCoverage] -public class PaginatedBookLiteDtoFixture +public class PaginatedDtoFixture { private readonly Faker _faker = new(); /// - /// Creates a new instance with randomized test data. + /// Creates a new instance with randomized test data. /// - /// Optional collection of lightweight book elements. + /// Optional collection of elements of the page. /// Optional current page number in a paginated collection. /// Optional number of items to include per page in paginated results. /// Optional total number of elements available in the paginated result set. /// Optional total number of pages based on the elements available and per page. - /// A configured instance. - public PaginatedBookLiteDto Create( - IReadOnlyList? data = null, + /// A configured instance. + public PaginatedDto Create( + IReadOnlyList? data = null, int? currentPage = null, int? perPage = null, int? count = null, int? numberOfPages = null) { - return new PaginatedBookLiteDto - { - Data = data ?? [], - CurrentPage = currentPage ?? _faker.Random.Int(1, 10), - PerPage = perPage ?? _faker.Random.Int(1, 100), - Count = count ?? _faker.Random.Int(0, 1000), - NumberOfPages = numberOfPages ?? _faker.Random.Int(1, 100) - }; + return new PaginatedDto( + Data: data is null ? [] : [.. data], + CurrentPage: currentPage ?? _faker.Random.Int(1, 10), + PerPage: perPage ?? _faker.Random.Int(1, 100), + Count: count ?? _faker.Random.Int(0, 1000), + NumberOfPages: numberOfPages ?? _faker.Random.Int(1, 100)); } /// - /// Creates multiple instances with randomized test data. + /// Creates multiple instances with randomized test data. /// /// Number of instances to create. - /// List of configured instances. - public List CreateMany(int count = 3) + /// List of configured instances. + public List> CreateMany(int count = 3) { return [.. Enumerable.Range(0, count).Select(_ => Create())]; } diff --git a/tests/IntegrationTests/Lumina.DataAccess.IntegrationTests/Core/Repositories/Playlists/PlaylistRepositoryTests.cs b/tests/IntegrationTests/Lumina.DataAccess.IntegrationTests/Core/Repositories/Playlists/PlaylistRepositoryTests.cs index 6b9479c4..a6bd2a64 100644 --- a/tests/IntegrationTests/Lumina.DataAccess.IntegrationTests/Core/Repositories/Playlists/PlaylistRepositoryTests.cs +++ b/tests/IntegrationTests/Lumina.DataAccess.IntegrationTests/Core/Repositories/Playlists/PlaylistRepositoryTests.cs @@ -2,6 +2,7 @@ using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary; using Lumina.Application.Common.DataAccess.Entities.Playlists; using Lumina.Application.Common.DataAccess.Entities.UsersManagement; +using Lumina.Application.Common.DTO.Pagination; using Lumina.Application.Common.DTO.Playlists; using Lumina.Application.Common.Infrastructure.Authentication; using Lumina.Application.Common.Infrastructure.Time; @@ -189,12 +190,20 @@ public class PlaylistRepositoryTests Assert.Equal(orderedTracks.Count, storedPlaylist.EntryCount); Assert.Equal(1L, storedPlaylist.Version); Assert.Equal(updatedOnUtc, storedPlaylist.UpdatedOnUtc); - // A window read reports the stored count of the whole playlist while materializing only the requested window. - Result detailsResult = await sut.GetDetailsForUserAsync(playlist.Id, userId, offset: 0, limit: 2, CancellationToken.None); + // A paginated read reports the count of the whole playlist while materializing only the requested page. + Result detailsResult = await sut.GetDetailsForUserAsync( + playlist.Id, + userId, + new PaginationDataDto { CurrentPage = 1, PerPage = 2 }, + CancellationToken.None); Assert.False(detailsResult.IsFailure); Assert.NotNull(detailsResult.Value); Assert.Equal(orderedTracks.Count, detailsResult.Value!.Playlist.EntryCount); - Assert.Equal(2, detailsResult.Value.Entries.Count); + Assert.Equal(orderedTracks.Count, detailsResult.Value.Entries.Count); + Assert.Equal(2, detailsResult.Value.Entries.Data.Count); + Assert.Equal(1, detailsResult.Value.Entries.CurrentPage); + Assert.Equal(2, detailsResult.Value.Entries.PerPage); + Assert.Equal((int)Math.Ceiling(orderedTracks.Count / 2d), detailsResult.Value.Entries.NumberOfPages); } [Fact] diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs index a67fd33a..669ac60b 100644 --- a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs @@ -1,7 +1,9 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetArtistAlbums; using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; using Lumina.Presentation.Web.IntegrationTests.Common.Setup; using System; @@ -22,7 +24,7 @@ namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioL public class GetArtistAlbumsEndpointTests : IClassFixture { private readonly LuminaWebFactory _apiFactory; - private readonly PaginatedMusicAlbumLiteDtoFixture _paginatedMusicAlbumLiteDtoFixture = new(); + private readonly PaginatedDtoFixture _paginatedMusicAlbumLiteDtoFixture = new(); private readonly MusicAlbumLiteDtoFixture _musicAlbumLiteDtoFixture = new(); /// @@ -41,7 +43,7 @@ public class GetArtistAlbumsEndpointTests : IClassFixture _apiFactory.ApiClientStub.Reset(); Guid libraryId = Guid.NewGuid(); Guid artistId = Guid.NewGuid(); - PaginatedMusicAlbumLiteDto expectedResponse = _paginatedMusicAlbumLiteDtoFixture.Create(data: [_musicAlbumLiteDtoFixture.Create(title: "Test Album")]); + PaginatedDto expectedResponse = _paginatedMusicAlbumLiteDtoFixture.Create(data: [_musicAlbumLiteDtoFixture.Create(title: "Test Album")]); string expectedEndpoint = $"libraries/{libraryId}/artists/{artistId}/albums/lite?currentPage=1&perPage=20"; _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, expectedResponse); AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs index 035aac1a..7438088c 100644 --- a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs @@ -1,7 +1,9 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtists; using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; using Lumina.Presentation.Web.IntegrationTests.Common.Setup; using System; @@ -22,7 +24,7 @@ namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioL public class GetMusicArtistsEndpointTests : IClassFixture { private readonly LuminaWebFactory _apiFactory; - private readonly PaginatedMusicArtistLiteDtoFixture _paginatedMusicArtistLiteDtoFixture = new(); + private readonly PaginatedDtoFixture _paginatedMusicArtistLiteDtoFixture = new(); private readonly MusicArtistLiteDtoFixture _musicArtistLiteDtoFixture = new(); /// diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs index f3e18f1c..17c97537 100644 --- a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs @@ -1,7 +1,9 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetAlbumTracks; using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; using Lumina.Presentation.Web.IntegrationTests.Common.Setup; using System; @@ -22,7 +24,7 @@ namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioL public class GetAlbumTracksEndpointTests : IClassFixture { private readonly LuminaWebFactory _apiFactory; - private readonly PaginatedMusicTrackLiteDtoFixture _paginatedMusicTrackLiteDtoFixture = new(); + private readonly PaginatedDtoFixture _paginatedMusicTrackLiteDtoFixture = new(); private readonly MusicTrackLiteDtoFixture _musicTrackLiteDtoFixture = new(); /// @@ -42,7 +44,7 @@ public class GetAlbumTracksEndpointTests : IClassFixture Guid libraryId = Guid.NewGuid(); Guid artistId = Guid.NewGuid(); Guid albumId = Guid.NewGuid(); - PaginatedMusicTrackLiteDto expectedResponse = _paginatedMusicTrackLiteDtoFixture.Create(data: [_musicTrackLiteDtoFixture.Create(title: "Test Track")]); + PaginatedDto expectedResponse = _paginatedMusicTrackLiteDtoFixture.Create(data: [_musicTrackLiteDtoFixture.Create(title: "Test Track")]); string expectedEndpoint = $"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/lite?currentPage=1&perPage=20"; _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, expectedResponse); AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointTests.cs index 27ff397e..63815568 100644 --- a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointTests.cs +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointTests.cs @@ -1,6 +1,8 @@ #region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.DTO.Libraries; using Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.GetLibraryItems; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; using Lumina.Presentation.Web.Fixtures.Common.DTO.Libraries; using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; using Lumina.Presentation.Web.IntegrationTests.Common.Setup; @@ -22,7 +24,7 @@ namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.Writte public class GetLibraryItemsEndpointTests : IClassFixture { private readonly LuminaWebFactory _apiFactory; - private readonly PaginatedBookLiteDtoFixture _paginatedBookLiteDtoFixture = new(); + private readonly PaginatedDtoFixture _paginatedBookLiteDtoFixture = new(); private readonly BookLiteDtoFixture _bookLiteDtoFixture = new(); /// @@ -41,7 +43,7 @@ public class GetLibraryItemsEndpointTests : IClassFixture _apiFactory.ApiClientStub.Reset(); Guid libraryId = Guid.NewGuid(); string searchTerm = "Harry"; - PaginatedBookLiteDto expectedResponse = _paginatedBookLiteDtoFixture.Create(data: [_bookLiteDtoFixture.Create(title: "Harry Potter")]); + PaginatedDto expectedResponse = _paginatedBookLiteDtoFixture.Create(data: [_bookLiteDtoFixture.Create(title: "Harry Potter")]); string expectedEndpoint = $"libraries/{libraryId}/books/lite?currentPage=1&perPage=20&searchTerm={searchTerm}&shouldIgnoreThePrefixForAlphaPicker=True"; _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, expectedResponse); AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs index e678722a..0658ff50 100644 --- a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs @@ -1,6 +1,8 @@ #region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetArtistAlbums; using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; using Lumina.Presentation.Web.SecurityTests.Common.Setup; using System; @@ -20,7 +22,7 @@ namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibr public class GetArtistAlbumsEndpointTests : IClassFixture { private readonly LuminaWebFactory _apiFactory; - private readonly PaginatedMusicAlbumLiteDtoFixture _paginatedMusicAlbumLiteDtoFixture = new(); + private readonly PaginatedDtoFixture _paginatedMusicAlbumLiteDtoFixture = new(); /// /// Initializes a new instance of the class. diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs index 358b78c1..784d5091 100644 --- a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs @@ -1,6 +1,8 @@ #region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtists; using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; using Lumina.Presentation.Web.SecurityTests.Common.Setup; using System; @@ -20,7 +22,7 @@ namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibr public class GetMusicArtistsEndpointTests : IClassFixture { private readonly LuminaWebFactory _apiFactory; - private readonly PaginatedMusicArtistLiteDtoFixture _paginatedMusicArtistLiteDtoFixture = new(); + private readonly PaginatedDtoFixture _paginatedMusicArtistLiteDtoFixture = new(); /// /// Initializes a new instance of the class. diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs index 9949914d..3027c74d 100644 --- a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs @@ -1,6 +1,8 @@ #region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetAlbumTracks; using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; using Lumina.Presentation.Web.SecurityTests.Common.Setup; using System; @@ -20,7 +22,7 @@ namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibr public class GetAlbumTracksEndpointTests : IClassFixture { private readonly LuminaWebFactory _apiFactory; - private readonly PaginatedMusicTrackLiteDtoFixture _paginatedMusicTrackLiteDtoFixture = new(); + private readonly PaginatedDtoFixture _paginatedMusicTrackLiteDtoFixture = new(); /// /// Initializes a new instance of the class. diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointTests.cs index d85a983c..e866a815 100644 --- a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointTests.cs +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointTests.cs @@ -1,5 +1,7 @@ #region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.Libraries; using Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.GetLibraryItems; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; using Lumina.Presentation.Web.Fixtures.Common.DTO.Libraries; using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; using Lumina.Presentation.Web.SecurityTests.Common.Setup; @@ -17,7 +19,7 @@ namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.WrittenCo public class GetLibraryItemsEndpointTests : IClassFixture { private readonly LuminaWebFactory _apiFactory; - private readonly PaginatedBookLiteDtoFixture _paginatedBookLiteDtoFixture = new(); + private readonly PaginatedDtoFixture _paginatedBookLiteDtoFixture = new(); /// /// Initializes a new instance of the class. diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs index 6fe7bda2..4d689c67 100644 --- a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs @@ -2,10 +2,12 @@ using FastEndpoints; using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; using Lumina.Presentation.Web.Common.Routes; using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetArtistAlbums; using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; using Microsoft.AspNetCore.Http; @@ -28,7 +30,7 @@ public class GetArtistAlbumsEndpointTests private readonly IApiHttpClient _mockApiHttpClient; private readonly GetArtistAlbumsEndpoint _sut; private readonly GetArtistAlbumsLiteRequestFixture _getArtistAlbumsLiteRequestFixture = new(); - private readonly PaginatedMusicAlbumLiteDtoFixture _paginatedMusicAlbumLiteDtoFixture = new(); + private readonly PaginatedDtoFixture _paginatedMusicAlbumLiteDtoFixture = new(); private readonly MusicAlbumLiteDtoFixture _musicAlbumLiteDtoFixture = new(); /// @@ -45,14 +47,14 @@ public class GetArtistAlbumsEndpointTests { // Arrange GetArtistAlbumsLiteRequest request = _getArtistAlbumsLiteRequestFixture.Create(currentPage: 2, perPage: 48); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicAlbumLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId))}?currentPage=2&perPage=48"), Arg.Any()); } @@ -62,14 +64,14 @@ public class GetArtistAlbumsEndpointTests { // Arrange GetArtistAlbumsLiteRequest request = _getArtistAlbumsLiteRequestFixture.Create(); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicAlbumLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId))), Arg.Any()); } @@ -79,14 +81,14 @@ public class GetArtistAlbumsEndpointTests { // Arrange GetArtistAlbumsLiteRequest request = _getArtistAlbumsLiteRequestFixture.Create(currentPage: 3); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicAlbumLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId))}?currentPage=3"), Arg.Any()); } @@ -96,14 +98,14 @@ public class GetArtistAlbumsEndpointTests { // Arrange GetArtistAlbumsLiteRequest request = _getArtistAlbumsLiteRequestFixture.Create(perPage: 24); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicAlbumLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId))}?perPage=24"), Arg.Any()); } @@ -113,14 +115,14 @@ public class GetArtistAlbumsEndpointTests { // Arrange GetArtistAlbumsLiteRequest request = _getArtistAlbumsLiteRequestFixture.Create(artistId: "not-a-guid", currentPage: 1, perPage: 20); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicAlbumLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Empty)}?currentPage=1&perPage=20"), Arg.Any()); } @@ -130,13 +132,13 @@ public class GetArtistAlbumsEndpointTests { // Arrange GetArtistAlbumsLiteRequest request = _getArtistAlbumsLiteRequestFixture.Create(); - PaginatedMusicAlbumLiteDto expectedResponse = _paginatedMusicAlbumLiteDtoFixture.Create( + PaginatedDto expectedResponse = _paginatedMusicAlbumLiteDtoFixture.Create( data: [_musicAlbumLiteDtoFixture.Create(title: "Test Album")], currentPage: 1, perPage: 20, count: 1, numberOfPages: 1); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(expectedResponse); // Act diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs index ec4f32dc..76a546e3 100644 --- a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs @@ -2,11 +2,13 @@ using FastEndpoints; using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.Enums.Common; using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; using Lumina.Presentation.Web.Common.Routes; using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtists; using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; using Microsoft.AspNetCore.Http; @@ -29,7 +31,7 @@ public class GetMusicArtistsEndpointTests private readonly IApiHttpClient _mockApiHttpClient; private readonly GetMusicArtistsEndpoint _sut; private readonly GetMusicArtistsLiteRequestFixture _getMusicArtistsLiteRequestFixture = new(); - private readonly PaginatedMusicArtistLiteDtoFixture _paginatedMusicArtistLiteDtoFixture = new(); + private readonly PaginatedDtoFixture _paginatedMusicArtistLiteDtoFixture = new(); private readonly MusicArtistLiteDtoFixture _musicArtistLiteDtoFixture = new(); /// @@ -58,7 +60,7 @@ public class GetMusicArtistsEndpointTests shouldIgnoreThePrefixForAlphaPicker: true, sortBy: SORT_BY, sortOrder: SortOrder.Descending); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicArtistLiteDtoFixture.Create()); string expectedEndpoint = $"{BuildExpectedEndpoint(libraryId)}?currentPage=2&perPage=48" + $"&searchTerm={Uri.EscapeDataString(SEARCH_TERM)}" + @@ -71,7 +73,7 @@ public class GetMusicArtistsEndpointTests await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == expectedEndpoint), Arg.Any()); } @@ -89,7 +91,7 @@ public class GetMusicArtistsEndpointTests includeFilterAlphaKey: false, includeSortBy: false, includeSortOrder: false); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicArtistLiteDtoFixture.Create()); string expectedEndpoint = $"{BuildExpectedEndpoint(libraryId)}?shouldIgnoreThePrefixForAlphaPicker=False"; @@ -97,7 +99,7 @@ public class GetMusicArtistsEndpointTests await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == expectedEndpoint), Arg.Any()); } @@ -116,7 +118,7 @@ public class GetMusicArtistsEndpointTests includeFilterAlphaKey: false, includeSortBy: false, includeSortOrder: false); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicArtistLiteDtoFixture.Create()); string expectedEndpoint = $"{BuildExpectedEndpoint(libraryId)}?searchTerm={Uri.EscapeDataString(SEARCH_TERM)}&shouldIgnoreThePrefixForAlphaPicker=False"; @@ -124,7 +126,7 @@ public class GetMusicArtistsEndpointTests await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == expectedEndpoint), Arg.Any()); } @@ -142,7 +144,7 @@ public class GetMusicArtistsEndpointTests includeCurrentPage: false, includePerPage: false, includeSortOrder: false); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicArtistLiteDtoFixture.Create()); string expectedEndpoint = $"{BuildExpectedEndpoint(libraryId)}?shouldIgnoreThePrefixForAlphaPicker=False"; @@ -150,7 +152,7 @@ public class GetMusicArtistsEndpointTests await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == expectedEndpoint), Arg.Any()); } @@ -168,7 +170,7 @@ public class GetMusicArtistsEndpointTests includeFilterAlphaKey: false, includeSortBy: false, includeSortOrder: false); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicArtistLiteDtoFixture.Create()); string expectedEndpoint = $"{BuildExpectedEndpoint(libraryId)}?currentPage=3&shouldIgnoreThePrefixForAlphaPicker=False"; @@ -176,7 +178,7 @@ public class GetMusicArtistsEndpointTests await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == expectedEndpoint), Arg.Any()); } @@ -186,13 +188,13 @@ public class GetMusicArtistsEndpointTests { // Arrange GetMusicArtistsLiteRequest request = _getMusicArtistsLiteRequestFixture.Create(); - PaginatedMusicArtistLiteDto expectedResponse = _paginatedMusicArtistLiteDtoFixture.Create( + PaginatedDto expectedResponse = _paginatedMusicArtistLiteDtoFixture.Create( data: [_musicArtistLiteDtoFixture.Create(name: "Test Artist")], currentPage: 1, perPage: 20, count: 1, numberOfPages: 1); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(expectedResponse); // Act diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs index ed6020ad..e2ac0d7b 100644 --- a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs @@ -2,10 +2,12 @@ using FastEndpoints; using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; using Lumina.Presentation.Web.Common.Routes; using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetAlbumTracks; using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; using Microsoft.AspNetCore.Http; @@ -28,7 +30,7 @@ public class GetAlbumTracksEndpointTests private readonly IApiHttpClient _mockApiHttpClient; private readonly GetAlbumTracksEndpoint _sut; private readonly GetAlbumTracksLiteRequestFixture _getAlbumTracksLiteRequestFixture = new(); - private readonly PaginatedMusicTrackLiteDtoFixture _paginatedMusicTrackLiteDtoFixture = new(); + private readonly PaginatedDtoFixture _paginatedMusicTrackLiteDtoFixture = new(); private readonly MusicTrackLiteDtoFixture _musicTrackLiteDtoFixture = new(); /// @@ -45,14 +47,14 @@ public class GetAlbumTracksEndpointTests { // Arrange GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(currentPage: 2, perPage: 48); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId), Guid.Parse(request.AlbumId))}?currentPage=2&perPage=48"), Arg.Any()); } @@ -62,14 +64,14 @@ public class GetAlbumTracksEndpointTests { // Arrange GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId), Guid.Parse(request.AlbumId))), Arg.Any()); } @@ -79,14 +81,14 @@ public class GetAlbumTracksEndpointTests { // Arrange GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(currentPage: 3); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId), Guid.Parse(request.AlbumId))}?currentPage=3"), Arg.Any()); } @@ -96,14 +98,14 @@ public class GetAlbumTracksEndpointTests { // Arrange GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(perPage: 24); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId), Guid.Parse(request.AlbumId))}?perPage=24"), Arg.Any()); } @@ -113,14 +115,14 @@ public class GetAlbumTracksEndpointTests { // Arrange GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(artistId: "not-a-guid", currentPage: 1, perPage: 20); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Empty, Guid.Parse(request.AlbumId))}?currentPage=1&perPage=20"), Arg.Any()); } @@ -130,14 +132,14 @@ public class GetAlbumTracksEndpointTests { // Arrange GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(albumId: "' OR '1'='1", currentPage: 1, perPage: 20); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId), Guid.Empty)}?currentPage=1&perPage=20"), Arg.Any()); } @@ -147,14 +149,14 @@ public class GetAlbumTracksEndpointTests { // Arrange GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(artistId: string.Empty, albumId: string.Empty, currentPage: 1, perPage: 20); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Empty, Guid.Empty)}?currentPage=1&perPage=20"), Arg.Any()); } @@ -164,13 +166,13 @@ public class GetAlbumTracksEndpointTests { // Arrange GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(); - PaginatedMusicTrackLiteDto expectedResponse = _paginatedMusicTrackLiteDtoFixture.Create( + PaginatedDto expectedResponse = _paginatedMusicTrackLiteDtoFixture.Create( data: [_musicTrackLiteDtoFixture.Create(title: "Test Track")], currentPage: 1, perPage: 20, count: 1, numberOfPages: 1); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(expectedResponse); // Act diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointTests.cs index 07f2c8e1..b3b1c65d 100644 --- a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointTests.cs +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetLibraryItems/GetLibraryItemsEndpointTests.cs @@ -1,11 +1,13 @@ #region ========================================================================= USING ===================================================================================== using FastEndpoints; using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.Common; using Lumina.Presentation.Web.Common.DTO.Libraries; using Lumina.Presentation.Web.Common.Enums.Common; using Lumina.Presentation.Web.Common.Requests.Libraries; using Lumina.Presentation.Web.Common.Routes; using Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.GetLibraryItems; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; using Lumina.Presentation.Web.Fixtures.Common.DTO.Libraries; using Lumina.Presentation.Web.Fixtures.Common.Requests.Libraries; using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; @@ -30,7 +32,7 @@ public class GetLibraryItemsEndpointTests private readonly IApiHttpClient _mockApiHttpClient; private readonly GetLibraryItemsEndpoint _sut; private readonly GetBooksLiteRequestFixture _getBooksLiteRequestFixture = new(); - private readonly PaginatedBookLiteDtoFixture _paginatedBookLiteDtoFixture = new(); + private readonly PaginatedDtoFixture _paginatedBookLiteDtoFixture = new(); private readonly BookLiteDtoFixture _bookLiteDtoFixture = new(); /// @@ -54,14 +56,14 @@ public class GetLibraryItemsEndpointTests shouldIgnoreThePrefixForAlphaPicker: true, sortBy: "title", sortOrder: SortOrder.Ascending); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedBookLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint.StartsWith(ApiRoutes.Books.GET_BOOKS_LITE.Replace("{libraryId}", request.LibraryId.ToString()), StringComparison.OrdinalIgnoreCase) && endpoint.Contains("currentPage=2") && @@ -79,14 +81,14 @@ public class GetLibraryItemsEndpointTests { // Arrange GetBooksLiteRequest request = _getBooksLiteRequestFixture.Create(); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(_paginatedBookLiteDtoFixture.Create()); // Act await _sut.ExecuteAsync(request, CancellationToken.None); // Assert - await _mockApiHttpClient.Received(1).GetAsync( + await _mockApiHttpClient.Received(1).GetAsync>( Arg.Is(endpoint => endpoint.StartsWith(ApiRoutes.Books.GET_BOOKS_LITE.Replace("{libraryId}", request.LibraryId.ToString()), StringComparison.OrdinalIgnoreCase) && endpoint.EndsWith("?shouldIgnoreThePrefixForAlphaPicker=False", StringComparison.OrdinalIgnoreCase) && @@ -101,13 +103,13 @@ public class GetLibraryItemsEndpointTests { // Arrange GetBooksLiteRequest request = _getBooksLiteRequestFixture.Create(); - PaginatedBookLiteDto expectedResponse = _paginatedBookLiteDtoFixture.Create( + PaginatedDto expectedResponse = _paginatedBookLiteDtoFixture.Create( data: [_bookLiteDtoFixture.Create(title: "Test Book")], currentPage: 1, perPage: 48, count: 1, numberOfPages: 1); - _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + _mockApiHttpClient.GetAsync>(Arg.Any(), Arg.Any()) .Returns(expectedResponse); // Act