diff --git a/README.md b/README.md index c7d8a563..46c79f7a 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ Several icons used in this project were adapted from icons sourced from [svgrepo - [`error.svg`](https://www.svgrepo.com/svg/486408/error-filled) (MIT License) - [`trigger.svg`](https://www.svgrepo.com/svg/489497/lightning-1) (Public Domain License) - [`stop.svg`](https://www.svgrepo.com/svg/521862/stop) (CC Attribution License) +- [`music-placeholder.svg`](https://www.svgrepo.com/svg/446269/music) (CC Attribution License) **I greatly appreciate the creators and contributors for providing these assets.** diff --git a/docs/manual/using-lumina/index.md b/docs/manual/using-lumina/index.md index 60a693a3..62a45c37 100644 --- a/docs/manual/using-lumina/index.md +++ b/docs/manual/using-lumina/index.md @@ -62,13 +62,20 @@ A book opens only through an enabled reader for its format. The EPUB and PDF rea ## Browsing your music -Opening a music library shows a page with the library title, a search box, an item count, a grid of artist cards, and pagination. Search filters the artists by name. Each artist is a card; selecting it opens the artist's page, and the card's actions menu offers **View details** and **Delete**. +Opening a music library shows a page with the library title, a search box, a sort toggle, a count of items, a grid of artist cards, an alphabetical picker down the side, and pagination at the bottom. -The artist page is also where you edit the artist. It holds the artist's general information, areas, aliases, contributors and ratings, and it lists the artist's albums as cards, each leading to its own album page. The album page holds the album's information and its tracks, and the track page holds the track's details. Deleting an artist, album or track removes it from Lumina's catalogue; your files are not touched. +- **Search** filters the artists by name; press Enter or use the search button. +- **Sort** toggles between ascending and descending order. +- **The alpha picker** jumps to names starting with a chosen character. It offers All, then the number and symbol keys, then A to Z. You can also press a letter key to filter, and press Escape to clear the filter. +- **Pagination** splits the list into pages when you have it enabled, with previous and next buttons and a page indicator. When it is off, the whole list is shown and the count is the total. + +Each artist is a card; selecting it opens the artist's page, and the card's actions menu offers **View details** and **Delete**. + +The artist page is also where you edit the artist. It lists the artist's albums as cards, each leading to its own album page, followed by the artist's general information, contributors, ratings, genres, tags, aliases, areas and identifiers. The album page holds the album's information and its tracks, and the track page holds the track's details. The album page also shows the artwork Lumina stored for the album as a strip of thumbnails beside the main image, and selecting a thumbnail displays that image in place of the cover. Deleting an artist, album or track removes it from Lumina's catalogue; your files are not touched. ## 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 groups its fields into general information, areas, aliases, contributors and ratings. Album and track pages follow the same shape for their own fields. Saving sends the changes back to the server, and a confirmation or an error is shown in the corner of the screen. +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. diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/AudioRatingDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/AudioRatingDto.cs new file mode 100644 index 00000000..eab82d05 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/AudioRatingDto.cs @@ -0,0 +1,19 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary; + +/// +/// Data transfer object for the rating of an audio media element. +/// +[DebuggerDisplay("Value: {Value}, MaxValue: {MaxValue}")] +public class AudioRatingDto : RatingDto +{ + /// + /// Gets or sets the source of the audio rating (e.g., a specific website or platform). + /// + public AudioRatingSource? Source { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/IsrcDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/IsrcDto.cs new file mode 100644 index 00000000..feb21604 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/IsrcDto.cs @@ -0,0 +1,17 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object for an ISRC (International Standard Recording Code) of a track. +/// +[DebuggerDisplay("Value: {Value}")] +public class IsrcDto +{ + /// + /// Gets or sets the value of the ISRC. + /// + public string? Value { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumDto.cs new file mode 100644 index 00000000..00e59bb0 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumDto.cs @@ -0,0 +1,118 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object carrying the full details of an album, as stored in the media library. +/// +[DebuggerDisplay("Title: {Metadata?.Title}")] +public class MusicAlbumDto +{ + /// + /// Gets or sets the Id of the album. + /// + public Guid Id { get; set; } + + /// + /// Gets or sets the Id of the artist the album belongs to. + /// + public Guid ArtistId { get; set; } + + /// + /// Gets or sets the Id of the media library this album belongs to. + /// + public Guid LibraryId { get; set; } + + /// + /// Gets or sets the path of the image representing the album, if available. + /// + public string? CoverPath { get; set; } + + /// + /// Gets or sets the stored artwork of the album, in display order, so that all of its pieces can be presented, not just the cover. + /// + public List? Artwork { get; set; } + + /// + /// Gets or sets the album metadata of the album. + /// + public MusicAlbumMetadataDto? Metadata { get; set; } + + /// + /// Gets or sets the physical or digital medium of the album, if applicable. + /// + public MusicMediaFormat? MediaFormat { get; set; } + + /// + /// Gets or sets the outermost physical packaging of the album, if applicable. + /// + public MusicReleasePackaging? Packaging { get; set; } + + /// + /// Gets or sets the barcode of the album, if applicable. + /// + public string? Barcode { get; set; } + + /// + /// Gets or sets the catalog numbers of the album, if applicable. + /// + public List? CatalogNumbers { get; set; } + + /// + /// Gets or sets the name of the label that issued the album, if applicable. + /// + public string? Label { get; set; } + + /// + /// Gets or sets the ASIN (Amazon Standard Identification Number) of the album, if applicable. + /// + public string? ASIN { get; set; } + + /// + /// Gets or sets the MusicBrainz identifier of the release, if applicable. + /// + public Guid? MusicBrainzReleaseId { get; set; } + + /// + /// Gets or sets the MusicBrainz identifier of the release group, if applicable. + /// + public Guid? MusicBrainzReleaseGroupId { get; set; } + + /// + /// Gets or sets the MusicBrainz identifier of the release artist, if applicable. + /// + public Guid? MusicBrainzReleaseArtistId { get; set; } + + /// + /// Gets or sets the date and time when the album was created. + /// + public DateTime CreatedOnUtc { get; set; } + + /// + /// Gets or sets the optional date and time when the album was updated. + /// + public DateTime? UpdatedOnUtc { get; set; } + + /// + /// Gets or sets the list of references to the media contributors that performed on the album, each with the role they played. + /// + public List? Contributors { get; set; } + + /// + /// Gets or sets the list of ratings for this album. + /// + public List? Ratings { get; set; } + + /// + /// Gets or sets the list of tracks of the album. + /// + public List? Tracks { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumLiteDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumLiteDto.cs new file mode 100644 index 00000000..2d9ec6a4 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumLiteDto.cs @@ -0,0 +1,45 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object for a lightweight album element, containing only the properties needed by the client for card-style navigation. +/// +[DebuggerDisplay("Title: {Title}")] +public class MusicAlbumLiteDto +{ + /// + /// Gets or sets the Id of the album. + /// + public Guid Id { get; set; } + + /// + /// Gets or sets the title of the album. + /// + public string Title { get; set; } = string.Empty; + + /// + /// Gets or sets the number of tracks of the release. + /// + public int TotalTracks { get; set; } + + /// + /// Gets or sets the path of the image representing the album, if available. + /// + public string? CoverPath { get; set; } + + /// + /// Gets or sets the release year of the album (the re-release year, if available, or the original release year), if known. + /// + public int? ReleaseYear { get; set; } + + /// + /// Gets or sets the set of types of the release. + /// + public List? ReleaseTypes { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumMetadataDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumMetadataDto.cs new file mode 100644 index 00000000..216f9370 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumMetadataDto.cs @@ -0,0 +1,90 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object for the metadata of an album. +/// +[DebuggerDisplay("Title: {Title}")] +public class MusicAlbumMetadataDto +{ + /// + /// Gets or sets the title of the album. + /// + public string? Title { get; set; } + + /// + /// Gets or sets the original title of the album, if different from the current title. + /// + public string? OriginalTitle { get; set; } + + /// + /// Gets or sets a brief description or summary of the album. + /// + public string? Description { get; set; } + + /// + /// Gets or sets the disambiguation comment of the album, used to distinguish albums with the same title. + /// + public string? Disambiguation { get; set; } + + /// + /// Gets or sets the release information, including release date and other relevant details. + /// + public ReleaseInfoDto? ReleaseInfo { get; set; } + + /// + /// Gets or sets the language of the album. + /// + public LanguageInfoDto? Language { get; set; } + + /// + /// Gets or sets the original language of the album, if it has been translated. + /// + public LanguageInfoDto? OriginalLanguage { get; set; } + + /// + /// Gets or sets the list of tags that further describe or categorize the album. + /// + public List? Tags { get; set; } + + /// + /// Gets or sets the list of genres associated with the album. + /// + public List? Genres { get; set; } + + /// + /// Gets or sets the script used by the language of the release of the album. + /// + public string? Script { get; set; } + + /// + /// Gets or sets the set of types of the release. + /// + public List? ReleaseTypes { get; set; } + + /// + /// Gets or sets the status of the release. + /// + public MusicReleaseStatus? ReleaseStatus { get; set; } + + /// + /// Gets or sets the number of discs of the release. + /// + public int? TotalDiscs { get; set; } + + /// + /// Gets or sets the number of tracks of the release. + /// + public int? TotalTracks { get; set; } + + /// + /// Gets or sets the title of the specific release (edition) the album files match, if different from the release group title. + /// + public string? ReleaseTitle { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAreaDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAreaDto.cs new file mode 100644 index 00000000..2db0c345 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicAreaDto.cs @@ -0,0 +1,43 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object for a MusicBrainz area, the geographic area a music artist is associated with. +/// +[DebuggerDisplay("Name: {Name}")] +public class MusicAreaDto +{ + /// + /// Gets or sets the MusicBrainz identifier of the area. + /// + public Guid? MusicBrainzAreaId { get; set; } + + /// + /// Gets or sets the name of the area. + /// + public string? Name { get; set; } + + /// + /// Gets or sets the sort name of the area, if applicable. + /// + public string? SortName { get; set; } + + /// + /// Gets or sets the disambiguation comment of the area, if applicable. + /// + public string? Disambiguation { get; set; } + + /// + /// Gets or sets the MusicBrainz type of the area, if applicable. + /// + public string? Type { get; set; } + + /// + /// Gets or sets the ISO 3166 code of the area, if applicable. + /// + public string? Iso3166Code { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistAliasDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistAliasDto.cs new file mode 100644 index 00000000..05ae5a43 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistAliasDto.cs @@ -0,0 +1,53 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object for an alternative name of a music artist. +/// +[DebuggerDisplay("Name: {Name}")] +public class MusicArtistAliasDto +{ + /// + /// Gets or sets the name of the alias. + /// + public string? Name { get; set; } + + /// + /// Gets or sets the sort name of the alias, if applicable. + /// + public string? SortName { get; set; } + + /// + /// Gets or sets the type of the alias, if applicable. + /// + public string? Type { get; set; } + + /// + /// Gets or sets the locale the alias is used in, if applicable. + /// + public string? Locale { get; set; } + + /// + /// Gets or sets whether this is the primary alias of the artist. + /// + public bool IsPrimary { get; set; } + + /// + /// Gets or sets the date the alias began being used, if applicable. + /// + public DateOnly? BeginDate { get; set; } + + /// + /// Gets or sets the date the alias stopped being used, if applicable. + /// + public DateOnly? EndDate { get; set; } + + /// + /// Gets or sets whether the alias is no longer used. + /// + public bool IsEnded { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistDto.cs new file mode 100644 index 00000000..edb8a763 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistDto.cs @@ -0,0 +1,81 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object carrying the full details of a music artist, as stored in the media library. +/// +[DebuggerDisplay("Name: {Metadata?.Name}")] +public class MusicArtistDto +{ + /// + /// Gets or sets the Id of the artist. + /// + public Guid Id { get; set; } + + /// + /// Gets or sets the Id of the media library this artist belongs to. + /// + public Guid LibraryId { get; set; } + + /// + /// Gets or sets the path of the image representing the artist, if available. + /// + public string? CoverPath { get; set; } + + /// + /// Gets or sets the metadata of the artist. + /// + public MusicArtistMetadataDto? Metadata { get; set; } + + /// + /// Gets or sets the website of the artist, if applicable. + /// + public string? Website { get; set; } + + /// + /// Gets or sets the MusicBrainz identifier of the artist, if applicable. + /// + public Guid? MusicBrainzArtistId { get; set; } + + /// + /// Gets or sets the list of IPI (Interested Party Information) codes of the artist. + /// + public List? Ipis { get; set; } + + /// + /// Gets or sets the list of ISNI (International Standard Name Identifier) codes of the artist. + /// + public List? Isnis { get; set; } + + /// + /// Gets or sets the date and time when the artist was created. + /// + public DateTime CreatedOnUtc { get; set; } + + /// + /// Gets or sets the optional date and time when the artist was updated. + /// + public DateTime? UpdatedOnUtc { get; set; } + + /// + /// Gets or sets the list of references to the media contributors that make up the artist, each with the role they played. + /// + public List? Contributors { get; set; } + + /// + /// Gets or sets the list of ratings for this artist. + /// + public List? Ratings { get; set; } + + /// + /// Gets or sets the list of albums of the artist, each with its own list of tracks. + /// + public List? Albums { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistLiteDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistLiteDto.cs new file mode 100644 index 00000000..06e69234 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistLiteDto.cs @@ -0,0 +1,28 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object for a lightweight music artist element, containing only the properties needed by the client for card-style navigation. +/// +[DebuggerDisplay("Name: {Name}")] +public class MusicArtistLiteDto +{ + /// + /// Gets or sets the Id of the artist. + /// + public Guid Id { get; set; } + + /// + /// Gets or sets the name of the artist. + /// + public string Name { get; set; } = string.Empty; + + /// + /// Gets or sets the path of the image representing the artist, if available. + /// + public string? CoverPath { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistMetadataDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistMetadataDto.cs new file mode 100644 index 00000000..556f84d6 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistMetadataDto.cs @@ -0,0 +1,91 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object for the metadata of a music artist. +/// +[DebuggerDisplay("Name: {Name}")] +public class MusicArtistMetadataDto +{ + /// + /// Gets or sets the name of the artist. + /// + public string? Name { get; set; } + + /// + /// Gets or sets the sort name of the artist, a variant of the name used when sorting artists, if applicable. + /// + public string? SortName { get; set; } + + /// + /// Gets or sets the disambiguation comment of the artist, used to distinguish artists with the same name, if applicable. + /// + public string? Disambiguation { get; set; } + + /// + /// Gets or sets the type of the artist, if applicable. + /// + public MusicArtistType? Type { get; set; } + + /// + /// Gets or sets the gender of the artist, applicable only to artists that are persons or characters, if applicable. + /// + public MusicArtistGender? Gender { get; set; } + + /// + /// Gets or sets the ISO 3166-1 alpha-2 code of the country the artist is associated with, if applicable. + /// + public string? Country { get; set; } + + /// + /// Gets or sets the area the artist is primarily identified with, if applicable. + /// + public MusicAreaDto? Area { get; set; } + + /// + /// Gets or sets the area the artist began in, if applicable. + /// + public MusicAreaDto? BeginArea { get; set; } + + /// + /// Gets or sets the area the artist ended in, if applicable. + /// + public MusicAreaDto? EndArea { get; set; } + + /// + /// Gets or sets the date the artist started existing, if applicable. + /// + public DateOnly? LifeSpanBegin { get; set; } + + /// + /// Gets or sets the date the artist stopped existing, if applicable. + /// + public DateOnly? LifeSpanEnd { get; set; } + + /// + /// Gets or sets whether the artist no longer exists. + /// + public bool IsEnded { get; set; } + + /// + /// Gets or sets the list of genres associated with the artist. + /// + public List? Genres { get; set; } + + /// + /// Gets or sets the list of tags that further describe or categorize the artist. + /// + public List? Tags { get; set; } + + /// + /// Gets or sets the list of alternative names of the artist. + /// + public List? Aliases { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackDto.cs new file mode 100644 index 00000000..d11657b9 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackDto.cs @@ -0,0 +1,113 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object carrying the full details of a track, as stored in the media library. +/// +[DebuggerDisplay("Title: {Metadata?.Title}")] +public class MusicTrackDto +{ + /// + /// Gets or sets the Id of the track. + /// + public Guid Id { get; set; } + + /// + /// Gets or sets the Id of the album the track belongs to. + /// + public Guid AlbumId { get; set; } + + /// + /// Gets or sets the Id of the media library this track belongs to. + /// + public Guid LibraryId { get; set; } + + /// + /// Gets or sets the file system path of the track. + /// + public string Path { get; set; } = string.Empty; + + /// + /// Gets or sets the audio metadata of the track. + /// + public MusicTrackMetadataDto? Metadata { get; set; } + + /// + /// Gets or sets the number of the track on its disc. + /// + public int TrackNumber { get; set; } + + /// + /// Gets or sets the number of the disc the track belongs to, if applicable. + /// + public int? DiscNumber { get; set; } + + /// + /// Gets or sets the script used by the language of the track, if applicable. + /// + public string? Script { get; set; } + + /// + /// Gets or sets the musical key of the track, if applicable. + /// + public MusicKey? Key { get; set; } + + /// + /// Gets or sets the tempo of the track in beats per minute, if applicable. + /// + public int? Bpm { get; set; } + + /// + /// Gets or sets the work the track is a recording of, if applicable. + /// + public MusicWorkDto? Work { get; set; } + + /// + /// Gets or sets the MusicBrainz identifier of the recording, if applicable. + /// + public Guid? MusicBrainzRecordingId { get; set; } + + /// + /// Gets or sets the MusicBrainz identifier of the track, if applicable. + /// + public Guid? MusicBrainzTrackId { get; set; } + + /// + /// Gets or sets the date and time when the track was created. + /// + public DateTime CreatedOnUtc { get; set; } + + /// + /// Gets or sets the optional date and time when the track was updated. + /// + public DateTime? UpdatedOnUtc { get; set; } + + /// + /// Gets or sets the list of moods of the track. + /// + public List? Moods { get; set; } + + /// + /// Gets or sets the list of ISRC (International Standard Recording Code) of the track. + /// + public List? Isrcs { get; set; } + + /// + /// Gets or sets the list of references to the media contributors that performed on the track, each with the role they played. + /// + public List? Contributors { get; set; } + + /// + /// Gets or sets the list of ratings for this track. + /// + public List? Ratings { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackLiteDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackLiteDto.cs new file mode 100644 index 00000000..9e4a95f3 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackLiteDto.cs @@ -0,0 +1,38 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object for a lightweight track element, containing only the properties needed by the client to display the tracks of an album. +/// +[DebuggerDisplay("Title: {Title}")] +public class MusicTrackLiteDto +{ + /// + /// Gets or sets the Id of the track. + /// + public Guid Id { get; set; } + + /// + /// Gets or sets the title of the track. + /// + public string Title { get; set; } = string.Empty; + + /// + /// Gets or sets the number of the track on its disc. + /// + public int TrackNumber { get; set; } + + /// + /// Gets or sets the number of the disc the track belongs to, if applicable. + /// + public int? DiscNumber { get; set; } + + /// + /// Gets or sets the duration of the track in seconds. + /// + public int DurationInSeconds { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackMetadataDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackMetadataDto.cs new file mode 100644 index 00000000..cfd7f619 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackMetadataDto.cs @@ -0,0 +1,119 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.Common; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object for the audio metadata of a track. +/// +[DebuggerDisplay("Title: {Title}")] +public class MusicTrackMetadataDto +{ + /// + /// Gets or sets the title of the track. + /// + public string? Title { get; set; } + + /// + /// Gets or sets the original title of the track, if different from the current title. + /// + public string? OriginalTitle { get; set; } + + /// + /// Gets or sets a brief description or summary of the track. + /// + public string? Description { get; set; } + + /// + /// Gets or sets the disambiguation comment of the track, used to distinguish tracks with the same title. + /// + public string? Disambiguation { get; set; } + + /// + /// Gets or sets the release information, including release date and other relevant details. + /// + public ReleaseInfoDto? ReleaseInfo { get; set; } + + /// + /// Gets or sets the language of the track. + /// + public LanguageInfoDto? Language { get; set; } + + /// + /// Gets or sets the original language of the track, if it has been translated. + /// + public LanguageInfoDto? OriginalLanguage { get; set; } + + /// + /// Gets or sets the list of tags that further describe or categorize the track. + /// + public List? Tags { get; set; } + + /// + /// Gets or sets the list of genres associated with the track. + /// + public List? Genres { get; set; } + + /// + /// Gets or sets whether the recording of the track is a video recording. + /// + public bool IsVideo { get; set; } + + /// + /// Gets or sets the duration of the audio of the track in seconds. + /// + public int? DurationInSeconds { get; set; } + + /// + /// Gets or sets the sample rate of the audio of the track in Hz. + /// + public int? SampleRate { get; set; } + + /// + /// Gets or sets the number of audio channels of the track. + /// + public int? Channels { get; set; } + + /// + /// Gets or sets the bit depth of the audio of the track. + /// + public int? BitDepth { get; set; } + + /// + /// Gets or sets the audio codec used by the track. + /// + public string? AudioCodec { get; set; } + + /// + /// Gets or sets the bitrate of the audio of the track in kbps. + /// + public int? Bitrate { get; set; } + + /// + /// Gets or sets the AcoustID fingerprint identifier of the audio file of the track. + /// + public string? AcoustId { get; set; } + + /// + /// Gets or sets the ReplayGain track gain of the track in decibels. + /// + public decimal? ReplayGainTrackGain { get; set; } + + /// + /// Gets or sets the ReplayGain track peak of the track. + /// + public decimal? ReplayGainTrackPeak { get; set; } + + /// + /// Gets or sets the ReplayGain album gain of the track in decibels. + /// + public decimal? ReplayGainAlbumGain { get; set; } + + /// + /// Gets or sets the ReplayGain album peak of the track. + /// + public decimal? ReplayGainAlbumPeak { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicWorkDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicWorkDto.cs new file mode 100644 index 00000000..deec7c85 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/MusicWorkDto.cs @@ -0,0 +1,40 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.Common; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object for a MusicBrainz work, the musical composition a track is a recording of. +/// +[DebuggerDisplay("Title: {Title}")] +public class MusicWorkDto +{ + /// + /// Gets or sets the MusicBrainz identifier of the work. + /// + public Guid? MusicBrainzWorkId { get; set; } + + /// + /// Gets or sets the title of the work. + /// + public string? Title { get; set; } + + /// + /// Gets or sets the MusicBrainz type of the work, if applicable. + /// + public string? Type { get; set; } + + /// + /// Gets or sets the list of languages of the work. + /// + public List? Languages { get; set; } + + /// + /// Gets or sets the list of ISWC (International Standard Musical Work Code) of the work. + /// + public List? Iswcs { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDto.cs new file mode 100644 index 00000000..19cfaa36 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDto.cs @@ -0,0 +1,38 @@ +#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 new file mode 100644 index 00000000..780e6638 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicArtistLiteDto.cs @@ -0,0 +1,38 @@ +#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 new file mode 100644 index 00000000..6c112daa --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicTrackLiteDto.cs @@ -0,0 +1,38 @@ +#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/AudioLibrary/MusicLibrary/UpdateMusicCoverDto.cs b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/UpdateMusicCoverDto.cs new file mode 100644 index 00000000..2c47c06a --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/AudioLibrary/MusicLibrary/UpdateMusicCoverDto.cs @@ -0,0 +1,17 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; + +/// +/// Data transfer object for the response of an update music cover operation. +/// +[DebuggerDisplay("CoverPath: {CoverPath}")] +public class UpdateMusicCoverDto +{ + /// + /// Gets or sets the relative path of the stored cover image. + /// + public string? CoverPath { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/Common/MediaArtworkDto.cs b/src/Lumina.Presentation.Web/Common/DTO/Common/MediaArtworkDto.cs new file mode 100644 index 00000000..6bb1ced8 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/Common/MediaArtworkDto.cs @@ -0,0 +1,28 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Enums.MediaLibrary; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.Common; + +/// +/// Data transfer object for a stored piece of artwork of a media item. +/// +[DebuggerDisplay("Type: {Type}, Ordinal: {Ordinal}, Path: {Path}")] +public class MediaArtworkDto +{ + /// + /// Gets or sets the type of the artwork, like the cover or the back of the media item. + /// + public ArtworkType Type { get; set; } + + /// + /// Gets or sets the ordinal of the artwork within its type, so that multiple artworks of the same type can be ordered. + /// + public int Ordinal { get; set; } + + /// + /// Gets or sets the relative path of the stored artwork file. + /// + public string Path { get; set; } = string.Empty; +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/Common/MoodDto.cs b/src/Lumina.Presentation.Web/Common/DTO/Common/MoodDto.cs new file mode 100644 index 00000000..97bcce0b --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/Common/MoodDto.cs @@ -0,0 +1,17 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.Common; + +/// +/// Data transfer object for a mood of a media element. +/// +[DebuggerDisplay("Name: {Name}")] +public class MoodDto +{ + /// + /// Gets or sets the name of the mood. + /// + public string? Name { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/DTO/MediaContributors/MediaContributorReferenceDto.cs b/src/Lumina.Presentation.Web/Common/DTO/MediaContributors/MediaContributorReferenceDto.cs new file mode 100644 index 00000000..94f117ff --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/DTO/MediaContributors/MediaContributorReferenceDto.cs @@ -0,0 +1,24 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Enums.MediaContributors; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.DTO.MediaContributors; + +/// +/// Data transfer object for the reference to a media contributor in a media item, carrying the role the contributor played. +/// +[DebuggerDisplay("{ContributorId} - {Role}")] +public class MediaContributorReferenceDto +{ + /// + /// Gets or sets the unique identifier of the media contributor. + /// + public Guid ContributorId { get; set; } + + /// + /// Gets or sets the role the contributor played. + /// + public MediaContributorRole? Role { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicArtistGender.cs b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicArtistGender.cs new file mode 100644 index 00000000..8339bc74 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicArtistGender.cs @@ -0,0 +1,32 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Enums.AudioLibrary; + +/// +/// Enumeration for the gender of a music artist, applicable only to artists that are persons or characters. +/// +[DebuggerDisplay("{ToString()}")] +public enum MusicArtistGender +{ + /// + /// The artist identifies as male. + /// + Male, + + /// + /// The artist identifies as female. + /// + Female, + + /// + /// The artist identifies with a gender other than male or female. + /// + Other, + + /// + /// The gender of the artist is not applicable, or is deliberately not stated. + /// + NotApplicable +} diff --git a/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicArtistType.cs b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicArtistType.cs new file mode 100644 index 00000000..68d21f09 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicArtistType.cs @@ -0,0 +1,42 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Enums.AudioLibrary; + +/// +/// Enumeration for the type of a music artist, describing whether the artist is an individual, an ensemble, or something else. +/// +[DebuggerDisplay("{ToString()}")] +public enum MusicArtistType +{ + /// + /// The artist is an individual person. + /// + Person, + + /// + /// The artist is a group of people that may or may not have a distinctive name. + /// + Group, + + /// + /// The artist is an orchestra, a large instrumental ensemble. + /// + Orchestra, + + /// + /// The artist is a choir or chorus, a large vocal ensemble. + /// + Choir, + + /// + /// The artist is an individual fictional character. + /// + Character, + + /// + /// The type of the artist does not fit into any of the known categories. + /// + Other +} diff --git a/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicKey.cs b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicKey.cs new file mode 100644 index 00000000..14d0fbc4 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicKey.cs @@ -0,0 +1,132 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Enums.AudioLibrary; + +/// +/// Enumeration for the musical key of a track, describing the pitch and the major or minor mode of the key. +/// +[DebuggerDisplay("{ToString()}")] +public enum MusicKey +{ + /// + /// The musical key of C major. + /// + CMajor, + + /// + /// The musical key of C sharp major. + /// + CSharpMajor, + + /// + /// The musical key of D major. + /// + DMajor, + + /// + /// The musical key of D sharp major. + /// + DSharpMajor, + + /// + /// The musical key of E major. + /// + EMajor, + + /// + /// The musical key of F major. + /// + FMajor, + + /// + /// The musical key of F sharp major. + /// + FSharpMajor, + + /// + /// The musical key of G major. + /// + GMajor, + + /// + /// The musical key of G sharp major. + /// + GSharpMajor, + + /// + /// The musical key of A major. + /// + AMajor, + + /// + /// The musical key of A sharp major. + /// + ASharpMajor, + + /// + /// The musical key of B major. + /// + BMajor, + + /// + /// The musical key of C minor. + /// + CMinor, + + /// + /// The musical key of C sharp minor. + /// + CSharpMinor, + + /// + /// The musical key of D minor. + /// + DMinor, + + /// + /// The musical key of D sharp minor. + /// + DSharpMinor, + + /// + /// The musical key of E minor. + /// + EMinor, + + /// + /// The musical key of F minor. + /// + FMinor, + + /// + /// The musical key of F sharp minor. + /// + FSharpMinor, + + /// + /// The musical key of G minor. + /// + GMinor, + + /// + /// The musical key of G sharp minor. + /// + GSharpMinor, + + /// + /// The musical key of A minor. + /// + AMinor, + + /// + /// The musical key of A sharp minor. + /// + ASharpMinor, + + /// + /// The musical key of B minor. + /// + BMinor +} diff --git a/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicMediaFormat.cs b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicMediaFormat.cs new file mode 100644 index 00000000..6090c575 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicMediaFormat.cs @@ -0,0 +1,577 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Enums.AudioLibrary; + +/// +/// Enumeration for the physical or digital medium of a music release. +/// +[DebuggerDisplay("{ToString()}")] +public enum MusicMediaFormat +{ + /// + /// The release was distributed on a 10 inch acetate disc. + /// + Inch10Acetate, + + /// + /// The release was distributed on a 10 inch shellac disc. + /// + Inch10Shellac, + + /// + /// The release was distributed on a 10 inch vinyl record. + /// + Inch10Vinyl, + + /// + /// The release was distributed on a 12 inch acetate disc. + /// + Inch12Acetate, + + /// + /// The release was distributed on a 12 inch LaserDisc. + /// + Inch12LaserDisc, + + /// + /// The release was distributed on a 12 inch shellac disc. + /// + Inch12Shellac, + + /// + /// The release was distributed on a 12 inch vinyl record. + /// + Inch12Vinyl, + + /// + /// The release was distributed on a 3 inch vinyl record. + /// + Inch3Vinyl, + + /// + /// The release was distributed on a 3.5 inch floppy disk. + /// + Inch3_5FloppyDisk, + + /// + /// The release was distributed on a 5.25 inch floppy disk. + /// + Inch5_25FloppyDisk, + + /// + /// The release was distributed on a 7 inch acetate disc. + /// + Inch7Acetate, + + /// + /// The release was distributed on a 7 inch flexi disc. + /// + Inch7FlexiDisc, + + /// + /// The release was distributed on a 7 inch shellac disc. + /// + Inch7Shellac, + + /// + /// The release was distributed on a 7 inch vinyl record. + /// + Inch7Vinyl, + + /// + /// The release was distributed on an 8 inch LaserDisc. + /// + Inch8LaserDisc, + + /// + /// The release was distributed on an 8-track cartridge. + /// + EightTrackCartridge, + + /// + /// The release was distributed on an 8 cm compact disc. + /// + Cm8CD, + + /// + /// The release was distributed on an 8 cm compact disc with graphics. + /// + Cm8CDPlusG, + + /// + /// The release was distributed on an 8 cm recordable compact disc. + /// + Cm8CDMinusR, + + /// + /// The release was distributed on an acetate disc. + /// + Acetate, + + /// + /// The release was distributed on a Betacam SP videotape. + /// + BetacamSP, + + /// + /// The release was distributed on a Betamax videocassette. + /// + Betamax, + + /// + /// The release was distributed on a Blu-ray disc. + /// + BluRay, + + /// + /// The release was distributed on a recordable Blu-ray disc. + /// + BluRayMinusR, + + /// + /// The release was distributed on a Blu-spec compact disc. + /// + BluSpecCD, + + /// + /// The release was distributed on a cartridge. + /// + Cartridge, + + /// + /// The release was distributed on a compact cassette. + /// + Cassette, + + /// + /// The release was distributed on a compact disc. + /// + CD, + + /// + /// The release was distributed on a compact disc with graphics. + /// + CDPlusG, + + /// + /// The release was distributed on a CD-i (compact disc interactive). + /// + CDMinusi, + + /// + /// The release was distributed on a recordable compact disc. + /// + CDMinusR, + + /// + /// The release was distributed on a CD Video. + /// + CDV, + + /// + /// The release was distributed on a Capacitance Electronic Disc. + /// + CED, + + /// + /// The release was distributed on a copy-controlled compact disc. + /// + CopyControlCD, + + /// + /// The release was distributed on a Digital Audio Tape. + /// + DAT, + + /// + /// The release was distributed on a compact disc used for data storage. + /// + DataCD, + + /// + /// The release was distributed on a DVD used for data storage. + /// + DataDVD, + + /// + /// The release was distributed on a recordable DVD used for data storage. + /// + DataDVDMinusR, + + /// + /// The release was distributed on a DataPlay disc. + /// + DataPlay, + + /// + /// The release was distributed on a Digital Compact Cassette. + /// + DCC, + + /// + /// The release was distributed as a digital download or stream. + /// + DigitalMedia, + + /// + /// The release was distributed on a download card. + /// + DownloadCard, + + /// + /// The release was distributed on a DTS-compatible compact disc. + /// + DTSCD, + + /// + /// The release was distributed on a DualDisc. + /// + DualDisc, + + /// + /// The release was distributed on the CD side of a DualDisc. + /// + DualDiscCDSide, + + /// + /// The release was distributed on the DVD side of a DualDisc. + /// + DualDiscDVDSide, + + /// + /// The release was distributed on the DVD-audio side of a DualDisc. + /// + DualDiscDVDAudioSide, + + /// + /// The release was distributed on the DVD-video side of a DualDisc. + /// + DualDiscDVDVideoSide, + + /// + /// The release was distributed on a DVD. + /// + DVD, + + /// + /// The release was distributed on a DVD-Audio. + /// + DVDAudio, + + /// + /// The release was distributed on a recordable DVD used for video. + /// + DVDMinusRVideo, + + /// + /// The release was distributed on a DVD-Video. + /// + DVDVideo, + + /// + /// The release was distributed on a DVD+. + /// + DVDPlus, + + /// + /// The release was distributed on the CD side of a DVD+. + /// + DVDPlusCDSide, + + /// + /// The release was distributed on the DVD-audio side of a DVD+. + /// + DVDPlusDVDAudioSide, + + /// + /// The release was distributed on the DVD-video side of a DVD+. + /// + DVDPlusDVDVideoSide, + + /// + /// The release was distributed on an Edison Diamond Disc. + /// + EdisonDiamondDisc, + + /// + /// The release was distributed on an enhanced compact disc. + /// + EnhancedCD, + + /// + /// The release was distributed on a flexi disc. + /// + FlexiDisc, + + /// + /// The release was distributed on a floppy disk. + /// + FloppyDisk, + + /// + /// The release was distributed on an HD DVD. + /// + HDDVD, + + /// + /// The release was distributed on a High Definition Compatible Digital compact disc. + /// + HDCD, + + /// + /// The release was distributed on a HiPac. + /// + HiPac, + + /// + /// The release was distributed on a High Quality compact disc. + /// + HQCD, + + /// + /// The release was distributed on a hybrid Super Audio CD. + /// + HybridSACD, + + /// + /// The release was distributed on the CD layer of a hybrid Super Audio CD. + /// + HybridSACDCDLayer, + + /// + /// The release was distributed on the SACD layer of a hybrid Super Audio CD. + /// + HybridSACDSACDLayer, + + /// + /// The release was distributed on the stereo SACD layer of a hybrid Super Audio CD. + /// + HybridSACDSACDLayer2Channels, + + /// + /// The release was distributed on the multichannel SACD layer of a hybrid Super Audio CD. + /// + HybridSACDSACDLayerMultichannel, + + /// + /// The release was distributed on a KiT album. + /// + KiTAlbum, + + /// + /// The release was distributed on a LaserDisc. + /// + LaserDisc, + + /// + /// The release was distributed on a microcassette. + /// + Microcassette, + + /// + /// The release was distributed on a microSD card. + /// + MicroSD, + + /// + /// The release was distributed on a MiniDisc. + /// + MiniDisc, + + /// + /// The release was distributed on a mini DVD. + /// + MiniDVD, + + /// + /// The release was distributed on a mini DVD-Audio. + /// + MiniDVDAudio, + + /// + /// The release was distributed on a mini DVD-Video. + /// + MiniDVDVideo, + + /// + /// The release was distributed on a MiniMax compact disc. + /// + MinimaxCD, + + /// + /// The release was distributed on a MiniMax DVD. + /// + MinimaxDVD, + + /// + /// The release was distributed on a MiniMax DVD-Audio. + /// + MinimaxDVDAudio, + + /// + /// The release was distributed on a MiniMax DVD-Video. + /// + MinimaxDVDVideo, + + /// + /// The release was distributed on a mixed-mode compact disc. + /// + MixedModeCD, + + /// + /// The medium of the release does not fall into any of the known categories. + /// + Other, + + /// + /// The release was distributed on a Pathe disc. + /// + PatheDisc, + + /// + /// The release was distributed on a phonograph record. + /// + PhonographRecord, + + /// + /// The release was distributed on a piano roll. + /// + PianoRoll, + + /// + /// The release was distributed on a Playbutton. + /// + Playbutton, + + /// + /// The release was distributed on a PlayTape. + /// + PlayTape, + + /// + /// The release was distributed on a reel-to-reel tape. + /// + ReelToReel, + + /// + /// The release was distributed on a read-only memory cartridge. + /// + ROMCartridge, + + /// + /// The release was distributed on a Super Audio CD. + /// + SACD, + + /// + /// The release was distributed on a stereo Super Audio CD. + /// + SACD2Channels, + + /// + /// The release was distributed on a multichannel Super Audio CD. + /// + SACDMultichannel, + + /// + /// The release was distributed on an SD card. + /// + SDCard, + + /// + /// The release was distributed on a shellac disc. + /// + Shellac, + + /// + /// The release was distributed on a Super High Material compact disc. + /// + SHMCD, + + /// + /// The release was distributed on a Super High Material Super Audio CD. + /// + SHMSACD, + + /// + /// The release was distributed on a multichannel Super High Material Super Audio CD. + /// + SHMSACDMultichannel, + + /// + /// The release was distributed on a slotMusic card. + /// + SlotMusic, + + /// + /// The release was distributed on a Super Video CD. + /// + SVCD, + + /// + /// The release was distributed on a Tefifon cartridge. + /// + Tefifon, + + /// + /// The release was distributed on a Universal Media Disc. + /// + UMD, + + /// + /// The release was distributed on a USB flash drive. + /// + USBFlashDrive, + + /// + /// The release was distributed on a Video CD. + /// + VCD, + + /// + /// The release was distributed on a Video High Density disc. + /// + VHD, + + /// + /// The release was distributed on a VHS videocassette. + /// + VHS, + + /// + /// The release was distributed on a vinyl record. + /// + Vinyl, + + /// + /// The release was distributed on a VinylDisc. + /// + VinylDisc, + + /// + /// The release was distributed on the CD side of a VinylDisc. + /// + VinylDiscCDSide, + + /// + /// The release was distributed on the DVD side of a VinylDisc. + /// + VinylDiscDVDSide, + + /// + /// The release was distributed on the vinyl side of a VinylDisc. + /// + VinylDiscVinylSide, + + /// + /// The release was distributed on a wax cylinder. + /// + WaxCylinder, + + /// + /// The release was distributed on a Zip disk. + /// + ZipDisk +} diff --git a/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicReleasePackaging.cs b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicReleasePackaging.cs new file mode 100644 index 00000000..d111e3a9 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicReleasePackaging.cs @@ -0,0 +1,132 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Enums.AudioLibrary; + +/// +/// Enumeration for the outermost physical packaging of a music release. +/// +[DebuggerDisplay("{ToString()}")] +public enum MusicReleasePackaging +{ + /// + /// The release is a book with a sleeve containing a medium, usually a compact disc. + /// + Book, + + /// + /// The release is a box with a lid or an opening that contains the medium and other packaging, like posters and a booklet. + /// + Box, + + /// + /// The release is a sleeve made of paper, paperboard, or cardboard. + /// + CardboardPaperSleeve, + + /// + /// The release is a regular plastic case for a cassette. + /// + CassetteCase, + + /// + /// The release is a minimalistic plastic case where the back and the front are kept together by a small hinge. + /// + ClamshellCase, + + /// + /// The release is a bounded booklet, usually in hardcover, with a sleeve bound to its spine that houses a compact disc. + /// + Digibook, + + /// + /// The release is a folded cardboard compact disc packaging that has a small pocket on one side for the disc. + /// + Digifile, + + /// + /// The release is a folded case, typically made of coated paperboard, with one or more plastic trays glued into it. + /// + Digipak, + + /// + /// The release is a pouch-like package with an internal mechanism that pushes the contents out when the lid flap is opened. + /// + DiscboxSlider, + + /// + /// The release is a double-sided, double-width jewel case normally holding two to four compact discs. + /// + Fatbox, + + /// + /// The release is a cardboard sleeve that folds in halves, thirds, or more, and can hold multiple records, compact discs, booklets, or posters. + /// + GatefoldCover, + + /// + /// The release is the traditional compact disc case, made of hard, brittle plastic. + /// + JewelCase, + + /// + /// The release is the traditional DVD case, made of soft plastic with a thin transparent cover protecting the artwork. + /// + KeepCase, + + /// + /// The release is a large cardboard box, often used to sell compact discs in North America so that they would fit vinyl racks. + /// + Longbox, + + /// + /// The release is an often decorated metal tin containing one or more compact discs. + /// + MetalTin, + + /// + /// The release is a sleeve made entirely of plastic that holds the medium and the other parts of the album. + /// + PlasticSleeve, + + /// + /// The release is a box with openings at its two ends that contains a tray holding the medium. + /// + Slidepack, + + /// + /// The release is a thinner jewel case, commonly used for compact disc singles. + /// + SlimJewelCase, + + /// + /// The release is a four or five-sided box that surrounds a second inner package such as a jewel case. + /// + Slipcase, + + /// + /// The release is a digipak-like case held together with a snapping plastic closure. + /// + SnapCase, + + /// + /// The release is a cardboard jacket, commonly used for 8cm compact disc singles in Japan. + /// + SnapPack, + + /// + /// The release is a case similar to the regular jewel case, but with rounded corners and a latch closing mechanism. + /// + SuperJewelBox, + + /// + /// The packaging of the release does not fit into any of the known categories. + /// + Other, + + /// + /// The release has no packaging at all, which is common for digital media. + /// + None +} diff --git a/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicReleaseStatus.cs b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicReleaseStatus.cs new file mode 100644 index 00000000..f5b871f4 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicReleaseStatus.cs @@ -0,0 +1,47 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Enums.AudioLibrary; + +/// +/// Enumeration for the status of a music release, describing the officiality of the release. +/// +[DebuggerDisplay("{ToString()}")] +public enum MusicReleaseStatus +{ + /// + /// The release was distributed without the authorization of the artist or label. + /// + Bootleg, + + /// + /// The release was announced but never distributed. + /// + Cancelled, + + /// + /// The release was expunged from the catalog of the artist or label. + /// + Expunged, + + /// + /// The release was released through official channels. + /// + Official, + + /// + /// The release was distributed for promotional purposes only. + /// + Promotion, + + /// + /// The release is a pseudo-release, not an actual release by the artist. + /// + PseudoRelease, + + /// + /// The release was distributed but later withdrawn from circulation. + /// + Withdrawn +} diff --git a/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicReleaseType.cs b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicReleaseType.cs new file mode 100644 index 00000000..900d45fb --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Enums/AudioLibrary/MusicReleaseType.cs @@ -0,0 +1,97 @@ +#region ========================================================================= USING ===================================================================================== +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Enums.AudioLibrary; + +/// +/// Enumeration for the type of a music release, describing the format of the release in terms of its content. +/// +[DebuggerDisplay("{ToString()}")] +public enum MusicReleaseType +{ + /// + /// A release consisting of a collection of tracks. + /// + Album, + + /// + /// A release that was aired as a broadcast. + /// + Broadcast, + + /// + /// A release that is longer than a single but shorter than an album. + /// + Ep, + + /// + /// The type of the release does not fall into any of the known categories. + /// + Other, + + /// + /// A release consisting of a small number of tracks. + /// + Single, + + /// + /// A release containing a dramatized audio performance. + /// + AudioDrama, + + /// + /// A release containing a recording of a book being read aloud. + /// + AudioBook, + + /// + /// A release that gathers tracks from various sources or artists. + /// + Compilation, + + /// + /// A release containing a continuous mix of tracks by a DJ. + /// + DjMix, + + /// + /// A release of demo recordings, typically distributed before the official release. + /// + Demo, + + /// + /// A release containing an audio recording made outside of a studio. + /// + FieldRecording, + + /// + /// A release containing a recorded interview. + /// + Interview, + + /// + /// A release recorded during a live performance. + /// + Live, + + /// + /// A release containing a compilation of tracks, typically distributed outside of official channels. + /// + Mixtape, + + /// + /// A release containing modified or reinterpreted versions of original recordings. + /// + Remix, + + /// + /// A release containing music written for a motion picture or television program. + /// + Soundtrack, + + /// + /// A release containing spoken word content. + /// + SpokenWord +} diff --git a/src/Lumina.Presentation.Web/Common/Enums/MediaLibrary/ArtworkType.cs b/src/Lumina.Presentation.Web/Common/Enums/MediaLibrary/ArtworkType.cs new file mode 100644 index 00000000..d152e291 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Enums/MediaLibrary/ArtworkType.cs @@ -0,0 +1,92 @@ +namespace Lumina.Presentation.Web.Common.Enums.MediaLibrary; + +/// +/// Enumeration for the type of artwork of a media library item. +/// +public enum ArtworkType +{ + /// + /// The main artwork of the media library item, like the cover of a book. + /// + Cover, + + /// + /// The front of the artwork of the media library item, when it is stored separately from the cover. + /// + Front, + + /// + /// The back of the artwork of the media library item. + /// + Back, + + /// + /// A page of the booklet of the media library item. + /// + Booklet, + + /// + /// The artwork printed on the medium of the media library item, like a disc label. + /// + Medium, + + /// + /// The artwork printed on the tray of the media library item. + /// + Tray, + + /// + /// The artwork printed on the spine of the media library item. + /// + Spine, + + /// + /// The obi strip of the media library item. + /// + Obi, + + /// + /// The sticker of the media library item. + /// + Sticker, + + /// + /// The poster of the media library item. + /// + Poster, + + /// + /// The liner notes of the media library item. + /// + Liner, + + /// + /// A watermark carried by the artwork of the media library item. + /// + Watermark, + + /// + /// The backdrop, or fanart, of the media library item. + /// + Backdrop, + + /// + /// The banner of the media library item. + /// + Banner, + + /// + /// The logo of the media library item. + /// + Logo, + + /// + /// The thumbnail of the media library item. + /// + Thumb, + + /// + /// Any other artwork of the media library item. + /// + Other, +} diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbumsLiteRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbumsLiteRequest.cs new file mode 100644 index 00000000..71b7b956 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbumsLiteRequest.cs @@ -0,0 +1,21 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; + +/// +/// Represents a request to get the lightweight details of the albums of a music artist. +/// +/// The unique identifier of the artist whose albums are retrieved, taken from the route. Required. +/// The unique identifier of the media library the artist belongs to. Required. +/// The page of results to retrieve. Optional. +/// The maximum number of albums to retrieve per page. Optional. +[DebuggerDisplay("ArtistId: {ArtistId}")] +public record GetArtistAlbumsLiteRequest( + string ArtistId, + Guid LibraryId, + int? CurrentPage, + int? PerPage +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbumViewRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbumViewRequest.cs new file mode 100644 index 00000000..dd8d1a95 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbumViewRequest.cs @@ -0,0 +1,19 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; + +/// +/// Represents a request for displaying the details of an album of a music artist. +/// +/// The unique identifier of the artist the album belongs to, taken from the route. Required. +/// The unique identifier of the album whose details are displayed, taken from the route. Required. +/// The Id of the media library the album belongs to. Required. +[DebuggerDisplay("AlbumId: {AlbumId}")] +public record GetMusicAlbumViewRequest( + string ArtistId, + string AlbumId, + Guid LibraryId +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/UpdateMusicAlbumRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/UpdateMusicAlbumRequest.cs new file mode 100644 index 00000000..b66ed2aa --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/UpdateMusicAlbumRequest.cs @@ -0,0 +1,42 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; + +/// +/// Represents a request to update an existing album of a music artist. +/// +/// The album metadata of the album. Required. +/// The physical or digital medium of the album. Optional. +/// The outermost physical packaging of the album. Optional. +/// The barcode of the album. Optional. +/// The catalog numbers of the album. Optional. +/// The name of the label that issued the album. Optional. +/// The ASIN (Amazon Standard Identification Number) of the album. Optional. +/// The MusicBrainz identifier of the release. Optional. +/// The MusicBrainz identifier of the release group. Optional. +/// The MusicBrainz identifier of the release artist. Optional. +/// The list of media contributors that performed on the album. Required. +/// The list of ratings for this album. Required. +[DebuggerDisplay("Title: {Metadata?.Title}")] +public record UpdateMusicAlbumRequest( + MusicAlbumMetadataDto? Metadata, + MusicMediaFormat? MediaFormat, + MusicReleasePackaging? Packaging, + string? Barcode, + List? CatalogNumbers, + string? Label, + string? ASIN, + Guid? MusicBrainzReleaseId, + Guid? MusicBrainzReleaseGroupId, + Guid? MusicBrainzReleaseArtistId, + List? Contributors, + List? Ratings +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistViewRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistViewRequest.cs new file mode 100644 index 00000000..76277f04 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistViewRequest.cs @@ -0,0 +1,17 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; + +/// +/// Represents a request for displaying the details of a music artist. +/// +/// The unique identifier of the artist whose details are displayed, taken from the route. Required. +/// The Id of the media library the artist belongs to. Required. +[DebuggerDisplay("ArtistId: {ArtistId}")] +public record GetMusicArtistViewRequest( + string ArtistId, + Guid LibraryId +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistsLiteRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistsLiteRequest.cs new file mode 100644 index 00000000..3c4da161 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistsLiteRequest.cs @@ -0,0 +1,34 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Enums.Common; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; + +/// +/// Represents a request to get the lightweight details of the artists of a media library. +/// +/// The unique identifier of the media library whose artists are retrieved. Required. +/// The page of results to retrieve. Optional. +/// The maximum number of artists to retrieve per page. Optional. +/// The search term used to filter the artists by name. Optional. +/// +/// The alpha key used to filter the results by the first character of their name, for the alpha picker. Optional. +/// Can be to disable alpha filtering, a single ASCII letter (case-insensitive) to filter by that letter, +/// "#" to filter by names whose first character is a digit, or "*" to filter by names whose first character is neither a letter nor a digit. +/// +/// Whether the leading "The " prefix of a name is ignored when computing the alpha key, or not. Optional. +/// The name of the field by which to sort the results. Optional. +/// The direction in which to sort the results. Optional. +[DebuggerDisplay("LibraryId: {LibraryId}")] +public record GetMusicArtistsLiteRequest( + Guid LibraryId, + int? CurrentPage, + int? PerPage, + string? SearchTerm, + string? FilterAlphaKey, + bool ShouldIgnoreThePrefixForAlphaPicker, + string? SortBy, + SortOrder? SortOrder +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistsViewRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistsViewRequest.cs new file mode 100644 index 00000000..9a8efa54 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistsViewRequest.cs @@ -0,0 +1,15 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; + +/// +/// Represents a request for displaying the music artists browsing view. +/// +/// The unique identifier of the media library whose artists are browsed. Optional. +[DebuggerDisplay("LibraryId: {LibraryId}")] +public record GetMusicArtistsViewRequest( + Guid? LibraryId +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistAlbumRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistAlbumRequest.cs new file mode 100644 index 00000000..4dbaaeaa --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistAlbumRequest.cs @@ -0,0 +1,46 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; + +/// +/// Represents a request to update an album of an artist, together with the tracks of the album, within an artist update. +/// +/// The Id of the album, when the album already exists. Optional. +/// The album metadata of the album. Required. +/// The physical or digital medium of the album. Optional. +/// The outermost physical packaging of the album. Optional. +/// The barcode of the album. Optional. +/// The catalog numbers of the album. Optional. +/// The name of the label that issued the album. Optional. +/// The ASIN (Amazon Standard Identification Number) of the album. Optional. +/// The MusicBrainz identifier of the release. Optional. +/// The MusicBrainz identifier of the release group. Optional. +/// The MusicBrainz identifier of the release artist. Optional. +/// The list of media contributors that performed on the album. Required. +/// The list of ratings for this album. Required. +/// The list of tracks of the album, each with the Id of the track when the track already exists. Required. +[DebuggerDisplay("Title: {Metadata?.Title}")] +public record UpdateMusicArtistAlbumRequest( + Guid? AlbumId, + MusicAlbumMetadataDto? Metadata, + MusicMediaFormat? MediaFormat, + MusicReleasePackaging? Packaging, + string? Barcode, + List? CatalogNumbers, + string? Label, + string? ASIN, + Guid? MusicBrainzReleaseId, + Guid? MusicBrainzReleaseGroupId, + Guid? MusicBrainzReleaseArtistId, + List? Contributors, + List? Ratings, + List? Tracks +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistRequest.cs new file mode 100644 index 00000000..6acce614 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistRequest.cs @@ -0,0 +1,33 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; + +/// +/// Represents a request to update a music artist, together with the albums of the artist and the tracks of those albums. +/// +/// The metadata of the artist. Required. +/// The website of the artist. Optional. +/// The MusicBrainz identifier of the artist. Optional. +/// The list of IPI (Interested Party Information) codes of the artist. Optional. +/// The list of ISNI (International Standard Name Identifier) codes of the artist. Optional. +/// The list of media contributors that make up the artist. Required. +/// The list of ratings for the artist. Required. +/// The list of albums of the artist, each with its own list of tracks. Required. +[DebuggerDisplay("Name: {Metadata?.Name}")] +public record UpdateMusicArtistRequest( + MusicArtistMetadataDto? Metadata, + string? Website, + Guid? MusicBrainzArtistId, + List? Ipis, + List? Isnis, + List? Contributors, + List? Ratings, + List? Albums +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistTrackRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistTrackRequest.cs new file mode 100644 index 00000000..b9e0c36f --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistTrackRequest.cs @@ -0,0 +1,49 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; + +/// +/// Represents a request to update a track of an album of an artist, within an artist update. +/// +/// The Id of the track, when the track already exists. Optional. +/// The file system path of the track. Required. +/// The audio metadata of the track. Required. +/// The number of the track on its disc. Required. +/// The number of the disc the track belongs to. Optional. +/// The script used by the language of the track. Optional. +/// The musical key of the track. Optional. +/// The tempo of the track in beats per minute. Optional. +/// The work the track is a recording of. Optional. +/// The MusicBrainz identifier of the recording. Optional. +/// The MusicBrainz identifier of the track. Optional. +/// The list of moods of the track. Optional. +/// The list of ISRC (International Standard Recording Code) of the track. Optional. +/// The list of media contributors that performed on the track. Required. +/// The list of ratings for this track. Required. +[DebuggerDisplay("Title: {Metadata?.Title}")] +public record UpdateMusicArtistTrackRequest( + Guid? TrackId, + string? Path, + MusicTrackMetadataDto? Metadata, + int? TrackNumber, + int? DiscNumber, + string? Script, + MusicKey? Key, + int? Bpm, + MusicWorkDto? Work, + Guid? MusicBrainzRecordingId, + Guid? MusicBrainzTrackId, + List? Moods, + List? Isrcs, + List? Contributors, + List? Ratings +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracksLiteRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracksLiteRequest.cs new file mode 100644 index 00000000..dbcaaf42 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracksLiteRequest.cs @@ -0,0 +1,23 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; + +/// +/// Represents a request to get the lightweight details of the tracks of an album. +/// +/// The unique identifier of the artist the album belongs to, taken from the route. Required. +/// The unique identifier of the album whose tracks are retrieved, taken from the route. Required. +/// The unique identifier of the media library the album belongs to. Required. +/// The page of results to retrieve. Optional. +/// The maximum number of tracks to retrieve per page. Optional. +[DebuggerDisplay("AlbumId: {AlbumId}")] +public record GetAlbumTracksLiteRequest( + string ArtistId, + string AlbumId, + Guid LibraryId, + int? CurrentPage, + int? PerPage +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrackViewRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrackViewRequest.cs new file mode 100644 index 00000000..8dd2341f --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrackViewRequest.cs @@ -0,0 +1,21 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; + +/// +/// Represents a request for displaying the details of a track of an album of a music artist. +/// +/// The unique identifier of the artist the album belongs to, taken from the route. Required. +/// The unique identifier of the album the track belongs to, taken from the route. Required. +/// The unique identifier of the track whose details are displayed, taken from the route. Required. +/// The Id of the media library the track belongs to. Required. +[DebuggerDisplay("TrackId: {TrackId}")] +public record GetMusicTrackViewRequest( + string ArtistId, + string AlbumId, + string TrackId, + Guid LibraryId +); diff --git a/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/UpdateMusicTrackRequest.cs b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/UpdateMusicTrackRequest.cs new file mode 100644 index 00000000..aa98dfed --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/UpdateMusicTrackRequest.cs @@ -0,0 +1,47 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using System; +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; + +/// +/// Represents a request to update an existing track of an album of a music artist. +/// +/// The file system path of the track. Required. +/// The audio metadata of the track. Required. +/// The number of the track on its disc. Required. +/// The number of the disc the track belongs to. Optional. +/// The script used by the language of the track. Optional. +/// The musical key of the track. Optional. +/// The tempo of the track in beats per minute. Optional. +/// The work the track is a recording of. Optional. +/// The MusicBrainz identifier of the recording. Optional. +/// The MusicBrainz identifier of the track. Optional. +/// The list of moods of the track. Optional. +/// The list of ISRC (International Standard Recording Code) of the track. Optional. +/// The list of media contributors that performed on the track. Required. +/// The list of ratings for this track. Required. +[DebuggerDisplay("Title: {Metadata?.Title}")] +public record UpdateMusicTrackRequest( + string? Path, + MusicTrackMetadataDto? Metadata, + int? TrackNumber, + int? DiscNumber, + string? Script, + MusicKey? Key, + int? Bpm, + MusicWorkDto? Work, + Guid? MusicBrainzRecordingId, + Guid? MusicBrainzTrackId, + List? Moods, + List? Isrcs, + List? Contributors, + List? Ratings +); diff --git a/src/Lumina.Presentation.Web/Common/Routes/ApiRoutes.Music.cs b/src/Lumina.Presentation.Web/Common/Routes/ApiRoutes.Music.cs new file mode 100644 index 00000000..e1778db2 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Routes/ApiRoutes.Music.cs @@ -0,0 +1,28 @@ +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 music library endpoints of the remote API. + /// + public static class Music + { + public const string GET_ARTISTS_LITE = "libraries/{libraryId}/artists/lite"; + public const string GET_ARTIST = "libraries/{libraryId}/artists/{artistId}"; + public const string UPDATE_ARTIST = "libraries/{libraryId}/artists/{artistId}"; + public const string UPDATE_ARTIST_COVER = "libraries/{libraryId}/artists/{artistId}/cover"; + public const string DELETE_ARTIST = "libraries/{libraryId}/artists/{artistId}"; + public const string GET_ARTIST_ALBUMS_LITE = "libraries/{libraryId}/artists/{artistId}/albums/lite"; + public const string GET_ALBUM = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}"; + public const string UPDATE_ALBUM = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}"; + public const string UPDATE_ALBUM_COVER = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}/cover"; + public const string DELETE_ALBUM = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}"; + public const string GET_ALBUM_TRACKS_LITE = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/lite"; + public const string GET_TRACK = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}"; + public const string UPDATE_TRACK = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}"; + public const string DELETE_TRACK = "libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}"; + } +} diff --git a/src/Lumina.Presentation.Web/Common/Routes/WebRoutes.Music.cs b/src/Lumina.Presentation.Web/Common/Routes/WebRoutes.Music.cs new file mode 100644 index 00000000..dd707299 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Routes/WebRoutes.Music.cs @@ -0,0 +1,32 @@ +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 music library pages. + /// + public static class Music + { + public const string ARTISTS_INDEX = "{culture}/library/audio-library/music-library/artists"; + public const string GET_ARTISTS = "{culture}/library/audio-library/music-library/artists/api-get-artists"; + public const string ARTIST = "{culture}/library/audio-library/music-library/artists/{artistId}"; + public const string GET_ARTIST = "{culture}/library/audio-library/music-library/artists/{artistId}/api-get-artist"; + public const string SAVE_ARTIST = "{culture}/library/audio-library/music-library/artists/{artistId}/api-save-artist"; + public const string UPDATE_ARTIST_COVER = "{culture}/library/audio-library/music-library/artists/{artistId}/api-update-cover"; + public const string DELETE_ARTIST = "{culture}/library/audio-library/music-library/artists/{artistId}/api-delete-artist"; + public const string GET_ARTIST_ALBUMS = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/api-get-albums"; + public const string ALBUM = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}"; + public const string GET_ALBUM = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-get-album"; + public const string SAVE_ALBUM = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-save-album"; + public const string UPDATE_ALBUM_COVER = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-update-cover"; + public const string DELETE_ALBUM = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-delete-album"; + public const string GET_ALBUM_TRACKS = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/api-get-tracks"; + public const string TRACK = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}"; + public const string GET_TRACK = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}/api-get-track"; + public const string SAVE_TRACK = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}/api-save-track"; + public const string DELETE_TRACK = "{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}/api-delete-track"; + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpoint.cs new file mode 100644 index 00000000..819810d7 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpoint.cs @@ -0,0 +1,64 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +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.Library.AudioLibrary.MusicLibrary.Albums.DeleteMusicAlbum; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-delete-album route. +/// +public class DeleteMusicAlbumEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public DeleteMusicAlbumEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.DELETE); + Routes(WebRoutes.Music.DELETE_ALBUM); + DontAutoTag(); + Options(options => options.WithTags("Music")); + EnableAntiforgery(); + } + + /// + /// Deletes the music album identified by the route. + /// + /// The request object. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken) + { + // The album is identified by the {artistId} and {albumId} route values; all ids are normalized to Guids before they are substituted + // into the upstream URL, so that a crafted value can never escape its URL segment, and an unparseable id is reported by the API as a + // missing id. + string routeArtistId = HttpContext.Request.RouteValues["artistId"]?.ToString() ?? string.Empty; + string artistId = Guid.TryParse(routeArtistId, out Guid parsedArtistId) ? parsedArtistId.ToString() : Guid.Empty.ToString(); + string routeAlbumId = HttpContext.Request.RouteValues["albumId"]?.ToString() ?? string.Empty; + string albumId = Guid.TryParse(routeAlbumId, out Guid parsedAlbumId) ? parsedAlbumId.ToString() : Guid.Empty.ToString(); + string queryLibraryId = HttpContext.Request.Query["libraryId"].ToString(); + string libraryId = Guid.TryParse(queryLibraryId, out Guid parsedLibraryId) ? parsedLibraryId.ToString() : Guid.Empty.ToString(); + + await _apiHttpClient.DeleteAsync(ApiRoutes.Music.DELETE_ALBUM.Replace("{libraryId}", libraryId).Replace("{artistId}", artistId).Replace("{albumId}", albumId), cancellationToken).ConfigureAwait(false); + return JsonSuccess(); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpointSummary.cs new file mode 100644 index 00000000..3386ca71 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpointSummary.cs @@ -0,0 +1,24 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.DeleteMusicAlbum; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class DeleteMusicAlbumEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public DeleteMusicAlbumEndpointSummary() + { + Summary = "Deletes a music album."; + Description = "Deletes the music album identified by the route, together with its tracks."; + + Response(200, "The music album was deleted."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpoint.cs new file mode 100644 index 00000000..0a491be2 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpoint.cs @@ -0,0 +1,133 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Themes; +using Lumina.Presentation.Web.Common.Primitives; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +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.Http; +using Microsoft.Extensions.Localization; +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.EditMusicAlbum; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId} route. +/// +public class EditMusicAlbumViewEndpoint : 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.Library.AudioLibrary.MusicLibrary.Albums.Item"; + 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 = "library/audio-library/music-library/albums/item"; + + private static readonly JsonSerializerOptions s_camelCaseJsonOptions = new() + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + Converters = { new JsonStringEnumConverter() } + }; + + private readonly IApiHttpClient _apiHttpClient; + 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 interactions with the API. + /// 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 EditMusicAlbumViewEndpoint(IApiHttpClient apiHttpClient, IUrlService urlService, ThemePageRenderer themePageRenderer, IAntiforgery antiforgery, IStringLocalizerFactory stringLocalizerFactory) + { + _apiHttpClient = apiHttpClient; + _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.Music.ALBUM); + DontAutoTag(); + Options(options => options.WithTags("Music")); + } + + /// + /// Displays the music album details and editing view, rendered by the active theme with a fallback to the Razor view. + /// + /// The request containing the Id of the album to view. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(GetMusicAlbumViewRequest request, CancellationToken cancellationToken) + { + // The view needs the full details of the album to show its current values, so they are fetched from the API up front; the route + // values are normalized to Guids before they are substituted into the upstream URL, so that a crafted route value can never escape + // its URL segment, and an unparseable id is reported by the API as a missing album id. + request = request with { ArtistId = Guid.TryParse(request.ArtistId, out Guid artistId) ? artistId.ToString() : Guid.Empty.ToString() }; + request = request with { AlbumId = Guid.TryParse(request.AlbumId, out Guid albumId) ? albumId.ToString() : Guid.Empty.ToString() }; + MusicAlbumDto album = await _apiHttpClient.GetAsync(ApiRoutes.Music.GET_ALBUM.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{artistId}", request.ArtistId).Replace("{albumId}", request.AlbumId), cancellationToken).ConfigureAwait(false); + string title = album.Metadata?.Title ?? string.Empty; + + // The themed view is a regular page that submits its own requests, so a fresh anti-forgery token must be issued for it. + AntiforgeryTokenSet antiforgeryTokens = _antiforgery.GetAndStoreTokens(HttpContext); + + ThemePageDto pageModel = new() + { + PageKey = VIEW_PAGE_KEY, + Title = title, + Description = string.Empty, + PageData = new Dictionary + { + ["artistId"] = album.ArtistId.ToString(), + ["albumId"] = album.Id.ToString(), + ["libraryId"] = album.LibraryId.ToString(), + ["antiforgeryToken"] = antiforgeryTokens.RequestToken, + ["saveUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.SAVE_ALBUM, new { artistId = default(Guid), albumId = default(Guid) }) ?? string.Empty, + ["deleteUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.DELETE_ALBUM, new { artistId = default(Guid), albumId = default(Guid) }) ?? string.Empty, + ["tracksUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.GET_ALBUM_TRACKS, 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, + ["coverUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.UPDATE_ALBUM_COVER, new { artistId = default(Guid), albumId = default(Guid) }) ?? string.Empty, + ["backUrl"] = (_urlService.GetAbsoluteUrl(WebRoutes.Music.ARTIST, new { artistId = album.ArtistId }) ?? string.Empty) + "?libraryId=" + album.LibraryId, + ["albumJson"] = JsonSerializer.Serialize(album, s_camelCaseJsonOptions), + ["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer), + ["stringsJson"] = JsonSerializer.Serialize(ThemePageDataFactory.CreateLocalizedStrings(_localizer), s_camelCaseJsonOptions) + } + }; + + Result sectionResult = await _themePageRenderer.RenderAsync(pageModel, requestedThemeId: null, cancellationToken).ConfigureAwait(false); + if (sectionResult.IsFailure) + { + Dictionary viewData = new() + { + ["Title"] = title + }; + return View("/Core/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.cshtml", album, viewData); + } + + 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/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpointSummary.cs new file mode 100644 index 00000000..ab2881d2 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpointSummary.cs @@ -0,0 +1,29 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.EditMusicAlbum; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class EditMusicAlbumViewEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public EditMusicAlbumViewEndpointSummary() + { + Summary = "Renders the music album details and editing view."; + Description = "Renders the view for displaying and editing the music album identified by the route."; + + RequestParam(r => r.ArtistId, "The unique identifier of the artist the album belongs to. Required."); + RequestParam(r => r.AlbumId, "The unique identifier of the album to display. Required."); + RequestParam(r => r.LibraryId, "The unique identifier of the media library the album belongs to. Required."); + + Response(200, "The view for displaying and editing the music album is rendered."); + } +} 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 new file mode 100644 index 00000000..11ddeb00 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpoint.cs @@ -0,0 +1,77 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Common; +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetArtistAlbums; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/albums/api-get-albums route. +/// +public class GetArtistAlbumsEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public GetArtistAlbumsEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.GET); + Routes(WebRoutes.Music.GET_ARTIST_ALBUMS); + DontAutoTag(); + Options(options => options.WithTags("Music")); + } + + /// + /// Retrieves the lightweight details of the albums of a music artist. + /// + /// The request containing the parameters used to retrieve the albums. + /// Cancellation 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); + return JsonSuccess(response); + } + + /// + /// Builds the API endpoint used to retrieve the lightweight details of the albums of a music artist. + /// + /// The request containing the parameters used to retrieve the albums. + /// The API endpoint to which the retrieval request is sent. + private static string BuildItemsEndpoint(GetArtistAlbumsLiteRequest query) + { + // The route value is normalized to a Guid before it is substituted into the upstream URL, so that a crafted route value can never + // escape its URL segment, and an unparseable id is reported by the API as a missing artist id. + string artistId = Guid.TryParse(query.ArtistId, out Guid parsedArtistId) ? parsedArtistId.ToString() : Guid.Empty.ToString(); + StringBuilder endpoint = new(ApiRoutes.Music.GET_ARTIST_ALBUMS_LITE.Replace("{libraryId}", query.LibraryId.ToString()).Replace("{artistId}", artistId)); + List parameters = []; + if (query.CurrentPage is not null) + parameters.Add($"currentPage={query.CurrentPage}"); + if (query.PerPage is not null) + parameters.Add($"perPage={query.PerPage}"); + if (parameters.Count > 0) + endpoint.Append('?').Append(string.Join('&', parameters)); + return endpoint.ToString(); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointSummary.cs new file mode 100644 index 00000000..19597ae8 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointSummary.cs @@ -0,0 +1,38 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using System; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetArtistAlbums; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class GetArtistAlbumsEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public GetArtistAlbumsEndpointSummary() + { + Summary = "Retrieves the lightweight details of the albums of a music artist."; + Description = "Retrieves the lightweight read models of the albums of the music artist identified by the route."; + + RequestParam(r => r.ArtistId, "The unique identifier of the artist whose albums are retrieved. Required."); + RequestParam(r => r.LibraryId, "The Id of the media library the artist belongs to. Required."); + RequestParam(r => r.CurrentPage, "The page of results to retrieve. Optional."); + RequestParam(r => r.PerPage, "The maximum number of albums to retrieve per page. Optional."); + + ExampleRequest = new GetArtistAlbumsLiteRequest( + ArtistId: Guid.NewGuid().ToString(), + LibraryId: Guid.NewGuid(), + CurrentPage: 1, + PerPage: 10 + ); + + Response(200, "The lightweight details of the albums of the music artist are retrieved."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpoint.cs new file mode 100644 index 00000000..34ab493f --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpoint.cs @@ -0,0 +1,60 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +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.Library.AudioLibrary.MusicLibrary.Albums.GetMusicAlbum; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-get-album route. +/// +public class GetMusicAlbumEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public GetMusicAlbumEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.GET); + Routes(WebRoutes.Music.GET_ALBUM); + DontAutoTag(); + Options(options => options.WithTags("Music")); + } + + /// + /// Retrieves the full details of the music album identified by . + /// + /// The request containing the Id of the album to retrieve. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(GetMusicAlbumViewRequest request, CancellationToken cancellationToken) + { + // The route values are normalized to Guids before they are substituted into the upstream URL, so that a crafted route value can never + // escape its URL segment, and an unparseable id is reported by the API as a missing album id. + request = request with { ArtistId = Guid.TryParse(request.ArtistId, out Guid artistId) ? artistId.ToString() : Guid.Empty.ToString() }; + request = request with { AlbumId = Guid.TryParse(request.AlbumId, out Guid albumId) ? albumId.ToString() : Guid.Empty.ToString() }; + + MusicAlbumDto album = await _apiHttpClient.GetAsync(ApiRoutes.Music.GET_ALBUM.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{artistId}", request.ArtistId).Replace("{albumId}", request.AlbumId), cancellationToken).ConfigureAwait(false); + return JsonSuccess(album); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpointSummary.cs new file mode 100644 index 00000000..015782f5 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpointSummary.cs @@ -0,0 +1,29 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetMusicAlbum; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class GetMusicAlbumEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public GetMusicAlbumEndpointSummary() + { + Summary = "Retrieves the full details of a music album."; + Description = "Retrieves the full details of the music album identified by the route."; + + RequestParam(r => r.ArtistId, "The unique identifier of the artist the album belongs to. Required."); + RequestParam(r => r.AlbumId, "The unique identifier of the album to retrieve. Required."); + RequestParam(r => r.LibraryId, "The unique identifier of the media library the album belongs to. Required."); + + Response(200, "The full details of the music album are retrieved."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpoint.cs new file mode 100644 index 00000000..714c1330 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpoint.cs @@ -0,0 +1,67 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +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.Library.AudioLibrary.MusicLibrary.Albums.SaveMusicAlbum; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-save-album route. +/// +public class SaveMusicAlbumEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public SaveMusicAlbumEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.PUT); + Routes(WebRoutes.Music.SAVE_ALBUM); + DontAutoTag(); + Options(options => options.WithTags("Music")); + EnableAntiforgery(); + } + + /// + /// Updates the music album described by . + /// + /// The request containing the edited details of the album. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(UpdateMusicAlbumRequest request, CancellationToken cancellationToken) + { + // The album is identified by the {artistId} and {albumId} route values, not by any id posted in the body, so that a mismatched id can + // never redirect the update to another album; all ids are normalized to Guids before they are substituted into the upstream URL, so + // that a crafted value can never escape its URL segment, and an unparseable id is reported by the API as a missing id. + string routeArtistId = HttpContext.Request.RouteValues["artistId"]?.ToString() ?? string.Empty; + string artistId = Guid.TryParse(routeArtistId, out Guid parsedArtistId) ? parsedArtistId.ToString() : Guid.Empty.ToString(); + string routeAlbumId = HttpContext.Request.RouteValues["albumId"]?.ToString() ?? string.Empty; + string albumId = Guid.TryParse(routeAlbumId, out Guid parsedAlbumId) ? parsedAlbumId.ToString() : Guid.Empty.ToString(); + string queryLibraryId = HttpContext.Request.Query["libraryId"].ToString(); + string libraryId = Guid.TryParse(queryLibraryId, out Guid parsedLibraryId) ? parsedLibraryId.ToString() : Guid.Empty.ToString(); + + MusicAlbumDto album = await _apiHttpClient.PutAsync( + ApiRoutes.Music.UPDATE_ALBUM.Replace("{libraryId}", libraryId).Replace("{artistId}", artistId).Replace("{albumId}", albumId), request, cancellationToken).ConfigureAwait(false); + return JsonSuccess(album); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpointSummary.cs new file mode 100644 index 00000000..30deab2e --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpointSummary.cs @@ -0,0 +1,25 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.SaveMusicAlbum; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class SaveMusicAlbumEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public SaveMusicAlbumEndpointSummary() + { + Summary = "Updates a music album."; + Description = "Updates the music album identified by the route, together with the tracks of the album."; + + Response(200, "The music album was updated."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpoint.cs new file mode 100644 index 00000000..39127f14 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpoint.cs @@ -0,0 +1,86 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Common; +using Microsoft.AspNetCore.Http; +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.UpdateAlbumCover; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-update-cover route. +/// +public class UpdateAlbumCoverEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public UpdateAlbumCoverEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.PUT); + Routes(WebRoutes.Music.UPDATE_ALBUM_COVER); + DontAutoTag(); + Options(options => options.WithTags("Music")); + EnableAntiforgery(); + } + + /// + /// Updates the cover image of the album with the image uploaded in the multipart form of the request. + /// + /// The request object. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken) + { + // The endpoint takes no typed request, because its body is a multipart file, so the album id is read from the {albumId} route value and the + // owning library from the {libraryId} query string; all the ids are normalized to Guids before they are substituted into the upstream URL, so + // that a crafted value can never escape its URL segment, and an unparseable id is reported by the API as a missing id. A missing file is + // forwarded as a multipart form without any file, so that the upstream API reports it with its own validation error. + Guid artistId = Guid.TryParse(HttpContext.Request.RouteValues["artistId"]?.ToString(), out Guid parsedArtistId) ? parsedArtistId : Guid.Empty; + Guid albumId = Guid.TryParse(HttpContext.Request.RouteValues["albumId"]?.ToString(), out Guid parsedAlbumId) ? parsedAlbumId : Guid.Empty; + string libraryId = Guid.TryParse(HttpContext.Request.Query["libraryId"].ToString(), out Guid parsedLibraryId) ? parsedLibraryId.ToString() : Guid.Empty.ToString(); + + IFormFile? cover = null; + if (HttpContext.Request.HasFormContentType) + { + try + { + cover = HttpContext.Request.Form.Files.Count > 0 ? HttpContext.Request.Form.Files[0] : null; + } + catch (InvalidDataException) + { + cover = null; + } + } + + // The cover stream must stay open while the file is streamed to the API, and is disposed when the request completes. + Stream? coverStream = cover?.OpenReadStream(); + try + { + UpdateMusicCoverDto response = await _apiHttpClient.PutMultipartAsync( + ApiRoutes.Music.UPDATE_ALBUM_COVER.Replace("{libraryId}", libraryId).Replace("{artistId}", artistId.ToString()).Replace("{albumId}", albumId.ToString()), coverStream, cover?.FileName, "cover", cancellationToken).ConfigureAwait(false); + return JsonSuccess(response.CoverPath); + } + finally + { + coverStream?.Dispose(); + } + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpointSummary.cs new file mode 100644 index 00000000..0a75f9e9 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpointSummary.cs @@ -0,0 +1,25 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.DTO.Common; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.UpdateAlbumCover; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class UpdateAlbumCoverEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public UpdateAlbumCoverEndpointSummary() + { + Summary = "Updates the cover image of an album."; + Description = "Updates the cover image of the album identified by the route, with the image uploaded in the multipart form of the request."; + + Response(200, "The relative path of the stored cover image is returned.", example: new SuccessResponse(true, default)); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpoint.cs new file mode 100644 index 00000000..4d1730fb --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpoint.cs @@ -0,0 +1,61 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +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.Library.AudioLibrary.MusicLibrary.Artists.DeleteMusicArtist; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/api-delete-artist route. +/// +public class DeleteMusicArtistEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public DeleteMusicArtistEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.DELETE); + Routes(WebRoutes.Music.DELETE_ARTIST); + DontAutoTag(); + Options(options => options.WithTags("Music")); + EnableAntiforgery(); + } + + /// + /// Deletes the music artist identified by the route. + /// + /// The request object. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken) + { + // The artist is identified by the {artistId} route value; both ids are normalized to Guids before they are substituted into the + // upstream URL, so that a crafted value can never escape its URL segment, and an unparseable id is reported by the API as a missing id. + string routeArtistId = HttpContext.Request.RouteValues["artistId"]?.ToString() ?? string.Empty; + string artistId = Guid.TryParse(routeArtistId, out Guid parsedArtistId) ? parsedArtistId.ToString() : Guid.Empty.ToString(); + string queryLibraryId = HttpContext.Request.Query["libraryId"].ToString(); + string libraryId = Guid.TryParse(queryLibraryId, out Guid parsedLibraryId) ? parsedLibraryId.ToString() : Guid.Empty.ToString(); + + await _apiHttpClient.DeleteAsync(ApiRoutes.Music.DELETE_ARTIST.Replace("{libraryId}", libraryId).Replace("{artistId}", artistId), cancellationToken).ConfigureAwait(false); + return JsonSuccess(); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpointSummary.cs new file mode 100644 index 00000000..9a1db23b --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpointSummary.cs @@ -0,0 +1,24 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.DeleteMusicArtist; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class DeleteMusicArtistEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public DeleteMusicArtistEndpointSummary() + { + Summary = "Deletes a music artist."; + Description = "Deletes the music artist identified by the route, together with its albums and tracks."; + + Response(200, "The music artist was deleted."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/EditMusicArtist/EditMusicArtistViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/EditMusicArtist/EditMusicArtistViewEndpoint.cs new file mode 100644 index 00000000..c025b99d --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/EditMusicArtist/EditMusicArtistViewEndpoint.cs @@ -0,0 +1,132 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Themes; +using Lumina.Presentation.Web.Common.Primitives; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +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.Http; +using Microsoft.Extensions.Localization; +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.EditMusicArtist; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId} route. +/// +public class EditMusicArtistViewEndpoint : 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.Library.AudioLibrary.MusicLibrary.Artists.Item"; + 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 = "library/audio-library/music-library/artists/item"; + + private static readonly JsonSerializerOptions s_camelCaseJsonOptions = new() + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + Converters = { new JsonStringEnumConverter() } + }; + + private readonly IApiHttpClient _apiHttpClient; + 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 interactions with the API. + /// 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 EditMusicArtistViewEndpoint(IApiHttpClient apiHttpClient, IUrlService urlService, ThemePageRenderer themePageRenderer, IAntiforgery antiforgery, IStringLocalizerFactory stringLocalizerFactory) + { + _apiHttpClient = apiHttpClient; + _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.Music.ARTIST); + DontAutoTag(); + Options(options => options.WithTags("Music")); + } + + /// + /// Displays the music artist details and editing view, rendered by the active theme with a fallback to the Razor view. + /// + /// The request containing the Id of the artist to view. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(GetMusicArtistViewRequest request, CancellationToken cancellationToken) + { + // The view needs the full details of the artist to show its current values, so they are fetched from the API up front; the route + // value is normalized to a Guid before it is substituted into the upstream URL, so that a crafted route value can never escape + // its URL segment, and an unparseable id is reported by the API as a missing artist id. + request = request with { ArtistId = Guid.TryParse(request.ArtistId, out Guid artistId) ? artistId.ToString() : Guid.Empty.ToString() }; + MusicArtistDto artist = await _apiHttpClient.GetAsync(ApiRoutes.Music.GET_ARTIST.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{artistId}", request.ArtistId), cancellationToken).ConfigureAwait(false); + string title = artist.Metadata?.Name ?? string.Empty; + + // The themed view is a regular page that submits its own requests, so a fresh anti-forgery token must be issued for it. + AntiforgeryTokenSet antiforgeryTokens = _antiforgery.GetAndStoreTokens(HttpContext); + + ThemePageDto pageModel = new() + { + PageKey = VIEW_PAGE_KEY, + Title = title, + Description = string.Empty, + PageData = new Dictionary + { + ["artistId"] = artist.Id.ToString(), + ["libraryId"] = artist.LibraryId.ToString(), + ["antiforgeryToken"] = antiforgeryTokens.RequestToken, + ["saveUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.SAVE_ARTIST, new { artistId = default(Guid) }) ?? string.Empty, + ["deleteUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.DELETE_ARTIST, new { artistId = default(Guid) }) ?? string.Empty, + ["albumsUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.GET_ARTIST_ALBUMS, new { artistId = default(Guid) }) ?? string.Empty, + ["albumUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.ALBUM, new { artistId = default(Guid), albumId = default(Guid) }) ?? string.Empty, + ["deleteAlbumUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.DELETE_ALBUM, new { artistId = default(Guid), albumId = default(Guid) }) ?? string.Empty, + ["coverUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.UPDATE_ARTIST_COVER, new { artistId = default(Guid) }) ?? string.Empty, + ["backUrl"] = (_urlService.GetAbsoluteUrl(WebRoutes.Music.ARTISTS_INDEX) ?? string.Empty) + "?libraryId=" + artist.LibraryId, + ["artistJson"] = JsonSerializer.Serialize(artist, s_camelCaseJsonOptions), + ["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer), + ["stringsJson"] = JsonSerializer.Serialize(ThemePageDataFactory.CreateLocalizedStrings(_localizer), s_camelCaseJsonOptions) + } + }; + + Result sectionResult = await _themePageRenderer.RenderAsync(pageModel, requestedThemeId: null, cancellationToken).ConfigureAwait(false); + if (sectionResult.IsFailure) + { + Dictionary viewData = new() + { + ["Title"] = title + }; + return View("/Core/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.cshtml", artist, viewData); + } + + 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/Library/AudioLibrary/MusicLibrary/Artists/EditMusicArtist/EditMusicArtistViewEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/EditMusicArtist/EditMusicArtistViewEndpointSummary.cs new file mode 100644 index 00000000..8d037c1b --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/EditMusicArtist/EditMusicArtistViewEndpointSummary.cs @@ -0,0 +1,29 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using System; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.EditMusicArtist; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class EditMusicArtistViewEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public EditMusicArtistViewEndpointSummary() + { + Summary = "Renders the music artist details and editing view."; + Description = "Renders the view for displaying and editing the music artist identified by the route."; + + RequestParam(r => r.ArtistId, "The unique identifier of the artist to display. Required."); + RequestParam(r => r.LibraryId, "The unique identifier of the media library the artist belongs to. Required."); + + Response(200, "The view for displaying and editing the music artist is rendered."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpoint.cs new file mode 100644 index 00000000..55ffee9d --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpoint.cs @@ -0,0 +1,59 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +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.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtist; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/api-get-artist route. +/// +public class GetMusicArtistEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public GetMusicArtistEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.GET); + Routes(WebRoutes.Music.GET_ARTIST); + DontAutoTag(); + Options(options => options.WithTags("Music")); + } + + /// + /// Retrieves the full details of the music artist identified by . + /// + /// The request containing the Id of the artist to retrieve. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(GetMusicArtistViewRequest request, CancellationToken cancellationToken) + { + // The route value is normalized to a Guid before it is substituted into the upstream URL, so that a crafted route value can never + // escape its URL segment, and an unparseable id is reported by the API as a missing artist id. + request = request with { ArtistId = Guid.TryParse(request.ArtistId, out Guid artistId) ? artistId.ToString() : Guid.Empty.ToString() }; + + MusicArtistDto artist = await _apiHttpClient.GetAsync(ApiRoutes.Music.GET_ARTIST.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{artistId}", request.ArtistId), cancellationToken).ConfigureAwait(false); + return JsonSuccess(artist); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpointSummary.cs new file mode 100644 index 00000000..e293c4ed --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpointSummary.cs @@ -0,0 +1,29 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using System; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtist; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class GetMusicArtistEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public GetMusicArtistEndpointSummary() + { + Summary = "Retrieves the full details of a music artist."; + Description = "Retrieves the full details of the music artist identified by the route."; + + RequestParam(r => r.ArtistId, "The unique identifier of the artist to retrieve. Required."); + RequestParam(r => r.LibraryId, "The unique identifier of the media library the artist belongs to. Required."); + + Response(200, "The full details of the music artist are retrieved."); + } +} 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 new file mode 100644 index 00000000..843fae20 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpoint.cs @@ -0,0 +1,83 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Common; +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtists; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/api-get-artists route. +/// +public class GetMusicArtistsEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public GetMusicArtistsEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.GET); + Routes(WebRoutes.Music.GET_ARTISTS); + DontAutoTag(); + Options(options => options.WithTags("Music")); + } + + /// + /// Retrieves the lightweight details of the music artists of a media library. + /// + /// The request containing the parameters used to retrieve the artists. + /// Cancellation 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); + return JsonSuccess(response); + } + + /// + /// Builds the API endpoint used to retrieve the lightweight details of the music artists of a media library. + /// + /// The request containing the parameters used to retrieve the artists. + /// The API endpoint to which the retrieval request is sent. + private static string BuildItemsEndpoint(GetMusicArtistsLiteRequest query) + { + StringBuilder endpoint = new(ApiRoutes.Music.GET_ARTISTS_LITE.Replace("{libraryId}", query.LibraryId.ToString())); + List parameters = []; + if (query.CurrentPage is not null) + parameters.Add($"currentPage={query.CurrentPage}"); + if (query.PerPage is not null) + parameters.Add($"perPage={query.PerPage}"); + if (!string.IsNullOrWhiteSpace(query.SearchTerm)) + parameters.Add($"searchTerm={Uri.EscapeDataString(query.SearchTerm)}"); + if (!string.IsNullOrWhiteSpace(query.FilterAlphaKey)) + parameters.Add($"filterAlphaKey={Uri.EscapeDataString(query.FilterAlphaKey)}"); + parameters.Add($"shouldIgnoreThePrefixForAlphaPicker={query.ShouldIgnoreThePrefixForAlphaPicker}"); + if (!string.IsNullOrWhiteSpace(query.SortBy)) + parameters.Add($"sortBy={Uri.EscapeDataString(query.SortBy)}"); + if (query.SortOrder is not null) + parameters.Add($"sortOrder={query.SortOrder}"); + if (parameters.Count > 0) + endpoint.Append('?').Append(string.Join('&', parameters)); + return endpoint.ToString(); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointSummary.cs new file mode 100644 index 00000000..5455a54e --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointSummary.cs @@ -0,0 +1,46 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using System; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtists; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class GetMusicArtistsEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public GetMusicArtistsEndpointSummary() + { + Summary = "Retrieves the lightweight details of the music artists of a media library."; + Description = "Retrieves the lightweight read models of the music artists of the media library identified by the route."; + + RequestParam(r => r.LibraryId, "The Id of the media library whose artists are retrieved. Required."); + RequestParam(r => r.CurrentPage, "The page of results to retrieve. Optional."); + RequestParam(r => r.PerPage, "The maximum number of artists to retrieve per page. Optional."); + RequestParam(r => r.SearchTerm, "The search term used to filter the artists by name. Optional."); + RequestParam(r => r.FilterAlphaKey, "The alpha key used to filter the results by the first character of their name, for the alpha picker. Optional."); + RequestParam(r => r.ShouldIgnoreThePrefixForAlphaPicker, "Whether the leading \"The \" prefix of a name is ignored when computing the alpha key, or not. Optional."); + RequestParam(r => r.SortBy, "The name of the field by which to sort the results. Optional."); + RequestParam(r => r.SortOrder, "The direction in which to sort the results. Optional."); + + ExampleRequest = new GetMusicArtistsLiteRequest( + LibraryId: Guid.NewGuid(), + CurrentPage: 1, + PerPage: 10, + SearchTerm: "queen", + FilterAlphaKey: null, + ShouldIgnoreThePrefixForAlphaPicker: false, + SortBy: null, + SortOrder: null + ); + + Response(200, "The lightweight details of the music artists of the media library are retrieved."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpoint.cs new file mode 100644 index 00000000..7a601d87 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpoint.cs @@ -0,0 +1,112 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.Libraries; +using Lumina.Presentation.Web.Common.DTO.Themes; +using Lumina.Presentation.Web.Common.Primitives; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +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.Library.AudioLibrary.MusicLibrary.Artists.Index; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists route. +/// +public class MusicArtistsIndexViewEndpoint : BaseEndpoint +{ + // The resource base name deliberately excludes the "Core.Resources" segment: the localization factory re-roots it + // with the configured ResourcesPath, so "Lumina.Presentation.Web.Views.X" resolves to the embedded + // "Lumina.Presentation.Web.Core.Resources.Views.X" resource; including "Core" here would insert it twice. + private const string VIEW_RESOURCE_BASE_NAME = "Lumina.Presentation.Web.Views.Library.AudioLibrary.MusicLibrary.Artists.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 = "library/audio-library/music-library/artists/index"; + + private readonly IApiHttpClient _apiHttpClient; + 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 interactions with the API. + /// 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 MusicArtistsIndexViewEndpoint(IApiHttpClient apiHttpClient, IUrlService urlService, ThemePageRenderer themePageRenderer, IAntiforgery antiforgery, IStringLocalizerFactory stringLocalizerFactory) + { + _apiHttpClient = apiHttpClient; + _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.Music.ARTISTS_INDEX); + DontAutoTag(); + Options(options => options.WithTags("Music")); + } + + /// + /// Displays the music artists browsing view, rendered by the active theme with a fallback to the Razor view. + /// + /// The request containing the Id of the media library whose artists are browsed. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(GetMusicArtistsViewRequest request, CancellationToken cancellationToken) + { + if (request.LibraryId is null) + return Results.Redirect(_urlService.GetAbsoluteUrl(WebRoutes.Home.INDEX_CULTURED)!); + LibraryDto library = await _apiHttpClient.GetAsync(ApiRoutes.Libraries.GET_LIBRARY_BY_ID.Replace("{id}", request.LibraryId.Value.ToString()), cancellationToken).ConfigureAwait(false); + + // The page exposes delete actions, which submit through the form anti-forgery token, so a fresh token is issued for it. + AntiforgeryTokenSet antiforgeryTokens = _antiforgery.GetAndStoreTokens(HttpContext); + + ThemePageDto pageModel = new() + { + PageKey = VIEW_PAGE_KEY, + Title = library.Title ?? string.Empty, + Description = string.Empty, + PageData = new Dictionary + { + ["libraryId"] = library.Id?.ToString() ?? request.LibraryId.Value.ToString(), + ["antiforgeryToken"] = antiforgeryTokens.RequestToken, + ["itemsUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.GET_ARTISTS) ?? string.Empty, + ["settingsUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Settings.GET_USER_SETTINGS) ?? string.Empty, + ["artistUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.ARTIST, new { artistId = default(Guid) }) ?? string.Empty, + ["deleteUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.DELETE_ARTIST, new { artistId = default(Guid) }) ?? string.Empty, + ["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer) + } + }; + + Result sectionResult = await _themePageRenderer.RenderAsync(pageModel, requestedThemeId: null, cancellationToken).ConfigureAwait(false); + if (sectionResult.IsFailure) + return View("/Core/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.cshtml", library); + + return View( + "/Core/Views/Shared/_ThemedView.cshtml", + new ThemeViewDto(sectionResult.Value.Content, sectionResult.Value.Script), + new Dictionary { ["Title"] = pageModel.Title }); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpointSummary.cs new file mode 100644 index 00000000..6dcdfbd8 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpointSummary.cs @@ -0,0 +1,32 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using System; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.Index; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class MusicArtistsIndexViewEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public MusicArtistsIndexViewEndpointSummary() + { + Summary = "Renders the music artists browsing view."; + Description = "Renders the view for browsing the music artists of the media library identified by the query."; + + RequestParam(r => r.LibraryId, "The unique identifier of the media library whose artists are browsed. Optional."); + + ExampleRequest = new GetMusicArtistsViewRequest( + LibraryId: Guid.NewGuid() + ); + + Response(200, "The view for browsing the music artists of the media library is rendered."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpoint.cs new file mode 100644 index 00000000..bef6bff2 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpoint.cs @@ -0,0 +1,65 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +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.Library.AudioLibrary.MusicLibrary.Artists.SaveMusicArtist; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/api-save-artist route. +/// +public class SaveMusicArtistEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public SaveMusicArtistEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.PUT); + Routes(WebRoutes.Music.SAVE_ARTIST); + DontAutoTag(); + Options(options => options.WithTags("Music")); + EnableAntiforgery(); + } + + /// + /// Updates the music artist described by . + /// + /// The request containing the edited details of the artist. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(UpdateMusicArtistRequest request, CancellationToken cancellationToken) + { + // The artist is identified by the {artistId} route value, not by any id posted in the body, so that a mismatched id can never redirect + // the update to another artist; both ids are normalized to Guids before they are substituted into the upstream URL, so that a crafted + // value can never escape its URL segment, and an unparseable id is reported by the API as a missing id. + string routeArtistId = HttpContext.Request.RouteValues["artistId"]?.ToString() ?? string.Empty; + string artistId = Guid.TryParse(routeArtistId, out Guid parsedArtistId) ? parsedArtistId.ToString() : Guid.Empty.ToString(); + string queryLibraryId = HttpContext.Request.Query["libraryId"].ToString(); + string libraryId = Guid.TryParse(queryLibraryId, out Guid parsedLibraryId) ? parsedLibraryId.ToString() : Guid.Empty.ToString(); + + MusicArtistDto artist = await _apiHttpClient.PutAsync( + ApiRoutes.Music.UPDATE_ARTIST.Replace("{libraryId}", libraryId).Replace("{artistId}", artistId), request, cancellationToken).ConfigureAwait(false); + return JsonSuccess(artist); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpointSummary.cs new file mode 100644 index 00000000..96f071cc --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpointSummary.cs @@ -0,0 +1,25 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.SaveMusicArtist; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class SaveMusicArtistEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public SaveMusicArtistEndpointSummary() + { + Summary = "Updates a music artist."; + Description = "Updates the music artist identified by the route, together with the albums of the artist and the tracks of those albums."; + + Response(200, "The music artist was updated."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpoint.cs new file mode 100644 index 00000000..d1ad480c --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpoint.cs @@ -0,0 +1,85 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Common; +using Microsoft.AspNetCore.Http; +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.UpdateArtistCover; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/api-update-cover route. +/// +public class UpdateArtistCoverEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public UpdateArtistCoverEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.PUT); + Routes(WebRoutes.Music.UPDATE_ARTIST_COVER); + DontAutoTag(); + Options(options => options.WithTags("Music")); + EnableAntiforgery(); + } + + /// + /// Updates the cover image of the artist with the image uploaded in the multipart form of the request. + /// + /// The request object. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken) + { + // The endpoint takes no typed request, because its body is a multipart file, so the artist id is read from the {artistId} route value and the + // owning library from the {libraryId} query string; both are normalized to Guids before they are substituted into the upstream URL, so that a + // crafted value can never escape its URL segment, and an unparseable id is reported by the API as a missing id. A missing file is forwarded + // as a multipart form without any file, so that the upstream API reports it with its own validation error. + Guid artistId = Guid.TryParse(HttpContext.Request.RouteValues["artistId"]?.ToString(), out Guid parsedArtistId) ? parsedArtistId : Guid.Empty; + string libraryId = Guid.TryParse(HttpContext.Request.Query["libraryId"].ToString(), out Guid parsedLibraryId) ? parsedLibraryId.ToString() : Guid.Empty.ToString(); + + IFormFile? cover = null; + if (HttpContext.Request.HasFormContentType) + { + try + { + cover = HttpContext.Request.Form.Files.Count > 0 ? HttpContext.Request.Form.Files[0] : null; + } + catch (InvalidDataException) + { + cover = null; + } + } + + // The cover stream must stay open while the file is streamed to the API, and is disposed when the request completes. + Stream? coverStream = cover?.OpenReadStream(); + try + { + UpdateMusicCoverDto response = await _apiHttpClient.PutMultipartAsync( + ApiRoutes.Music.UPDATE_ARTIST_COVER.Replace("{libraryId}", libraryId).Replace("{artistId}", artistId.ToString()), coverStream, cover?.FileName, "cover", cancellationToken).ConfigureAwait(false); + return JsonSuccess(response.CoverPath); + } + finally + { + coverStream?.Dispose(); + } + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpointSummary.cs new file mode 100644 index 00000000..c1b8281b --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpointSummary.cs @@ -0,0 +1,25 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.DTO.Common; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.UpdateArtistCover; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class UpdateArtistCoverEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public UpdateArtistCoverEndpointSummary() + { + Summary = "Updates the cover image of an artist."; + Description = "Updates the cover image of the artist identified by the route, with the image uploaded in the multipart form of the request."; + + Response(200, "The relative path of the stored cover image is returned.", example: new SuccessResponse(true, default)); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpoint.cs new file mode 100644 index 00000000..5576f641 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpoint.cs @@ -0,0 +1,65 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +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.Library.AudioLibrary.MusicLibrary.Tracks.DeleteMusicTrack; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}/api-delete-track route. +/// +public class DeleteMusicTrackEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public DeleteMusicTrackEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.DELETE); + Routes(WebRoutes.Music.DELETE_TRACK); + DontAutoTag(); + Options(options => options.WithTags("Music")); + EnableAntiforgery(); + } + + /// + /// Deletes the music track identified by the route. + /// + /// The request object. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken) + { + // The track is identified by the {artistId}, {albumId} and {trackId} route values; all ids are normalized to Guids before they are substituted + // into the upstream URL, so that a crafted value can never escape its URL segment, and an unparseable id is reported by the API as a missing id. + string routeArtistId = HttpContext.Request.RouteValues["artistId"]?.ToString() ?? string.Empty; + string artistId = Guid.TryParse(routeArtistId, out Guid parsedArtistId) ? parsedArtistId.ToString() : Guid.Empty.ToString(); + string routeAlbumId = HttpContext.Request.RouteValues["albumId"]?.ToString() ?? string.Empty; + string albumId = Guid.TryParse(routeAlbumId, out Guid parsedAlbumId) ? parsedAlbumId.ToString() : Guid.Empty.ToString(); + string routeTrackId = HttpContext.Request.RouteValues["trackId"]?.ToString() ?? string.Empty; + string trackId = Guid.TryParse(routeTrackId, out Guid parsedTrackId) ? parsedTrackId.ToString() : Guid.Empty.ToString(); + string queryLibraryId = HttpContext.Request.Query["libraryId"].ToString(); + string libraryId = Guid.TryParse(queryLibraryId, out Guid parsedLibraryId) ? parsedLibraryId.ToString() : Guid.Empty.ToString(); + + await _apiHttpClient.DeleteAsync(ApiRoutes.Music.DELETE_TRACK.Replace("{libraryId}", libraryId).Replace("{artistId}", artistId).Replace("{albumId}", albumId).Replace("{trackId}", trackId), cancellationToken).ConfigureAwait(false); + return JsonSuccess(); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpointSummary.cs new file mode 100644 index 00000000..a4d49a30 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpointSummary.cs @@ -0,0 +1,24 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.DeleteMusicTrack; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class DeleteMusicTrackEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public DeleteMusicTrackEndpointSummary() + { + Summary = "Deletes a music track."; + Description = "Deletes the music track identified by the route, together with its metadata."; + + Response(200, "The music track was deleted."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/EditMusicTrack/EditMusicTrackViewEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/EditMusicTrack/EditMusicTrackViewEndpoint.cs new file mode 100644 index 00000000..6695f583 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/EditMusicTrack/EditMusicTrackViewEndpoint.cs @@ -0,0 +1,140 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Themes; +using Lumina.Presentation.Web.Common.Primitives; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +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.Http; +using Microsoft.Extensions.Localization; +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.EditMusicTrack; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId} route. +/// +public class EditMusicTrackViewEndpoint : 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.Library.AudioLibrary.MusicLibrary.Tracks.Item"; + 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 = "library/audio-library/music-library/tracks/item"; + + private static readonly JsonSerializerOptions s_camelCaseJsonOptions = new() + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + Converters = { new JsonStringEnumConverter() } + }; + + private readonly IApiHttpClient _apiHttpClient; + 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 interactions with the API. + /// 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 EditMusicTrackViewEndpoint(IApiHttpClient apiHttpClient, IUrlService urlService, ThemePageRenderer themePageRenderer, IAntiforgery antiforgery, IStringLocalizerFactory stringLocalizerFactory) + { + _apiHttpClient = apiHttpClient; + _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.Music.TRACK); + DontAutoTag(); + Options(options => options.WithTags("Music")); + } + + /// + /// Displays the music track details and editing view, rendered by the active theme with a fallback to the Razor view. + /// + /// The request containing the Ids of the artist, album, track and media library to view. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(GetMusicTrackViewRequest request, CancellationToken cancellationToken) + { + // The view needs the full details of the track to show its current values, so they are fetched from the API up front; the route + // values are normalized to Guids before they are substituted into the upstream URL, so that a crafted route value can never escape + // its URL segment, and an unparseable id is reported by the API as a missing id. + string normalizedArtistId = Guid.TryParse(request.ArtistId, out Guid parsedArtistId) ? parsedArtistId.ToString() : Guid.Empty.ToString(); + string normalizedAlbumId = Guid.TryParse(request.AlbumId, out Guid parsedAlbumId) ? parsedAlbumId.ToString() : Guid.Empty.ToString(); + string normalizedTrackId = Guid.TryParse(request.TrackId, out Guid parsedTrackId) ? parsedTrackId.ToString() : Guid.Empty.ToString(); + + MusicTrackDto track = await _apiHttpClient.GetAsync( + ApiRoutes.Music.GET_TRACK.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{artistId}", normalizedArtistId).Replace("{albumId}", normalizedAlbumId).Replace("{trackId}", normalizedTrackId), cancellationToken).ConfigureAwait(false); + string title = track.Metadata?.Title ?? string.Empty; + + // The cover shown on the left of the track page is the cover of the album that holds the track, so the album is fetched alongside the track. + MusicAlbumDto album = await _apiHttpClient.GetAsync( + ApiRoutes.Music.GET_ALBUM.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{artistId}", normalizedArtistId).Replace("{albumId}", normalizedAlbumId), cancellationToken).ConfigureAwait(false); + + // The themed view is a regular page that submits its own requests, so a fresh anti-forgery token must be issued for it. + AntiforgeryTokenSet antiforgeryTokens = _antiforgery.GetAndStoreTokens(HttpContext); + + ThemePageDto pageModel = new() + { + PageKey = VIEW_PAGE_KEY, + Title = title, + Description = string.Empty, + PageData = new Dictionary + { + ["artistId"] = normalizedArtistId, + ["albumId"] = normalizedAlbumId, + ["trackId"] = track.Id.ToString(), + ["libraryId"] = track.LibraryId.ToString(), + ["antiforgeryToken"] = antiforgeryTokens.RequestToken, + ["saveUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.SAVE_TRACK, new { artistId = default(Guid), albumId = default(Guid), trackId = default(Guid) }) ?? string.Empty, + ["deleteUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Music.DELETE_TRACK, new { artistId = default(Guid), albumId = default(Guid), trackId = default(Guid) }) ?? string.Empty, + ["backUrl"] = (_urlService.GetAbsoluteUrl(WebRoutes.Music.ALBUM, new { artistId = normalizedArtistId, albumId = track.AlbumId }) ?? string.Empty) + "?libraryId=" + track.LibraryId, + ["albumCoverPath"] = album.CoverPath ?? string.Empty, + ["trackJson"] = JsonSerializer.Serialize(track, s_camelCaseJsonOptions), + ["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer), + ["stringsJson"] = JsonSerializer.Serialize(ThemePageDataFactory.CreateLocalizedStrings(_localizer), s_camelCaseJsonOptions) + } + }; + + Result sectionResult = await _themePageRenderer.RenderAsync(pageModel, requestedThemeId: null, cancellationToken).ConfigureAwait(false); + if (sectionResult.IsFailure) + { + Dictionary viewData = new() + { + ["Title"] = title, + ["AlbumCoverPath"] = album.CoverPath ?? string.Empty + }; + return View("/Core/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.cshtml", track, viewData); + } + + 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/Library/AudioLibrary/MusicLibrary/Tracks/EditMusicTrack/EditMusicTrackViewEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/EditMusicTrack/EditMusicTrackViewEndpointSummary.cs new file mode 100644 index 00000000..fc9c26fa --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/EditMusicTrack/EditMusicTrackViewEndpointSummary.cs @@ -0,0 +1,31 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using System; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.EditMusicTrack; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class EditMusicTrackViewEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public EditMusicTrackViewEndpointSummary() + { + Summary = "Renders the music track details and editing view."; + Description = "Renders the view for displaying and editing the music track identified by the route."; + + RequestParam(r => r.ArtistId, "The unique identifier of the artist the album belongs to. Required."); + RequestParam(r => r.AlbumId, "The unique identifier of the album the track belongs to. Required."); + RequestParam(r => r.TrackId, "The unique identifier of the track to display. Required."); + RequestParam(r => r.LibraryId, "The unique identifier of the media library the track belongs to. Required."); + + Response(200, "The view for displaying and editing the music track is rendered."); + } +} 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 new file mode 100644 index 00000000..8cdc19b4 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpoint.cs @@ -0,0 +1,78 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Common; +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetAlbumTracks; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/api-get-tracks route. +/// +public class GetAlbumTracksEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public GetAlbumTracksEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.GET); + Routes(WebRoutes.Music.GET_ALBUM_TRACKS); + DontAutoTag(); + Options(options => options.WithTags("Music")); + } + + /// + /// Retrieves the lightweight details of the tracks of an album. + /// + /// The request containing the parameters used to retrieve the tracks. + /// Cancellation 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); + return JsonSuccess(response); + } + + /// + /// Builds the API endpoint used to retrieve the lightweight details of the tracks of an album. + /// + /// The request containing the parameters used to retrieve the tracks. + /// The API endpoint to which the retrieval request is sent. + private static string BuildItemsEndpoint(GetAlbumTracksLiteRequest query) + { + // The route values are normalized to Guids before they are substituted into the upstream URL, so that a crafted route value can never + // escape its URL segment, and an unparseable id is reported by the API as a missing id. + string artistId = Guid.TryParse(query.ArtistId, out Guid parsedArtistId) ? parsedArtistId.ToString() : Guid.Empty.ToString(); + string albumId = Guid.TryParse(query.AlbumId, out Guid parsedAlbumId) ? parsedAlbumId.ToString() : Guid.Empty.ToString(); + StringBuilder endpoint = new(ApiRoutes.Music.GET_ALBUM_TRACKS_LITE.Replace("{libraryId}", query.LibraryId.ToString()).Replace("{artistId}", artistId).Replace("{albumId}", albumId)); + List parameters = []; + if (query.CurrentPage is not null) + parameters.Add($"currentPage={query.CurrentPage}"); + if (query.PerPage is not null) + parameters.Add($"perPage={query.PerPage}"); + if (parameters.Count > 0) + endpoint.Append('?').Append(string.Join('&', parameters)); + return endpoint.ToString(); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointSummary.cs new file mode 100644 index 00000000..4aea7485 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointSummary.cs @@ -0,0 +1,40 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using System; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetAlbumTracks; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class GetAlbumTracksEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public GetAlbumTracksEndpointSummary() + { + Summary = "Retrieves the lightweight details of the tracks of an album."; + Description = "Retrieves the lightweight read models of the tracks of the album identified by the route."; + + RequestParam(r => r.ArtistId, "The unique identifier of the artist the album belongs to. Required."); + RequestParam(r => r.AlbumId, "The unique identifier of the album whose tracks are retrieved. Required."); + RequestParam(r => r.LibraryId, "The unique identifier of the media library the album belongs to. Required."); + RequestParam(r => r.CurrentPage, "The page of results to retrieve. Optional."); + RequestParam(r => r.PerPage, "The maximum number of tracks to retrieve per page. Optional."); + + ExampleRequest = new GetAlbumTracksLiteRequest( + ArtistId: Guid.NewGuid().ToString(), + AlbumId: Guid.NewGuid().ToString(), + LibraryId: Guid.NewGuid(), + CurrentPage: 1, + PerPage: 10 + ); + + Response(200, "The lightweight details of the tracks of the album are retrieved."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpoint.cs new file mode 100644 index 00000000..6ece0f5a --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpoint.cs @@ -0,0 +1,62 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Common; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using System; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetMusicTrack; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}/api-get-track route. +/// +public class GetMusicTrackEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public GetMusicTrackEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.GET); + Routes(WebRoutes.Music.GET_TRACK); + DontAutoTag(); + Options(options => options.WithTags("Music")); + } + + /// + /// Retrieves the full details of the music track identified by . + /// + /// The request containing the Ids of the artist, album, track and media library to retrieve. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(GetMusicTrackViewRequest request, CancellationToken cancellationToken) + { + // The route values are normalized to Guids before they are substituted into the upstream URL, so that a crafted route value can never + // escape its URL segment, and an unparseable id is reported by the API as a missing id. + string normalizedArtistId = Guid.TryParse(request.ArtistId, out Guid parsedArtistId) ? parsedArtistId.ToString() : Guid.Empty.ToString(); + string normalizedAlbumId = Guid.TryParse(request.AlbumId, out Guid parsedAlbumId) ? parsedAlbumId.ToString() : Guid.Empty.ToString(); + string normalizedTrackId = Guid.TryParse(request.TrackId, out Guid parsedTrackId) ? parsedTrackId.ToString() : Guid.Empty.ToString(); + + MusicTrackDto track = await _apiHttpClient.GetAsync( + ApiRoutes.Music.GET_TRACK.Replace("{libraryId}", request.LibraryId.ToString()).Replace("{artistId}", normalizedArtistId).Replace("{albumId}", normalizedAlbumId).Replace("{trackId}", normalizedTrackId), cancellationToken).ConfigureAwait(false); + return JsonSuccess(track); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpointSummary.cs new file mode 100644 index 00000000..c01f4d4c --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpointSummary.cs @@ -0,0 +1,31 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using System; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetMusicTrack; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class GetMusicTrackEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public GetMusicTrackEndpointSummary() + { + Summary = "Retrieves the full details of a music track."; + Description = "Retrieves the full details of the music track identified by the route."; + + RequestParam(r => r.ArtistId, "The unique identifier of the artist the album belongs to. Required."); + RequestParam(r => r.AlbumId, "The unique identifier of the album the track belongs to. Required."); + RequestParam(r => r.TrackId, "The unique identifier of the track to retrieve. Required."); + RequestParam(r => r.LibraryId, "The unique identifier of the media library the track belongs to. Required."); + + Response(200, "The full details of the music track are retrieved."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpoint.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpoint.cs new file mode 100644 index 00000000..de4fd5d8 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpoint.cs @@ -0,0 +1,69 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Common; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using System; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.SaveMusicTrack; + +/// +/// API endpoint for the /{culture}/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}/api-save-track route. +/// +public class SaveMusicTrackEndpoint : BaseEndpoint +{ + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public SaveMusicTrackEndpoint(IApiHttpClient apiHttpClient) + { + _apiHttpClient = apiHttpClient; + } + + /// + /// Configures the endpoint. + /// + public override void Configure() + { + base.Configure(); + Verbs(Http.PUT); + Routes(WebRoutes.Music.SAVE_TRACK); + DontAutoTag(); + Options(options => options.WithTags("Music")); + EnableAntiforgery(); + } + + /// + /// Updates the music track described by . + /// + /// The request containing the edited details of the track. + /// Cancellation token that can be used to stop the execution. + public override async Task ExecuteAsync(UpdateMusicTrackRequest request, CancellationToken cancellationToken) + { + // The track is identified by the {artistId}, {albumId} and {trackId} route values, not by any id posted in the body, so that a mismatched + // id can never redirect the update to another track; all ids are normalized to Guids before they are substituted into the upstream URL, so + // that a crafted value can never escape its URL segment, and an unparseable id is reported by the API as a missing id. + string routeArtistId = HttpContext.Request.RouteValues["artistId"]?.ToString() ?? string.Empty; + string artistId = Guid.TryParse(routeArtistId, out Guid parsedArtistId) ? parsedArtistId.ToString() : Guid.Empty.ToString(); + string routeAlbumId = HttpContext.Request.RouteValues["albumId"]?.ToString() ?? string.Empty; + string albumId = Guid.TryParse(routeAlbumId, out Guid parsedAlbumId) ? parsedAlbumId.ToString() : Guid.Empty.ToString(); + string routeTrackId = HttpContext.Request.RouteValues["trackId"]?.ToString() ?? string.Empty; + string trackId = Guid.TryParse(routeTrackId, out Guid parsedTrackId) ? parsedTrackId.ToString() : Guid.Empty.ToString(); + string queryLibraryId = HttpContext.Request.Query["libraryId"].ToString(); + string libraryId = Guid.TryParse(queryLibraryId, out Guid parsedLibraryId) ? parsedLibraryId.ToString() : Guid.Empty.ToString(); + + MusicTrackDto track = await _apiHttpClient.PutAsync( + ApiRoutes.Music.UPDATE_TRACK.Replace("{libraryId}", libraryId).Replace("{artistId}", artistId).Replace("{albumId}", albumId).Replace("{trackId}", trackId), request, cancellationToken).ConfigureAwait(false); + return JsonSuccess(track); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpointSummary.cs b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpointSummary.cs new file mode 100644 index 00000000..412a3198 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpointSummary.cs @@ -0,0 +1,25 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using System.Diagnostics.CodeAnalysis; +#endregion + +namespace Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.SaveMusicTrack; + +/// +/// Class used for providing a textual description for the endpoint, for OpenAPI. +/// +[ExcludeFromCodeCoverage] +public class SaveMusicTrackEndpointSummary : Summary +{ + /// + /// Initializes a new instance of the class. + /// + public SaveMusicTrackEndpointSummary() + { + Summary = "Updates a music track."; + Description = "Updates the music track identified by the route, together with its metadata."; + + Response(200, "The music track was updated."); + } +} diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ar-SA.resx new file mode 100644 index 00000000..b7449ba6 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ar-SA.resx @@ -0,0 +1,1509 @@ + + + + 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 + + + العودة إلى الفنان + + + تعديل الألبوم + + + حفظ + + + تم حفظ الألبوم. + + + تعذر حفظ العنصر. + + + حذف الألبوم + + + تم حذف الألبوم. + + + هل أنت متأكد من أنك تريد حذف هذا العنصر؟ + + + تعذر حذف العنصر. + + + معلومات عامة + + + العنوان + + + العنوان الأصلي + + + الوصف + + + إزالة الالتباس + + + الكتابة + + + حالة الإصدار + + + إجمالي الأقراص + + + إجمالي المقاطع + + + عنوان الإصدار + + + صيغة الوسائط + + + التغليف + + + الباركود + + + أرقام الكتالوج + + + الشركة + + + ASIN + + + معرّف إصدار MusicBrainz + + + معرّف مجموعة إصدار MusicBrainz + + + معرّف فنان الإصدار MusicBrainz + + + معلومات الإصدار + + + تاريخ الإصدار الأصلي + + + سنة الإصدار الأصلي + + + تاريخ إعادة الإصدار + + + سنة إعادة الإصدار + + + بلد الإصدار + + + نسخة الإصدار + + + اللغة + + + رمز اللغة + + + اسم اللغة + + + الاسم الأصلي للغة + + + اللغة الأصلية + + + الأنواع + + + الوسوم + + + أنواع الإصدار + + + المقاطع + + + لا يحتوي هذا الألبوم على مقاطع + + + إزالة + + + نسخة مقرصنة + + + ملغى + + + محذوف + + + رسمي + + + ترويجي + + + إصدار زائف + + + مسحوب + + + أسيتات 10 بوصة + + + شيلاك 10 بوصة + + + فينيل 10 بوصة + + + أسيتات 12 بوصة + + + قرص ليزر 12 بوصة + + + شيلاك 12 بوصة + + + فينيل 12 بوصة + + + فينيل 3 بوصة + + + قرص مرن 3.5 بوصة + + + قرص مرن 5.25 بوصة + + + أسيتات 7 بوصة + + + قرص فليكسي 7 بوصة + + + شيلاك 7 بوصة + + + فينيل 7 بوصة + + + قرص ليزر 8 بوصة + + + خرطوشة ثمانية مسارات + + + CD 8 سم + + + CD 8 سم زائد G + + + CD 8 سم ناقص R + + + أسيتات + + + Betacam SP + + + Betamax + + + Blu-ray + + + Blu-ray ناقص R + + + Blu Spec CD + + + خرطوشة + + + كاسيت + + + CD + + + CD زائد G + + + CD Minusi + + + CD ناقص R + + + CDV + + + CED + + + CD حماية النسخ + + + DAT + + + CD بيانات + + + DVD بيانات + + + DVD بيانات ناقص R + + + Data Play + + + DCC + + + وسائط رقمية + + + بطاقة تنزيل + + + DTSCD + + + قرص مزدوج + + + قرص مزدوج - جانب CD + + + قرص مزدوج - جانب DVD + + + قرص مزدوج - جانب صوت DVD + + + قرص مزدوج - جانب فيديو DVD + + + DVD + + + DVD صوت + + + DVD ناقص R فيديو + + + DVD فيديو + + + DVD زائد + + + DVD زائد - جانب CD + + + DVD زائد - جانب صوت DVD + + + DVD زائد - جانب فيديو DVD + + + أسطوانة إديسون الماسية + + + CD محسن + + + قرص فليكسي + + + قرص مرن + + + HDDVD + + + HDCD + + + Hi Pac + + + HQCD + + + SACD هجين + + + SACD هجين طبقة CD + + + SACD هجين طبقة SACD + + + SACD هجين طبقة SACD قناتان + + + SACD هجين طبقة SACD متعدد القنوات + + + Ki T Album + + + قرص ليزر + + + ميكروكاسيت + + + Micro SD + + + Mini Disc + + + Mini DVD + + + Mini DVD صوت + + + Mini DVD فيديو + + + Minimax CD + + + Minimax DVD + + + Minimax DVD صوت + + + Minimax DVD فيديو + + + CD الوضع المختلط + + + آخر + + + أسطوانة Pathe + + + أسطوانة فونوغراف + + + لفافة بيانو + + + زر تشغيل + + + Play Tape + + + بكرة إلى بكرة + + + خرطوشة ROM + + + SACD + + + SACD قناتان + + + SACD متعدد القنوات + + + SD Card + + + شيلاك + + + SHMCD + + + SHMSACD + + + SHMSACD متعدد القنوات + + + Slot Music + + + SVCD + + + Tefifon + + + UMD + + + قرص فلاش USB + + + VCD + + + VHD + + + VHS + + + فينيل + + + قرص فينيل + + + قرص فينيل - جانب CD + + + قرص فينيل - جانب DVD + + + قرص فينيل - جانب فينيل + + + أسطوانة شمعية + + + قرص Zip + + + كتاب + + + صندوق + + + غلاف ورقي من الكرتون + + + علبة كاسيت + + + علبة صدفية + + + Digibook + + + Digifile + + + Digipak + + + منزلق علبة الأقراص + + + علبة سميكة + + + غلاف مطوي + + + علبة جواهر + + + علبة حفظ + + + صندوق طويل + + + علبة معدنية + + + غلاف بلاستيكي + + + حزمة منزلقة + + + علبة جواهر رفيعة + + + غلاف منزلق + + + علبة بمشبك + + + حزمة بمشبك + + + علبة جواهر فائقة + + + لا شيء + + + أفغانستان + + + ألبانيا + + + الجزائر + + + أندورا + + + أنغولا + + + أنتيغوا وبربودا + + + الأرجنتين + + + أرمينيا + + + أستراليا + + + النمسا + + + أذربيجان + + + الباهاما + + + البحرين + + + بنغلاديش + + + بربادوس + + + بيلاروسيا + + + بلجيكا + + + بليز + + + بنين + + + بوتان + + + بوليفيا + + + البوسنة والهرسك + + + بوتسوانا + + + البرازيل + + + بروناي + + + بلغاريا + + + بوركينا فاسو + + + بوروندي + + + الرأس الأخضر + + + كمبوديا + + + الكاميرون + + + كندا + + + جمهورية أفريقيا الوسطى + + + تشاد + + + تشيلي + + + الصين + + + كولومبيا + + + جزر القمر + + + الكونغو - برازافيل + + + الكونغو - كينشاسا + + + كوستاريكا + + + ساحل العاج + + + كرواتيا + + + كوبا + + + قبرص + + + التشيك + + + الدنمارك + + + جيبوتي + + + دومينيكا + + + جمهورية الدومينيكان + + + الإكوادور + + + مصر + + + السلفادور + + + غينيا الاستوائية + + + إريتريا + + + إستونيا + + + إسواتيني + + + إثيوبيا + + + فيجي + + + فنلندا + + + فرنسا + + + الغابون + + + غامبيا + + + جورجيا + + + ألمانيا + + + غانا + + + اليونان + + + غرينادا + + + غواتيمالا + + + غينيا + + + غينيا بيساو + + + غيانا + + + هايتي + + + هندوراس + + + هنغاريا + + + آيسلندا + + + الهند + + + إندونيسيا + + + إيران + + + العراق + + + أيرلندا + + + إسرائيل + + + إيطاليا + + + جامايكا + + + اليابان + + + الأردن + + + كازاخستان + + + كينيا + + + كيريباتي + + + كوريا الشمالية + + + كوريا الجنوبية + + + الكويت + + + قيرغيزستان + + + لاوس + + + لاتفيا + + + لبنان + + + ليسوتو + + + ليبيريا + + + ليبيا + + + ليختنشتاين + + + ليتوانيا + + + لوكسمبورغ + + + مدغشقر + + + مالاوي + + + ماليزيا + + + المالديف + + + مالي + + + مالطا + + + جزر مارشال + + + موريتانيا + + + موريشيوس + + + المكسيك + + + ميكرونيزيا + + + مولدوفا + + + موناكو + + + منغوليا + + + الجبل الأسود + + + المغرب + + + موزمبيق + + + ميانمار (بورما) + + + ناميبيا + + + ناورو + + + نيبال + + + هولندا + + + نيوزيلندا + + + نيكاراغوا + + + النيجر + + + نيجيريا + + + مقدونيا الشمالية + + + النرويج + + + عُمان + + + باكستان + + + بالاو + + + الأراضي الفلسطينية + + + بنما + + + بابوا غينيا الجديدة + + + باراغواي + + + بيرو + + + الفلبين + + + بولندا + + + البرتغال + + + قطر + + + رومانيا + + + روسيا + + + رواندا + + + سانت كيتس ونيفيس + + + سانت لوسيا + + + سانت فينسنت والغرينادين + + + ساموا + + + سان مارينو + + + ساو تومي وبرينسيبي + + + المملكة العربية السعودية + + + السنغال + + + صربيا + + + سيشل + + + سيراليون + + + سنغافورة + + + سلوفاكيا + + + سلوفينيا + + + جزر سليمان + + + الصومال + + + جنوب أفريقيا + + + جنوب السودان + + + إسبانيا + + + سريلانكا + + + السودان + + + سورينام + + + السويد + + + سويسرا + + + سوريا + + + تايوان + + + طاجيكستان + + + تنزانيا + + + تايلاند + + + تيمور الشرقية + + + توغو + + + تونغا + + + ترينيداد وتوباغو + + + تونس + + + تركيا + + + تركمانستان + + + توفالو + + + أوغندا + + + أوكرانيا + + + الإمارات العربية المتحدة + + + المملكة المتحدة + + + الولايات المتحدة + + + أوروغواي + + + أوزبكستان + + + فانواتو + + + مدينة الفاتيكان + + + فنزويلا + + + فيتنام + + + اليمن + + + زامبيا + + + زيمبابوي + + + جزر الأنتيل الهولندية + + + أوروبا + + + العالم + + + عنوان الألبوم. + + + العنوان الأصلي للألبوم عندما يختلف عن الحالي. + + + ملخص أو وصف قصير للألبوم. + + + تعليق يميز الألبوم عن غيره ممن يحمل العنوان نفسه. + + + الكتابة المستخدمة في عنوان الإصدار. + + + حالة إصدار الألبوم. + + + عدد الأقراص في الألبوم. + + + عدد المقطوعات في الألبوم. + + + عنوان الإصدار. + + + صيغة الوسائط للألبوم. + + + تغليف الألبوم. + + + الباركود الخاص بالألبوم. + + + أرقام فهارس الألبوم. + + + الشركة التي أصدرت الألبوم. + + + رقم تعريف أمازون القياسي للألبوم. + + + معرّف MusicBrainz للإصدار. + + + معرّف MusicBrainz لمجموعة الإصدارات. + + + معرّف MusicBrainz لفنان الإصدار. + + + تاريخ الإصدار الأصلي للألبوم. + + + سنة الإصدار الأصلي للألبوم. + + + تاريخ إعادة إصدار الألبوم. + + + سنة إعادة إصدار الألبوم. + + + بلد إصدار الألبوم. + + + النسخة الصادرة، مثل النسخة الأصلية. + + + رمز اللغة المكون من حرفين للألبوم. + + + اسم لغة الألبوم. + + + الاسم الأصلي للغة الألبوم. + + + الأنواع الموسيقية الخاصة بالألبوم. + + + الوسوم الخاصة بالألبوم. + + + أنواع إصدار الألبوم. + + + مقطوعات الألبوم. + + + تغيير الغلاف + + + صورة الغلاف + + + لا يوجد غلاف + + + تم تحديث صورة الغلاف. + + + تعذّر تحميل صورة الغلاف. + + + المساهمون + + + معرّف المساهم + + + الدور + + + إضافة مساهم + + + الأشخاص الذين ساهموا في الفنان. + + + التقييمات + + + التقييم + + + أقصى تقييم + + + المصدر + + + عدد الأصوات + + + إضافة تقييم + + + تقييمات الفنان من مصادر مختلفة. + + + مؤلف + + + مترجم + + + رسام + + + ناشر + + + راوٍ + + + ممثل + + + مخرج + + + كاتب سيناريو + + + ملحن + + + كاتب كلمات + + + موزع + + + قائد أوركسترا + + + منتج + + + منتج تنفيذي + + + مهندس صوت + + + خالط صوت + + + معيد المزج + + + شركة تسجيلات + + + غناء + + + غناء مساند + + + غيتار + + + غيتار باس + + + طبول + + + إيقاع + + + لوحات المفاتيح + + + بيانو + + + مركب صوتي + + + آلات وترية + + + آلات نفخ خشبية + + + آلات نفخ نحاسية + + + جوقة + + + منسق أوركسترالي + + + مؤدٍ + + + المستخدم + + + MusicBrainz + + + Discogs + + + Last.fm + + + النوع + + + إضافة نوع + + + وسم + + + إضافة وسم + + + نوع الإصدار + + + إضافة نوع إصدار + + + رقم الكتالوج + + + إضافة رقم كتالوج + + + الغلاف + + + الواجهة + + + الظهر + + + الكتيب + + + الوسيط + + + الدرج + + + الكعب + + + أوبي + + + ملصق + + + ملصق جداري + + + ملاحظات + + + علامة مائية + + + خلفية + + + لافتة + + + شعار + + + صورة مصغرة + + + المعرّفات + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.de-DE.resx new file mode 100644 index 00000000..15e1f3f3 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.de-DE.resx @@ -0,0 +1,1509 @@ + + + + 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 + + + Zurück zum Künstler + + + Album bearbeiten + + + Speichern + + + Das Album wurde gespeichert. + + + Das Element konnte nicht gespeichert werden. + + + Album löschen + + + Das Album wurde gelöscht. + + + Möchten Sie dieses Element wirklich löschen? + + + Das Element konnte nicht gelöscht werden. + + + Allgemeine Informationen + + + Titel + + + Originaltitel + + + Beschreibung + + + Mehrdeutigkeit + + + Schrift + + + Veröffentlichungsstatus + + + Gesamtzahl der Discs + + + Gesamtzahl der Titel + + + Veröffentlichungstitel + + + Medienformat + + + Verpackung + + + Barcode + + + Katalognummern + + + Label + + + ASIN + + + MusicBrainz-Veröffentlichungs-Id + + + MusicBrainz-Veröffentlichungsgruppen-Id + + + MusicBrainz-Veröffentlichungskünstler-Id + + + Veröffentlichungsinformationen + + + Datum der Erstveröffentlichung + + + Jahr der Erstveröffentlichung + + + Datum der Neuveröffentlichung + + + Jahr der Neuveröffentlichung + + + Erscheinungsland + + + Veröffentlichungsversion + + + Sprache + + + Sprachcode + + + Sprachname + + + Muttersprachlicher Name + + + Originalsprache + + + Genres + + + Schlagwörter + + + Veröffentlichungsarten + + + Titel + + + Dieses Album hat keine Titel + + + Entfernen + + + Bootleg + + + Abgesagt + + + Gelöscht + + + Offiziell + + + Promotion + + + Pseudo-Veröffentlichung + + + Zurückgezogen + + + 10 Zoll Acetat + + + 10 Zoll Schellack + + + 10 Zoll Vinyl + + + 12 Zoll Acetat + + + 12 Zoll Laserdisc + + + 12 Zoll Schellack + + + 12 Zoll Vinyl + + + 3 Zoll Vinyl + + + 3,5 Zoll Diskette + + + 5,25 Zoll Diskette + + + 7 Zoll Acetat + + + 7 Zoll Flexi-Disc + + + 7 Zoll Schellack + + + 7 Zoll Vinyl + + + 8 Zoll Laserdisc + + + 8-Spur-Kassette + + + 8 cm CD + + + 8 cm CD Plus G + + + 8 cm CD Minus R + + + Acetat + + + Betacam SP + + + Betamax + + + Blu-ray + + + Blu-ray Minus R + + + Blu Spec CD + + + Cartridge + + + Kassette + + + CD + + + CD Plus G + + + CD Minusi + + + CD Minus R + + + CDV + + + CED + + + Copy Control CD + + + DAT + + + Daten-CD + + + Daten-DVD + + + Daten-DVD Minus R + + + Data Play + + + DCC + + + Digitale Medien + + + Download-Karte + + + DTSCD + + + Dual Disc + + + Dual Disc CD-Seite + + + Dual Disc DVD-Seite + + + Dual Disc DVD-Audioseite + + + Dual Disc DVD-Videoseite + + + DVD + + + DVD-Audio + + + DVD Minus R Video + + + DVD-Video + + + DVD Plus + + + DVD Plus CD-Seite + + + DVD Plus DVD-Audioseite + + + DVD Plus DVD-Videoseite + + + Edison Diamond Disc + + + Enhanced CD + + + Flexi-Disc + + + Diskette + + + HDDVD + + + HDCD + + + Hi Pac + + + HQCD + + + Hybrid SACD + + + Hybrid SACD CD-Schicht + + + Hybrid SACD SACD-Schicht + + + Hybrid SACD SACD-Schicht 2 Kanäle + + + Hybrid SACD SACD-Schicht Multikanal + + + Ki T Album + + + Laserdisc + + + Mikrokassette + + + MicroSD + + + MiniDisc + + + Mini DVD + + + Mini DVD-Audio + + + Mini DVD-Video + + + Minimax CD + + + Minimax DVD + + + Minimax DVD-Audio + + + Minimax DVD-Video + + + Mixed-Mode-CD + + + Sonstige + + + Pathe Disc + + + Grammophonplatte + + + Klavierrolle + + + Playbutton + + + PlayTape + + + Tonband + + + ROM-Cartridge + + + SACD + + + SACD 2 Kanäle + + + SACD Multikanal + + + SD Card + + + Schellack + + + SHMCD + + + SHMSACD + + + SHMSACD Multikanal + + + SlotMusic + + + SVCD + + + Tefifon + + + UMD + + + USB-Flash-Laufwerk + + + VCD + + + VHD + + + VHS + + + Vinyl + + + Vinyl Disc + + + Vinyl Disc CD-Seite + + + Vinyl Disc DVD-Seite + + + Vinyl Disc Vinyl-Seite + + + Wachswalze + + + Zip-Diskette + + + Buch + + + Box + + + Kartonpapierhülle + + + Kassettenhülle + + + Clamshell Case + + + Digibook + + + Digifile + + + Digipak + + + Discbox Slider + + + Fatbox + + + Gatefold-Cover + + + Jewel Case + + + Keep Case + + + Longbox + + + Metalldose + + + Plastikhülle + + + Slidepack + + + Slim Jewel Case + + + Schuber + + + Snap Case + + + Snap Pack + + + Super Jewel Box + + + Keine + + + Afghanistan + + + Albanien + + + Algerien + + + Andorra + + + Angola + + + Antigua und Barbuda + + + Argentinien + + + Armenien + + + Australien + + + Österreich + + + Aserbaidschan + + + Bahamas + + + Bahrain + + + Bangladesch + + + Barbados + + + Belarus + + + Belgien + + + Belize + + + Benin + + + Bhutan + + + Bolivien + + + Bosnien und Herzegowina + + + Botsuana + + + Brasilien + + + Brunei + + + Bulgarien + + + Burkina Faso + + + Burundi + + + Kap Verde + + + Kambodscha + + + Kamerun + + + Kanada + + + Zentralafrikanische Republik + + + Tschad + + + Chile + + + China + + + Kolumbien + + + Komoren + + + Kongo - Brazzaville + + + Kongo - Kinshasa + + + Costa Rica + + + Côte d'Ivoire + + + Kroatien + + + Kuba + + + Zypern + + + Tschechien + + + Dänemark + + + Dschibuti + + + Dominica + + + Dominikanische Republik + + + Ecuador + + + Ägypten + + + El Salvador + + + Äquatorialguinea + + + Eritrea + + + Estland + + + Eswatini + + + Äthiopien + + + Fidschi + + + Finnland + + + Frankreich + + + Gabun + + + Gambia + + + Georgien + + + Deutschland + + + Ghana + + + Griechenland + + + Grenada + + + Guatemala + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Ungarn + + + Island + + + Indien + + + Indonesien + + + Iran + + + Irak + + + Irland + + + Israel + + + Italien + + + Jamaika + + + Japan + + + Jordanien + + + Kasachstan + + + Kenia + + + Kiribati + + + Nordkorea + + + Südkorea + + + Kuwait + + + Kirgisistan + + + Laos + + + Lettland + + + Libanon + + + Lesotho + + + Liberia + + + Libyen + + + Liechtenstein + + + Litauen + + + Luxemburg + + + Madagaskar + + + Malawi + + + Malaysia + + + Malediven + + + Mali + + + Malta + + + Marshallinseln + + + Mauretanien + + + Mauritius + + + Mexiko + + + Mikronesien + + + Moldau + + + Monaco + + + Mongolei + + + Montenegro + + + Marokko + + + Mosambik + + + Myanmar (Burma) + + + Namibia + + + Nauru + + + Nepal + + + Niederlande + + + Neuseeland + + + Nicaragua + + + Niger + + + Nigeria + + + Nordmazedonien + + + Norwegen + + + Oman + + + Pakistan + + + Palau + + + Palästinensische Autonomiegebiete + + + Panama + + + Papua-Neuguinea + + + Paraguay + + + Peru + + + Philippinen + + + Polen + + + Portugal + + + Katar + + + Rumänien + + + Russland + + + Ruanda + + + St. Kitts und Nevis + + + St. Lucia + + + St. Vincent und die Grenadinen + + + Samoa + + + San Marino + + + São Tomé und Príncipe + + + Saudi-Arabien + + + Senegal + + + Serbien + + + Seychellen + + + Sierra Leone + + + Singapur + + + Slowakei + + + Slowenien + + + Salomonen + + + Somalia + + + Südafrika + + + Südsudan + + + Spanien + + + Sri Lanka + + + Sudan + + + Suriname + + + Schweden + + + Schweiz + + + Syrien + + + Taiwan + + + Tadschikistan + + + Tansania + + + Thailand + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad und Tobago + + + Tunesien + + + Türkei + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ukraine + + + Vereinigte Arabische Emirate + + + Vereinigtes Königreich + + + Vereinigte Staaten + + + Uruguay + + + Usbekistan + + + Vanuatu + + + Vatikanstadt + + + Venezuela + + + Vietnam + + + Jemen + + + Sambia + + + Simbabwe + + + Niederländische Antillen + + + Europa + + + Weltweit + + + Der Titel des Albums. + + + Der Originaltitel des Albums, wenn er vom aktuellen abweicht. + + + Eine kurze Zusammenfassung oder Beschreibung des Albums. + + + Ein Kommentar, der das Album von anderen mit demselben Titel unterscheidet. + + + Die Schrift, die im Veröffentlichungstitel verwendet wird. + + + Der Veröffentlichungsstatus des Albums. + + + Die Anzahl der Discs des Albums. + + + Die Anzahl der Titel des Albums. + + + Der Titel der Veröffentlichung. + + + Das Medienformat des Albums. + + + Die Verpackung des Albums. + + + Der Barcode des Albums. + + + Die Katalognummern des Albums. + + + Das Label, das das Album veröffentlicht hat. + + + Die Amazon Standard Identification Number des Albums. + + + Die MusicBrainz-Kennung der Veröffentlichung. + + + Die MusicBrainz-Kennung der Veröffentlichungsgruppe. + + + Die MusicBrainz-Kennung des Veröffentlichungskünstlers. + + + Das Datum, an dem das Album ursprünglich veröffentlicht wurde. + + + Das Jahr, in dem das Album ursprünglich veröffentlicht wurde. + + + Das Datum, an dem das Album erneut veröffentlicht wurde. + + + Das Jahr, in dem das Album erneut veröffentlicht wurde. + + + Das Veröffentlichungsland des Albums. + + + Die Version der Veröffentlichung, etwa die Originalversion. + + + Der zweibuchstabige Sprachcode des Albums. + + + Der Name der Sprache des Albums. + + + Der einheimische Name der Sprache des Albums. + + + Die Genres des Albums. + + + Die Tags des Albums. + + + Die Veröffentlichungstypen des Albums. + + + Die Titel des Albums. + + + Cover ändern + + + Coverbild + + + Kein Cover + + + Das Coverbild wurde aktualisiert. + + + Das Coverbild konnte nicht hochgeladen werden. + + + Mitwirkende + + + Mitwirkenden-Id + + + Rolle + + + Mitwirkenden hinzufügen + + + Die Personen, die zum Künstler beigetragen haben. + + + Bewertungen + + + Bewertung + + + Höchstbewertung + + + Quelle + + + Stimmenzahl + + + Bewertung hinzufügen + + + Die Bewertungen des Künstlers aus verschiedenen Quellen. + + + Autor + + + Übersetzer + + + Illustrator + + + Verlag + + + Erzähler + + + Schauspieler + + + Regisseur + + + Drehbuchautor + + + Komponist + + + Liedtexter + + + Arrangeur + + + Dirigent + + + Produzent + + + Ausführender Produzent + + + Toningenieur + + + Mixer + + + Remixer + + + Plattenlabel + + + Gesang + + + Hintergrundgesang + + + Gitarre + + + Bassgitarre + + + Schlagzeug + + + Perkussion + + + Keyboards + + + Klavier + + + Synthesizer + + + Streicher + + + Holzbläser + + + Blechbläser + + + Chor + + + Orchestrator + + + Interpret + + + Benutzer + + + MusicBrainz + + + Discogs + + + Last.fm + + + Genre + + + Genre hinzufügen + + + Schlagwort + + + Schlagwort hinzufügen + + + Veröffentlichungstyp + + + Veröffentlichungstyp hinzufügen + + + Katalognummer + + + Katalognummer hinzufügen + + + Cover + + + Vorderseite + + + Rückseite + + + Booklet + + + Datenträger + + + Tray + + + Rücken + + + Obi + + + Aufkleber + + + Poster + + + Beiheft + + + Wasserzeichen + + + Hintergrund + + + Banner + + + Logo + + + Miniatur + + + Kennungen + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.en-US.resx new file mode 100644 index 00000000..880ed67d --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.en-US.resx @@ -0,0 +1,1509 @@ + + + + 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 + + + Back to artist + + + Edit album + + + Save + + + The album was saved. + + + The item could not be saved. + + + Delete album + + + The album was deleted. + + + Are you sure you want to delete this item? + + + The item could not be deleted. + + + General information + + + Title + + + Original title + + + Description + + + Disambiguation + + + Script + + + Release status + + + Total discs + + + Total tracks + + + Release title + + + Media format + + + Packaging + + + Barcode + + + Catalog numbers + + + Label + + + ASIN + + + MusicBrainz release Id + + + MusicBrainz release group Id + + + MusicBrainz release artist Id + + + Release information + + + Original release date + + + Original release year + + + Re-release date + + + Re-release year + + + Release country + + + Release version + + + Language + + + Language code + + + Language name + + + Native name + + + Original language + + + Genres + + + Tags + + + Release types + + + Tracks + + + This album has no tracks + + + Remove + + + Bootleg + + + Cancelled + + + Expunged + + + Official + + + Promotion + + + Pseudo Release + + + Withdrawn + + + 10 inch Acetate + + + 10 inch Shellac + + + 10 inch Vinyl + + + 12 inch Acetate + + + 12 inch Laser Disc + + + 12 inch Shellac + + + 12 inch Vinyl + + + 3 inch Vinyl + + + 3.5 inch Floppy Disk + + + 5.25 inch Floppy Disk + + + 7 inch Acetate + + + 7 inch Flexi Disc + + + 7 inch Shellac + + + 7 inch Vinyl + + + 8 inch Laser Disc + + + Eight Track Cartridge + + + 8 cm CD + + + 8 cm CD Plus G + + + 8 cm CD Minus R + + + Acetate + + + Betacam SP + + + Betamax + + + Blu Ray + + + Blu Ray Minus R + + + Blu Spec CD + + + Cartridge + + + Cassette + + + CD + + + CD Plus G + + + CD Minusi + + + CD Minus R + + + CDV + + + CED + + + Copy Control CD + + + DAT + + + Data CD + + + Data DVD + + + Data DVD Minus R + + + Data Play + + + DCC + + + Digital Media + + + Download Card + + + DTSCD + + + Dual Disc + + + Dual Disc CD Side + + + Dual Disc DVD Side + + + Dual Disc DVD Audio Side + + + Dual Disc DVD Video Side + + + DVD + + + DVD Audio + + + DVD Minus R Video + + + DVD Video + + + DVD Plus + + + DVD Plus CD Side + + + DVD Plus DVD Audio Side + + + DVD Plus DVD Video Side + + + Edison Diamond Disc + + + Enhanced CD + + + Flexi Disc + + + Floppy Disk + + + HDDVD + + + HDCD + + + Hi Pac + + + HQCD + + + Hybrid SACD + + + Hybrid SACDCD Layer + + + Hybrid SACDSACD Layer + + + Hybrid SACDSACD Layer 2 Channels + + + Hybrid SACDSACD Layer Multichannel + + + Ki T Album + + + Laser Disc + + + Microcassette + + + Micro SD + + + Mini Disc + + + Mini DVD + + + Mini DVD Audio + + + Mini DVD Video + + + Minimax CD + + + Minimax DVD + + + Minimax DVD Audio + + + Minimax DVD Video + + + Mixed Mode CD + + + Other + + + Pathe Disc + + + Phonograph Record + + + Piano Roll + + + Playbutton + + + Play Tape + + + Reel To Reel + + + ROM Cartridge + + + SACD + + + SACD 2 Channels + + + SACD Multichannel + + + SD Card + + + Shellac + + + SHMCD + + + SHMSACD + + + SHMSACD Multichannel + + + Slot Music + + + SVCD + + + Tefifon + + + UMD + + + USB Flash Drive + + + VCD + + + VHD + + + VHS + + + Vinyl + + + Vinyl Disc + + + Vinyl Disc CD Side + + + Vinyl Disc DVD Side + + + Vinyl Disc Vinyl Side + + + Wax Cylinder + + + Zip Disk + + + Book + + + Box + + + Cardboard Paper Sleeve + + + Cassette Case + + + Clamshell Case + + + Digibook + + + Digifile + + + Digipak + + + Discbox Slider + + + Fatbox + + + Gatefold Cover + + + Jewel Case + + + Keep Case + + + Longbox + + + Metal Tin + + + Plastic Sleeve + + + Slidepack + + + Slim Jewel Case + + + Slipcase + + + Snap Case + + + Snap Pack + + + Super Jewel Box + + + None + + + Afghanistan + + + Albania + + + Algeria + + + Andorra + + + Angola + + + Antigua & Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaijan + + + Bahamas + + + Bahrain + + + Bangladesh + + + Barbados + + + Belarus + + + Belgium + + + Belize + + + Benin + + + Bhutan + + + Bolivia + + + Bosnia & Herzegovina + + + Botswana + + + Brazil + + + Brunei + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Cape Verde + + + Cambodia + + + Cameroon + + + Canada + + + Central African Republic + + + Chad + + + Chile + + + China + + + Colombia + + + Comoros + + + Congo - Brazzaville + + + Congo - Kinshasa + + + Costa Rica + + + Côte d’Ivoire + + + Croatia + + + Cuba + + + Cyprus + + + Czechia + + + Denmark + + + Djibouti + + + Dominica + + + Dominican Republic + + + Ecuador + + + Egypt + + + El Salvador + + + Equatorial Guinea + + + Eritrea + + + Estonia + + + Eswatini + + + Ethiopia + + + Fiji + + + Finland + + + France + + + Gabon + + + Gambia + + + Georgia + + + Germany + + + Ghana + + + Greece + + + Grenada + + + Guatemala + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Hungary + + + Iceland + + + India + + + Indonesia + + + Iran + + + Iraq + + + Ireland + + + Israel + + + Italy + + + Jamaica + + + Japan + + + Jordan + + + Kazakhstan + + + Kenya + + + Kiribati + + + North Korea + + + South Korea + + + Kuwait + + + Kyrgyzstan + + + Laos + + + Latvia + + + Lebanon + + + Lesotho + + + Liberia + + + Libya + + + Liechtenstein + + + Lithuania + + + Luxembourg + + + Madagascar + + + Malawi + + + Malaysia + + + Maldives + + + Mali + + + Malta + + + Marshall Islands + + + Mauritania + + + Mauritius + + + Mexico + + + Micronesia + + + Moldova + + + Monaco + + + Mongolia + + + Montenegro + + + Morocco + + + Mozambique + + + Myanmar (Burma) + + + Namibia + + + Nauru + + + Nepal + + + Netherlands + + + New Zealand + + + Nicaragua + + + Niger + + + Nigeria + + + North Macedonia + + + Norway + + + Oman + + + Pakistan + + + Palau + + + Palestinian Territories + + + Panama + + + Papua New Guinea + + + Paraguay + + + Peru + + + Philippines + + + Poland + + + Portugal + + + Qatar + + + Romania + + + Russia + + + Rwanda + + + St. Kitts & Nevis + + + St. Lucia + + + St. Vincent & Grenadines + + + Samoa + + + San Marino + + + São Tomé & Príncipe + + + Saudi Arabia + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Singapore + + + Slovakia + + + Slovenia + + + Solomon Islands + + + Somalia + + + South Africa + + + South Sudan + + + Spain + + + Sri Lanka + + + Sudan + + + Suriname + + + Sweden + + + Switzerland + + + Syria + + + Taiwan + + + Tajikistan + + + Tanzania + + + Thailand + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad & Tobago + + + Tunisia + + + Türkiye + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ukraine + + + United Arab Emirates + + + United Kingdom + + + United States + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + Vatican City + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabwe + + + Netherlands Antilles + + + Europe + + + Worldwide + + + The title of the album. + + + The original title of the album, when it differs from the current one. + + + A short summary or description of the album. + + + A comment that distinguishes the album from others with the same title. + + + The script used in the release title. + + + The release status of the album. + + + The number of discs of the album. + + + The number of tracks of the album. + + + The title of the release. + + + The media format of the album. + + + The packaging of the album. + + + The barcode of the album. + + + The catalog numbers of the album. + + + The label that released the album. + + + The Amazon Standard Identification Number of the album. + + + The MusicBrainz identifier of the release. + + + The MusicBrainz identifier of the release group. + + + The MusicBrainz identifier of the release artist. + + + The date when the album was originally released. + + + The year when the album was originally released. + + + The date when the album was released again. + + + The year when the album was released again. + + + The country of release of the album. + + + The version of the release, like the original one. + + + The two letter code of the language of the album. + + + The name of the language of the album. + + + The native name of the language of the album. + + + The genres of the album. + + + The tags of the album. + + + The release types of the album. + + + The tracks of the album. + + + Change cover + + + Cover image + + + No cover + + + The cover image was updated. + + + The cover image could not be uploaded. + + + Contributors + + + Contributor Id + + + Role + + + Add contributor + + + The people that contributed to the artist. + + + Ratings + + + Rating + + + Maximum rating + + + Source + + + Vote count + + + Add rating + + + The ratings of the artist from different sources. + + + Author + + + Translator + + + Illustrator + + + Publisher + + + Narrator + + + Actor + + + Director + + + Screenwriter + + + Composer + + + Lyricist + + + Arranger + + + Conductor + + + Producer + + + Executive Producer + + + Engineer + + + Mixer + + + Remixer + + + Record Label + + + Vocals + + + Backing Vocals + + + Guitar + + + Bass Guitar + + + Drums + + + Percussion + + + Keyboards + + + Piano + + + Synthesizer + + + Strings + + + Woodwinds + + + Brass + + + Choir + + + Orchestrator + + + Performer + + + User + + + MusicBrainz + + + Discogs + + + Last.fm + + + Genre + + + Add genre + + + Tag + + + Add tag + + + Release type + + + Add release type + + + Catalog number + + + Add catalog number + + + Cover + + + Front + + + Back + + + Booklet + + + Medium + + + Tray + + + Spine + + + Obi + + + Sticker + + + Poster + + + Liner notes + + + Watermark + + + Backdrop + + + Banner + + + Logo + + + Thumbnail + + + Identifiers + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.es-ES.resx new file mode 100644 index 00000000..1259fd1d --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.es-ES.resx @@ -0,0 +1,1509 @@ + + + + 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 + + + Volver al artista + + + Editar álbum + + + Guardar + + + El álbum se ha guardado. + + + El elemento no se ha podido guardar. + + + Eliminar álbum + + + El álbum se ha eliminado. + + + ¿Seguro que quieres eliminar este elemento? + + + El elemento no se ha podido eliminar. + + + Información general + + + Título + + + Título original + + + Descripción + + + Desambiguación + + + Escritura + + + Estado de publicación + + + Total de discos + + + Total de pistas + + + Título de la publicación + + + Formato del medio + + + Embalaje + + + Código de barras + + + Números de catálogo + + + Sello + + + ASIN + + + Id de publicación de MusicBrainz + + + Id de grupo de publicación de MusicBrainz + + + Id de artista de publicación de MusicBrainz + + + Información de publicación + + + Fecha de publicación original + + + Año de publicación original + + + Fecha de reedición + + + Año de reedición + + + País de publicación + + + Versión de publicación + + + Idioma + + + Código de idioma + + + Nombre del idioma + + + Nombre nativo + + + Idioma original + + + Géneros + + + Etiquetas + + + Tipos de publicación + + + Pistas + + + Este álbum no tiene pistas + + + Eliminar + + + Bootleg + + + Cancelado + + + Suprimido + + + Oficial + + + Promoción + + + Pseudolanzamiento + + + Retirado + + + Acetato de 10 pulgadas + + + Shellac de 10 pulgadas + + + Vinilo de 10 pulgadas + + + Acetato de 12 pulgadas + + + Laser Disc de 12 pulgadas + + + Shellac de 12 pulgadas + + + Vinilo de 12 pulgadas + + + Vinilo de 3 pulgadas + + + Disquete de 3,5 pulgadas + + + Disquete de 5,25 pulgadas + + + Acetato de 7 pulgadas + + + Flexi Disc de 7 pulgadas + + + Shellac de 7 pulgadas + + + Vinilo de 7 pulgadas + + + Laser Disc de 8 pulgadas + + + Cartucho de ocho pistas + + + CD de 8 cm + + + CD de 8 cm Plus G + + + CD de 8 cm -R + + + Acetato + + + Betacam SP + + + Betamax + + + Blu-ray + + + Blu-ray -R + + + Blu-spec CD + + + Cartucho + + + Casete + + + CD + + + CD Plus G + + + CD-i + + + CD -R + + + CDV + + + CED + + + Copy Control CD + + + DAT + + + CD de datos + + + DVD de datos + + + DVD de datos -R + + + Data Play + + + DCC + + + Medios digitales + + + Tarjeta de descarga + + + DTSCD + + + Dual Disc + + + Dual Disc cara CD + + + Dual Disc cara DVD + + + Dual Disc cara DVD Audio + + + Dual Disc cara DVD Vídeo + + + DVD + + + DVD Audio + + + DVD -R Vídeo + + + DVD Vídeo + + + DVD Plus + + + DVD Plus cara CD + + + DVD Plus cara DVD Audio + + + DVD Plus cara DVD Vídeo + + + Edison Diamond Disc + + + CD mejorado + + + Flexi Disc + + + Disquete + + + HDDVD + + + HDCD + + + Hi Pac + + + HQCD + + + SACD híbrido + + + SACD híbrido capa CD + + + SACD híbrido capa SACD + + + SACD híbrido capa SACD 2 canales + + + SACD híbrido capa SACD multicanal + + + Ki T Album + + + LaserDisc + + + Microcasete + + + MicroSD + + + MiniDisc + + + Mini DVD + + + Mini DVD Audio + + + Mini DVD Vídeo + + + Minimax CD + + + Minimax DVD + + + Minimax DVD Audio + + + Minimax DVD Vídeo + + + CD de modo mixto + + + Otro + + + Pathe Disc + + + Disco de fonógrafo + + + Rollo de piano + + + Playbutton + + + PlayTape + + + Carrete a carrete + + + Cartucho ROM + + + SACD + + + SACD 2 canales + + + SACD multicanal + + + SDCard + + + Shellac + + + SHMCD + + + SHMSACD + + + SHMSACD multicanal + + + Slot Music + + + SVCD + + + Tefifon + + + UMD + + + Unidad flash USB + + + VCD + + + VHD + + + VHS + + + Vinilo + + + Disco de vinilo + + + Disco de vinilo cara CD + + + Disco de vinilo cara DVD + + + Disco de vinilo cara de vinilo + + + Cilindro de cera + + + Zip Disk + + + Libro + + + Caja + + + Funda de cartón + + + Estuche de casete + + + Estuche de concha + + + Digibook + + + Digifile + + + Digipak + + + Caja deslizante + + + Fatbox + + + Cubierta desplegable + + + Estuche jewel + + + Estuche keep + + + Caja larga + + + Lata metálica + + + Funda de plástico + + + Estuche deslizante + + + Estuche jewel slim + + + Funda + + + Estuche de cierre + + + Estuche de cierre + + + Super jewel box + + + Ninguno + + + Afganistán + + + Albania + + + Argelia + + + Andorra + + + Angola + + + Antigua y Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaiyán + + + Bahamas + + + Baréin + + + Bangladés + + + Barbados + + + Bielorrusia + + + Bélgica + + + Belice + + + Benín + + + Bután + + + Bolivia + + + Bosnia y Herzegovina + + + Botsuana + + + Brasil + + + Brunéi + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Cabo Verde + + + Camboya + + + Camerún + + + Canadá + + + República Centroafricana + + + Chad + + + Chile + + + China + + + Colombia + + + Comoras + + + Congo - Brazzaville + + + Congo - Kinsasa + + + Costa Rica + + + Costa de Marfil + + + Croacia + + + Cuba + + + Chipre + + + Chequia + + + Dinamarca + + + Yibuti + + + Dominica + + + República Dominicana + + + Ecuador + + + Egipto + + + El Salvador + + + Guinea Ecuatorial + + + Eritrea + + + Estonia + + + Esuatini + + + Etiopía + + + Fiyi + + + Finlandia + + + Francia + + + Gabón + + + Gambia + + + Georgia + + + Alemania + + + Ghana + + + Grecia + + + Granada + + + Guatemala + + + Guinea + + + Guinea-Bisáu + + + Guyana + + + Haití + + + Honduras + + + Hungría + + + Islandia + + + India + + + Indonesia + + + Irán + + + Irak + + + Irlanda + + + Israel + + + Italia + + + Jamaica + + + Japón + + + Jordania + + + Kazajistán + + + Kenia + + + Kiribati + + + Corea del Norte + + + Corea del Sur + + + Kuwait + + + Kirguistán + + + Laos + + + Letonia + + + Líbano + + + Lesoto + + + Liberia + + + Libia + + + Liechtenstein + + + Lituania + + + Luxemburgo + + + Madagascar + + + Malaui + + + Malasia + + + Maldivas + + + Malí + + + Malta + + + Islas Marshall + + + Mauritania + + + Mauricio + + + México + + + Micronesia + + + Moldavia + + + Mónaco + + + Mongolia + + + Montenegro + + + Marruecos + + + Mozambique + + + Myanmar (Birmania) + + + Namibia + + + Nauru + + + Nepal + + + Países Bajos + + + Nueva Zelanda + + + Nicaragua + + + Níger + + + Nigeria + + + Macedonia del Norte + + + Noruega + + + Omán + + + Pakistán + + + Palaos + + + Territorios Palestinos + + + Panamá + + + Papúa Nueva Guinea + + + Paraguay + + + Perú + + + Filipinas + + + Polonia + + + Portugal + + + Catar + + + Rumanía + + + Rusia + + + Ruanda + + + San Cristóbal y Nieves + + + Santa Lucía + + + San Vicente y las Granadinas + + + Samoa + + + San Marino + + + Santo Tomé y Príncipe + + + Arabia Saudí + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leona + + + Singapur + + + Eslovaquia + + + Eslovenia + + + Islas Salomón + + + Somalia + + + Sudáfrica + + + Sudán del Sur + + + España + + + Sri Lanka + + + Sudán + + + Surinam + + + Suecia + + + Suiza + + + Siria + + + Taiwán + + + Tayikistán + + + Tanzania + + + Tailandia + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad y Tobago + + + Túnez + + + Turquía + + + Turkmenistán + + + Tuvalu + + + Uganda + + + Ucrania + + + Emiratos Árabes Unidos + + + Reino Unido + + + Estados Unidos + + + Uruguay + + + Uzbekistán + + + Vanuatu + + + Ciudad del Vaticano + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabue + + + Antillas Neerlandesas + + + Europa + + + Mundial + + + El título del álbum. + + + El título original del álbum, cuando difiere del actual. + + + Un breve resumen o descripción del álbum. + + + Un comentario que distingue el álbum de otros con el mismo título. + + + El sistema de escritura usado en el título del lanzamiento. + + + El estado de lanzamiento del álbum. + + + El número de discos del álbum. + + + El número de pistas del álbum. + + + El título del lanzamiento. + + + El formato del medio del álbum. + + + El embalaje del álbum. + + + El código de barras del álbum. + + + Los números de catálogo del álbum. + + + El sello que publicó el álbum. + + + El Amazon Standard Identification Number del álbum. + + + El identificador MusicBrainz del lanzamiento. + + + El identificador MusicBrainz del grupo de lanzamientos. + + + El identificador MusicBrainz del artista del lanzamiento. + + + La fecha en que el álbum se lanzó originalmente. + + + El año en que el álbum se lanzó originalmente. + + + La fecha en que el álbum se lanzó de nuevo. + + + El año en que el álbum se lanzó de nuevo. + + + El país de lanzamiento del álbum. + + + La versión del lanzamiento, como la original. + + + El código de dos letras del idioma del álbum. + + + El nombre del idioma del álbum. + + + El nombre nativo del idioma del álbum. + + + Los géneros del álbum. + + + Las etiquetas del álbum. + + + Los tipos de lanzamiento del álbum. + + + Las pistas del álbum. + + + Cambiar la portada + + + Imagen de portada + + + Sin portada + + + La imagen de portada se actualizó. + + + No se pudo subir la imagen de portada. + + + Colaboradores + + + Id de colaborador + + + Rol + + + Añadir colaborador + + + Las personas que contribuyeron al artista. + + + Valoraciones + + + Valoración + + + Valoración máxima + + + Fuente + + + Número de votos + + + Añadir valoración + + + Las valoraciones del artista de diferentes fuentes. + + + Autor + + + Traductor + + + Ilustrador + + + Editorial + + + Narrador + + + Actor + + + Director + + + Guionista + + + Compositor + + + Letrista + + + Arreglista + + + Director de orquesta + + + Productor + + + Productor ejecutivo + + + Ingeniero + + + Mezclador + + + Remezclador + + + Discográfica + + + Voces + + + Coros + + + Guitarra + + + Bajo + + + Batería + + + Percusión + + + Teclados + + + Piano + + + Sintetizador + + + Cuerdas + + + Viento madera + + + Metales + + + Coro + + + Orquestador + + + Intérprete + + + Usuario + + + MusicBrainz + + + Discogs + + + Last.fm + + + Género + + + Añadir género + + + Etiqueta + + + Añadir etiqueta + + + Tipo de publicación + + + Añadir tipo de publicación + + + Número de catálogo + + + Añadir número de catálogo + + + Portada + + + Frente + + + Reverso + + + Folleto + + + Soporte + + + Bandeja + + + Lomo + + + Obi + + + Pegatina + + + Póster + + + Notas + + + Marca de agua + + + Fondo + + + Banner + + + Logotipo + + + Miniatura + + + Identificadores + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.fr-FR.resx new file mode 100644 index 00000000..0b38058a --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.fr-FR.resx @@ -0,0 +1,1509 @@ + + + + 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 + + + Retour à l'artiste + + + Modifier l'album + + + Enregistrer + + + L'album a été enregistré. + + + L'élément n'a pas pu être enregistré. + + + Supprimer l'album + + + L'album a été supprimé. + + + Voulez-vous vraiment supprimer cet élément ? + + + L'élément n'a pas pu être supprimé. + + + Informations générales + + + Titre + + + Titre original + + + Description + + + Désambiguïsation + + + Écriture + + + Statut de publication + + + Nombre total de disques + + + Nombre total de pistes + + + Titre de la publication + + + Format du support + + + Conditionnement + + + Code-barres + + + Numéros de catalogue + + + Label + + + ASIN + + + Id de publication MusicBrainz + + + Id de groupe de publication MusicBrainz + + + Id d'artiste de publication MusicBrainz + + + Informations de publication + + + Date de publication originale + + + Année de publication originale + + + Date de réédition + + + Année de réédition + + + Pays de publication + + + Version de publication + + + Langue + + + Code de langue + + + Nom de la langue + + + Nom natif + + + Langue originale + + + Genres + + + Étiquettes + + + Types de publication + + + Pistes + + + Cet album ne contient aucune piste + + + Supprimer + + + Bootleg + + + Annulé + + + Supprimé + + + Officiel + + + Promotion + + + Pseudo-release + + + Retiré + + + Acétate 10 pouces + + + Shellac 10 pouces + + + Vinyle 10 pouces + + + Acétate 12 pouces + + + Laser Disc 12 pouces + + + Shellac 12 pouces + + + Vinyle 12 pouces + + + Vinyle 3 pouces + + + Disquette 3,5 pouces + + + Disquette 5,25 pouces + + + Acétate 7 pouces + + + Flexi Disc 7 pouces + + + Shellac 7 pouces + + + Vinyle 7 pouces + + + Laser Disc 8 pouces + + + Cartouche huit pistes + + + CD 8 cm + + + CD 8 cm plus G + + + CD 8 cm moins R + + + Acétate + + + Betacam SP + + + Betamax + + + Blu-ray + + + Blu-ray moins R + + + Blu Spec CD + + + Cartouche + + + Cassette + + + CD + + + CD plus G + + + CD moins i + + + CD moins R + + + CDV + + + CED + + + CD Copy Control + + + DAT + + + CD de données + + + DVD de données + + + DVD de données moins R + + + Data Play + + + DCC + + + Support numérique + + + Carte de téléchargement + + + DTSCD + + + Dual Disc + + + Dual Disc face CD + + + Dual Disc face DVD + + + Dual Disc face DVD audio + + + Dual Disc face DVD vidéo + + + DVD + + + DVD audio + + + DVD moins R vidéo + + + DVD vidéo + + + DVD Plus + + + DVD Plus face CD + + + DVD Plus face DVD audio + + + DVD Plus face DVD vidéo + + + Edison Diamond Disc + + + CD amélioré + + + Flexi Disc + + + Disquette + + + HDDVD + + + HDCD + + + Hi Pac + + + HQCD + + + Hybrid SACD + + + Hybrid SACD couche CD + + + Hybrid SACD couche SACD + + + Hybrid SACD couche SACD 2 canaux + + + Hybrid SACD couche SACD multicanal + + + Ki T Album + + + Laser Disc + + + Microcassette + + + Micro SD + + + Mini Disc + + + Mini DVD + + + Mini DVD audio + + + Mini DVD vidéo + + + Minimax CD + + + Minimax DVD + + + Minimax DVD audio + + + Minimax DVD vidéo + + + CD en mode mixte + + + Autre + + + Pathe Disc + + + Disque phonographique + + + Rouleau de piano + + + Playbutton + + + Play Tape + + + Bobine à bobine + + + Cartouche ROM + + + SACD + + + SACD 2 canaux + + + SACD multicanal + + + SD Card + + + Shellac + + + SHMCD + + + SHMSACD + + + SHMSACD multicanal + + + Slot Music + + + SVCD + + + Tefifon + + + UMD + + + Clé USB + + + VCD + + + VHD + + + VHS + + + Vinyle + + + Disque vinyle + + + Disque vinyle face CD + + + Disque vinyle face DVD + + + Disque vinyle face vinyle + + + Cylindre de cire + + + Zip Disk + + + Livre + + + Boîte + + + Pochette en carton + + + Boîtier de cassette + + + Boîtier à charnière + + + Digibook + + + Digifile + + + Digipak + + + Discbox Slider + + + Fatbox + + + Pochette dépliante + + + Boîtier cristal + + + Boîtier à clip + + + Longbox + + + Boîte métallique + + + Pochette plastique + + + Slidepack + + + Boîtier cristal fin + + + Étui + + + Boîtier à pression + + + Snap Pack + + + Super Jewel Box + + + Aucun + + + Afghanistan + + + Albanie + + + Algérie + + + Andorre + + + Angola + + + Antigua-et-Barbuda + + + Argentine + + + Arménie + + + Australie + + + Autriche + + + Azerbaïdjan + + + Bahamas + + + Bahreïn + + + Bangladesh + + + Barbade + + + Biélorussie + + + Belgique + + + Belize + + + Bénin + + + Bhoutan + + + Bolivie + + + Bosnie-Herzégovine + + + Botswana + + + Brésil + + + Brunei + + + Bulgarie + + + Burkina Faso + + + Burundi + + + Cap-Vert + + + Cambodge + + + Cameroun + + + Canada + + + République centrafricaine + + + Tchad + + + Chili + + + Chine + + + Colombie + + + Comores + + + Congo-Brazzaville + + + Congo-Kinshasa + + + Costa Rica + + + Côte d'Ivoire + + + Croatie + + + Cuba + + + Chypre + + + Tchéquie + + + Danemark + + + Djibouti + + + Dominique + + + République dominicaine + + + Équateur + + + Égypte + + + Salvador + + + Guinée équatoriale + + + Érythrée + + + Estonie + + + Eswatini + + + Éthiopie + + + Fidji + + + Finlande + + + France + + + Gabon + + + Gambie + + + Géorgie + + + Allemagne + + + Ghana + + + Grèce + + + Grenade + + + Guatemala + + + Guinée + + + Guinée-Bissau + + + Guyana + + + Haïti + + + Honduras + + + Hongrie + + + Islande + + + Inde + + + Indonésie + + + Iran + + + Irak + + + Irlande + + + Israël + + + Italie + + + Jamaïque + + + Japon + + + Jordanie + + + Kazakhstan + + + Kenya + + + Kiribati + + + Corée du Nord + + + Corée du Sud + + + Koweït + + + Kirghizstan + + + Laos + + + Lettonie + + + Liban + + + Lesotho + + + Liberia + + + Libye + + + Liechtenstein + + + Lituanie + + + Luxembourg + + + Madagascar + + + Malawi + + + Malaisie + + + Maldives + + + Mali + + + Malte + + + Îles Marshall + + + Mauritanie + + + Maurice + + + Mexique + + + Micronésie + + + Moldavie + + + Monaco + + + Mongolie + + + Monténégro + + + Maroc + + + Mozambique + + + Myanmar (Birmanie) + + + Namibie + + + Nauru + + + Népal + + + Pays-Bas + + + Nouvelle-Zélande + + + Nicaragua + + + Niger + + + Nigeria + + + Macédoine du Nord + + + Norvège + + + Oman + + + Pakistan + + + Palaos + + + Territoires palestiniens + + + Panama + + + Papouasie-Nouvelle-Guinée + + + Paraguay + + + Pérou + + + Philippines + + + Pologne + + + Portugal + + + Qatar + + + Roumanie + + + Russie + + + Rwanda + + + Saint-Christophe-et-Niévès + + + Sainte-Lucie + + + Saint-Vincent-et-les Grenadines + + + Samoa + + + Saint-Marin + + + Sao Tomé-et-Principe + + + Arabie saoudite + + + Sénégal + + + Serbie + + + Seychelles + + + Sierra Leone + + + Singapour + + + Slovaquie + + + Slovénie + + + Îles Salomon + + + Somalie + + + Afrique du Sud + + + Soudan du Sud + + + Espagne + + + Sri Lanka + + + Soudan + + + Suriname + + + Suède + + + Suisse + + + Syrie + + + Taïwan + + + Tadjikistan + + + Tanzanie + + + Thaïlande + + + Timor oriental + + + Togo + + + Tonga + + + Trinité-et-Tobago + + + Tunisie + + + Turquie + + + Turkménistan + + + Tuvalu + + + Ouganda + + + Ukraine + + + Émirats arabes unis + + + Royaume-Uni + + + États-Unis + + + Uruguay + + + Ouzbékistan + + + Vanuatu + + + État de la Cité du Vatican + + + Venezuela + + + Viêt Nam + + + Yémen + + + Zambie + + + Zimbabwe + + + Antilles néerlandaises + + + Europe + + + Monde + + + Le titre de l'album. + + + Le titre original de l'album, lorsqu'il diffère du titre actuel. + + + Un bref résumé ou une description de l'album. + + + Un commentaire qui distingue l'album des autres portant le même titre. + + + L'écriture utilisée dans le titre de la sortie. + + + Le statut de sortie de l'album. + + + Le nombre de disques de l'album. + + + Le nombre de pistes de l'album. + + + Le titre de la sortie. + + + Le format du support de l'album. + + + Le conditionnement de l'album. + + + Le code-barres de l'album. + + + Les numéros de catalogue de l'album. + + + Le label qui a publié l'album. + + + L'Amazon Standard Identification Number de l'album. + + + L'identifiant MusicBrainz de la sortie. + + + L'identifiant MusicBrainz du groupe de sorties. + + + L'identifiant MusicBrainz de l'artiste de la sortie. + + + La date à laquelle l'album a été publié à l'origine. + + + L'année à laquelle l'album a été publié à l'origine. + + + La date à laquelle l'album a été publié à nouveau. + + + L'année à laquelle l'album a été publié à nouveau. + + + Le pays de sortie de l'album. + + + La version de la sortie, comme l'originale. + + + Le code à deux lettres de la langue de l'album. + + + Le nom de la langue de l'album. + + + Le nom natif de la langue de l'album. + + + Les genres de l'album. + + + Les étiquettes de l'album. + + + Les types de sortie de l'album. + + + Les pistes de l'album. + + + Changer la couverture + + + Image de couverture + + + Aucune couverture + + + L'image de couverture a été mise à jour. + + + L'image de couverture n'a pas pu être téléversée. + + + Contributeurs + + + Id du contributeur + + + Rôle + + + Ajouter un contributeur + + + Les personnes ayant contribué à l'artiste. + + + Évaluations + + + Évaluation + + + Évaluation maximale + + + Source + + + Nombre de votes + + + Ajouter une évaluation + + + Les notes de l'artiste provenant de différentes sources. + + + Auteur + + + Traducteur + + + Illustrateur + + + Éditeur + + + Narrateur + + + Acteur + + + Réalisateur + + + Scénariste + + + Compositeur + + + Parolier + + + Arrangeur + + + Chef d'orchestre + + + Producteur + + + Producteur exécutif + + + Ingénieur du son + + + Mixeur + + + Remixeur + + + Maison de disques + + + Chant + + + Chœurs + + + Guitare + + + Guitare basse + + + Batterie + + + Percussions + + + Claviers + + + Piano + + + Synthétiseur + + + Cordes + + + Bois + + + Cuivres + + + Chœur + + + Orchestrateur + + + Interprète + + + Utilisateur + + + MusicBrainz + + + Discogs + + + Last.fm + + + Genre + + + Ajouter un genre + + + Étiquette + + + Ajouter une étiquette + + + Type de publication + + + Ajouter un type de publication + + + Numéro de catalogue + + + Ajouter un numéro de catalogue + + + Couverture + + + Recto + + + Verso + + + Livret + + + Support + + + Plateau + + + Tranche + + + Obi + + + Autocollant + + + Affiche + + + Notes + + + Filigrane + + + Arrière-plan + + + Bannière + + + Logo + + + Miniature + + + Identifiants + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.it-IT.resx new file mode 100644 index 00000000..80112399 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.it-IT.resx @@ -0,0 +1,1509 @@ + + + + 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 + + + Torna all'artista + + + Modifica album + + + Salva + + + L'album è stato salvato. + + + Non è stato possibile salvare l'elemento. + + + Elimina album + + + L'album è stato eliminato. + + + Sei sicuro di voler eliminare questo elemento? + + + Non è stato possibile eliminare l'elemento. + + + Informazioni generali + + + Titolo + + + Titolo originale + + + Descrizione + + + Disambiguazione + + + Scrittura + + + Stato di pubblicazione + + + Totale dischi + + + Totale tracce + + + Titolo della pubblicazione + + + Formato del supporto + + + Confezione + + + Codice a barre + + + Numeri di catalogo + + + Etichetta + + + ASIN + + + Id della pubblicazione MusicBrainz + + + Id del gruppo di pubblicazione MusicBrainz + + + Id dell'artista di pubblicazione MusicBrainz + + + Informazioni di pubblicazione + + + Data di pubblicazione originale + + + Anno di pubblicazione originale + + + Data di ripubblicazione + + + Anno di ripubblicazione + + + Paese di pubblicazione + + + Versione di pubblicazione + + + Lingua + + + Codice lingua + + + Nome della lingua + + + Nome nativo + + + Lingua originale + + + Generi + + + Etichette + + + Tipi di pubblicazione + + + Tracce + + + Questo album non ha tracce + + + Rimuovi + + + Bootleg + + + Cancellato + + + Espunto + + + Ufficiale + + + Promozione + + + Pseudo pubblicazione + + + Ritirato + + + Acetato da 10 pollici + + + Shellac da 10 pollici + + + Vinile da 10 pollici + + + Acetato da 12 pollici + + + Laserdisc da 12 pollici + + + Shellac da 12 pollici + + + Vinile da 12 pollici + + + Vinile da 3 pollici + + + Floppy disk da 3,5 pollici + + + Floppy disk da 5,25 pollici + + + Acetato da 7 pollici + + + Flexi Disc da 7 pollici + + + Shellac da 7 pollici + + + Vinile da 7 pollici + + + Laserdisc da 8 pollici + + + Cartuccia a otto tracce + + + CD da 8 cm + + + CD da 8 cm Plus G + + + CD-R da 8 cm + + + Acetato + + + Betacam SP + + + Betamax + + + Blu-ray + + + Blu-ray-R + + + Blu Spec CD + + + Cartuccia + + + Cassetta + + + CD + + + CD Plus G + + + CD-i + + + CD-R + + + CDV + + + CED + + + Copy Control CD + + + DAT + + + CD dati + + + DVD dati + + + Data DVD-R + + + Data Play + + + DCC + + + Supporto digitale + + + Scheda di download + + + DTSCD + + + Dual Disc + + + Dual Disc lato CD + + + Dual Disc lato DVD + + + Dual Disc lato DVD Audio + + + Dual Disc lato DVD video + + + DVD + + + DVD Audio + + + DVD-R video + + + DVD video + + + DVD Plus + + + DVD Plus lato CD + + + DVD Plus lato DVD Audio + + + DVD Plus lato DVD video + + + Edison Diamond Disc + + + CD enhanced + + + Flexi Disc + + + Floppy disk + + + HDDVD + + + HDCD + + + Hi Pac + + + HQCD + + + SACD ibrido + + + SACD ibrido strato CD + + + SACD ibrido strato SACD + + + SACD ibrido strato SACD 2 canali + + + SACD ibrido strato SACD multicanale + + + Ki T Album + + + Laserdisc + + + Microcassetta + + + Micro SD + + + MiniDisc + + + Mini DVD + + + Mini DVD Audio + + + Mini DVD video + + + Minimax CD + + + Minimax DVD + + + Minimax DVD Audio + + + Minimax DVD video + + + CD in modalità mista + + + Altro + + + Pathe Disc + + + Disco fonografico + + + Rullo per pianoforte + + + Playbutton + + + Play Tape + + + Bobina + + + Cartuccia ROM + + + SACD + + + SACD 2 canali + + + SACD multicanale + + + SD Card + + + Shellac + + + SHMCD + + + SHMSACD + + + SHMSACD multicanale + + + Slot Music + + + SVCD + + + Tefifon + + + UMD + + + Chiavetta USB + + + VCD + + + VHD + + + VHS + + + Vinile + + + Vinyl Disc + + + Vinyl Disc lato CD + + + Vinyl Disc lato DVD + + + Vinyl Disc lato vinile + + + Cilindro di cera + + + Zip Disk + + + Libro + + + Box + + + Busta in cartone + + + Custodia per cassette + + + Custodia clamshell + + + Digibook + + + Digifile + + + Digipak + + + Discbox Slider + + + Fatbox + + + Copertina gatefold + + + Custodia jewel + + + Keep case + + + Longbox + + + Lattina metallica + + + Busta in plastica + + + Slidepack + + + Custodia jewel slim + + + Slipcase + + + Custodia snap + + + Snap pack + + + Super Jewel Box + + + Nessuno + + + Afghanistan + + + Albania + + + Algeria + + + Andorra + + + Angola + + + Antigua e Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaigian + + + Bahamas + + + Bahrein + + + Bangladesh + + + Barbados + + + Bielorussia + + + Belgio + + + Belize + + + Benin + + + Bhutan + + + Bolivia + + + Bosnia ed Erzegovina + + + Botswana + + + Brasile + + + Brunei + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Capo Verde + + + Cambogia + + + Camerun + + + Canada + + + Repubblica Centrafricana + + + Ciad + + + Cile + + + Cina + + + Colombia + + + Comore + + + Congo - Brazzaville + + + Congo - Kinshasa + + + Costa Rica + + + Costa d'Avorio + + + Croazia + + + Cuba + + + Cipro + + + Cechia + + + Danimarca + + + Gibuti + + + Dominica + + + Repubblica Dominicana + + + Ecuador + + + Egitto + + + El Salvador + + + Guinea Equatoriale + + + Eritrea + + + Estonia + + + Eswatini + + + Etiopia + + + Figi + + + Finlandia + + + Francia + + + Gabon + + + Gambia + + + Georgia + + + Germania + + + Ghana + + + Grecia + + + Grenada + + + Guatemala + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Ungheria + + + Islanda + + + India + + + Indonesia + + + Iran + + + Iraq + + + Irlanda + + + Israele + + + Italia + + + Giamaica + + + Giappone + + + Giordania + + + Kazakistan + + + Kenya + + + Kiribati + + + Corea del Nord + + + Corea del Sud + + + Kuwait + + + Kirghizistan + + + Laos + + + Lettonia + + + Libano + + + Lesotho + + + Liberia + + + Libia + + + Liechtenstein + + + Lituania + + + Lussemburgo + + + Madagascar + + + Malawi + + + Malaysia + + + Maldive + + + Mali + + + Malta + + + Isole Marshall + + + Mauritania + + + Mauritius + + + Messico + + + Micronesia + + + Moldavia + + + Monaco + + + Mongolia + + + Montenegro + + + Marocco + + + Mozambico + + + Myanmar (Birmania) + + + Namibia + + + Nauru + + + Nepal + + + Paesi Bassi + + + Nuova Zelanda + + + Nicaragua + + + Niger + + + Nigeria + + + Macedonia del Nord + + + Norvegia + + + Oman + + + Pakistan + + + Palau + + + Territori palestinesi + + + Panama + + + Papua Nuova Guinea + + + Paraguay + + + Perù + + + Filippine + + + Polonia + + + Portogallo + + + Qatar + + + Romania + + + Russia + + + Ruanda + + + Saint Kitts e Nevis + + + Saint Lucia + + + Saint Vincent e Grenadine + + + Samoa + + + San Marino + + + São Tomé e Príncipe + + + Arabia Saudita + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Singapore + + + Slovacchia + + + Slovenia + + + Isole Salomone + + + Somalia + + + Sudafrica + + + Sudan del Sud + + + Spagna + + + Sri Lanka + + + Sudan + + + Suriname + + + Svezia + + + Svizzera + + + Siria + + + Taiwan + + + Tagikistan + + + Tanzania + + + Thailandia + + + Timor Est + + + Togo + + + Tonga + + + Trinidad e Tobago + + + Tunisia + + + Turchia + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ucraina + + + Emirati Arabi Uniti + + + Regno Unito + + + Stati Uniti + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + Città del Vaticano + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabwe + + + Antille Olandesi + + + Europa + + + Mondiale + + + Il titolo dell'album. + + + Il titolo originale dell'album, quando differisce da quello attuale. + + + Un breve riassunto o descrizione dell'album. + + + Un commento che distingue l'album da altri con lo stesso titolo. + + + La scrittura usata nel titolo della pubblicazione. + + + Lo stato di pubblicazione dell'album. + + + Il numero di dischi dell'album. + + + Il numero di tracce dell'album. + + + Il titolo della pubblicazione. + + + Il formato del supporto dell'album. + + + La confezione dell'album. + + + Il codice a barre dell'album. + + + I numeri di catalogo dell'album. + + + L'etichetta che ha pubblicato l'album. + + + L'Amazon Standard Identification Number dell'album. + + + L'identificatore MusicBrainz della pubblicazione. + + + L'identificatore MusicBrainz del gruppo di pubblicazioni. + + + L'identificatore MusicBrainz dell'artista della pubblicazione. + + + La data in cui l'album è stato pubblicato originariamente. + + + L'anno in cui l'album è stato pubblicato originariamente. + + + La data in cui l'album è stato ripubblicato. + + + L'anno in cui l'album è stato ripubblicato. + + + Il paese di pubblicazione dell'album. + + + La versione della pubblicazione, come quella originale. + + + Il codice di due lettere della lingua dell'album. + + + Il nome della lingua dell'album. + + + Il nome nativo della lingua dell'album. + + + I generi dell'album. + + + I tag dell'album. + + + I tipi di pubblicazione dell'album. + + + Le tracce dell'album. + + + Cambia copertina + + + Immagine di copertina + + + Nessuna copertina + + + L'immagine di copertina è stata aggiornata. + + + Impossibile caricare l'immagine di copertina. + + + Collaboratori + + + Id collaboratore + + + Ruolo + + + Aggiungi collaboratore + + + Le persone che hanno contribuito all'artista. + + + Valutazioni + + + Valutazione + + + Valutazione massima + + + Fonte + + + Numero di voti + + + Aggiungi valutazione + + + Le valutazioni dell'artista da diverse fonti. + + + Autore + + + Traduttore + + + Illustratore + + + Editore + + + Narratore + + + Attore + + + Regista + + + Sceneggiatore + + + Compositore + + + Paroliere + + + Arrangiatore + + + Direttore d'orchestra + + + Produttore + + + Produttore esecutivo + + + Tecnico del suono + + + Mixer + + + Remixer + + + Etichetta discografica + + + Voce + + + Voci di supporto + + + Chitarra + + + Basso + + + Batteria + + + Percussioni + + + Tastiere + + + Pianoforte + + + Sintetizzatore + + + Archi + + + Legni + + + Ottoni + + + Coro + + + Orchestratore + + + Esecutore + + + Utente + + + MusicBrainz + + + Discogs + + + Last.fm + + + Genere + + + Aggiungi genere + + + Etichetta + + + Aggiungi etichetta + + + Tipo di pubblicazione + + + Aggiungi tipo di pubblicazione + + + Numero di catalogo + + + Aggiungi numero di catalogo + + + Copertina + + + Fronte + + + Retro + + + Libretto + + + Supporto + + + Vassoio + + + Dorso + + + Obi + + + Adesivo + + + Poster + + + Note + + + Filigrana + + + Sfondo + + + Banner + + + Logo + + + Miniatura + + + Identificatori + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ja-JP.resx new file mode 100644 index 00000000..8dff23f1 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ja-JP.resx @@ -0,0 +1,1509 @@ + + + + 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 + + + アーティストに戻る + + + アルバムを編集 + + + 保存 + + + アルバムを保存しました。 + + + 項目を保存できませんでした。 + + + アルバムを削除 + + + アルバムを削除しました。 + + + この項目を削除してもよろしいですか? + + + 項目を削除できませんでした。 + + + 一般情報 + + + タイトル + + + 原題 + + + 説明 + + + 曖昧性の解消 + + + 文字体系 + + + リリース状態 + + + ディスク総数 + + + トラック総数 + + + リリースタイトル + + + メディア形式 + + + パッケージ + + + バーコード + + + カタログ番号 + + + レーベル + + + ASIN + + + MusicBrainz リリース Id + + + MusicBrainz リリースグループ Id + + + MusicBrainz リリースアーティスト Id + + + リリース情報 + + + 初版発売日 + + + 初版発売年 + + + 再発売日 + + + 再発売年 + + + 発売国 + + + リリース版 + + + 言語 + + + 言語コード + + + 言語名 + + + 現地語名 + + + 原語 + + + ジャンル + + + タグ + + + リリースタイプ + + + トラック + + + このアルバムにはトラックがありません + + + 削除 + + + 海賊版 + + + 中止 + + + 抹消 + + + 公式 + + + プロモーション + + + 疑似リリース + + + 撤回 + + + 10インチアセテート + + + 10インチシェラック + + + 10インチビニール + + + 12インチアセテート + + + 12インチレーザーディスク + + + 12インチシェラック + + + 12インチビニール + + + 3インチビニール + + + 3.5インチフロッピーディスク + + + 5.25インチフロッピーディスク + + + 7インチアセテート + + + 7インチフレキシディスク + + + 7インチシェラック + + + 7インチビニール + + + 8インチレーザーディスク + + + 8トラックカートリッジ + + + 8 cm CD + + + 8 cm CDプラスG + + + 8 cm CD-R + + + アセテート + + + Betacam SP + + + Betamax + + + Blu-ray + + + Blu-ray-R + + + Blu-spec CD + + + カートリッジ + + + カセット + + + CD + + + CDプラスG + + + CD-i + + + CD-R + + + CDV + + + CED + + + コピーコントロールCD + + + DAT + + + データCD + + + データDVD + + + データDVD-R + + + データプレイ + + + DCC + + + デジタルメディア + + + ダウンロードカード + + + DTSCD + + + デュアルディスク + + + デュアルディスク CD面 + + + デュアルディスク DVD面 + + + デュアルディスク DVDオーディオ面 + + + デュアルディスク DVDビデオ面 + + + DVD + + + DVDオーディオ + + + DVD-Rビデオ + + + DVDビデオ + + + DVDプラス + + + DVDプラス CD面 + + + DVDプラス DVDオーディオ面 + + + DVDプラス DVDビデオ面 + + + エジソンダイヤモンドディスク + + + エンハンストCD + + + フレキシディスク + + + フロッピーディスク + + + HDDVD + + + HDCD + + + Hi-Pac + + + HQCD + + + ハイブリッドSACD + + + ハイブリッドSACDCDレイヤー + + + ハイブリッドSACDSACDレイヤー + + + ハイブリッドSACDSACDレイヤー 2チャンネル + + + ハイブリッドSACDSACDレイヤーマルチチャンネル + + + KiT Album + + + レーザーディスク + + + マイクロカセット + + + マイクロSD + + + ミニディスク + + + ミニDVD + + + ミニDVDオーディオ + + + ミニDVDビデオ + + + Minimax CD + + + Minimax DVD + + + Minimax DVDオーディオ + + + Minimax DVDビデオ + + + ミックスモードCD + + + その他 + + + パテディスク + + + 蓄音機レコード + + + ピアノロール + + + Playbutton + + + PlayTape + + + オープンリール + + + ROMカートリッジ + + + SACD + + + SACD 2チャンネル + + + SACDマルチチャンネル + + + SDカード + + + シェラック + + + SHMCD + + + SHMSACD + + + SHMSACDマルチチャンネル + + + SlotMusic + + + SVCD + + + Tefifon + + + UMD + + + USBフラッシュドライブ + + + VCD + + + VHD + + + VHS + + + ビニール + + + ビニールディスク + + + ビニールディスク CD面 + + + ビニールディスク DVD面 + + + ビニールディスク ビニール面 + + + ワックスシリンダー + + + Zipディスク + + + ブック + + + ボックス + + + 厚紙スリーブ + + + カセットケース + + + クラムシェルケース + + + Digibook + + + Digifile + + + Digipak + + + Discbox Slider + + + Fatbox + + + ゲートフォールドカバー + + + ジュエルケース + + + キープケース + + + Longbox + + + メタル缶 + + + プラスチックスリーブ + + + Slidepack + + + スリムジュエルケース + + + スリップケース + + + スナップケース + + + スナップパック + + + スーパージュエルボックス + + + なし + + + アフガニスタン + + + アルバニア + + + アルジェリア + + + アンドラ + + + アンゴラ + + + アンティグア・バーブーダ + + + アルゼンチン + + + アルメニア + + + オーストラリア + + + オーストリア + + + アゼルバイジャン + + + バハマ + + + バーレーン + + + バングラデシュ + + + バルバドス + + + ベラルーシ + + + ベルギー + + + ベリーズ + + + ベナン + + + ブータン + + + ボリビア + + + ボスニア・ヘルツェゴビナ + + + ボツワナ + + + ブラジル + + + ブルネイ + + + ブルガリア + + + ブルキナファソ + + + ブルンジ + + + カーボベルデ + + + カンボジア + + + カメルーン + + + カナダ + + + 中央アフリカ共和国 + + + チャド + + + チリ + + + 中国 + + + コロンビア + + + コモロ + + + コンゴ共和国 + + + コンゴ民主共和国 + + + コスタリカ + + + コートジボワール + + + クロアチア + + + キューバ + + + キプロス + + + チェコ + + + デンマーク + + + ジブチ + + + ドミニカ国 + + + ドミニカ共和国 + + + エクアドル + + + エジプト + + + エルサルバドル + + + 赤道ギニア + + + エリトリア + + + エストニア + + + エスワティニ + + + エチオピア + + + フィジー + + + フィンランド + + + フランス + + + ガボン + + + ガンビア + + + ジョージア + + + ドイツ + + + ガーナ + + + ギリシャ + + + グレナダ + + + グアテマラ + + + ギニア + + + ギニアビサウ + + + ガイアナ + + + ハイチ + + + ホンジュラス + + + ハンガリー + + + アイスランド + + + インド + + + インドネシア + + + イラン + + + イラク + + + アイルランド + + + イスラエル + + + イタリア + + + ジャマイカ + + + 日本 + + + ヨルダン + + + カザフスタン + + + ケニア + + + キリバス + + + 北朝鮮 + + + 韓国 + + + クウェート + + + キルギス + + + ラオス + + + ラトビア + + + レバノン + + + レソト + + + リベリア + + + リビア + + + リヒテンシュタイン + + + リトアニア + + + ルクセンブルク + + + マダガスカル + + + マラウイ + + + マレーシア + + + モルディブ + + + マリ + + + マルタ + + + マーシャル諸島 + + + モーリタニア + + + モーリシャス + + + メキシコ + + + ミクロネシア + + + モルドバ + + + モナコ + + + モンゴル + + + モンテネグロ + + + モロッコ + + + モザンビーク + + + ミャンマー + + + ナミビア + + + ナウル + + + ネパール + + + オランダ + + + ニュージーランド + + + ニカラグア + + + ニジェール + + + ナイジェリア + + + 北マケドニア + + + ノルウェー + + + オマーン + + + パキスタン + + + パラオ + + + パレスチナ + + + パナマ + + + パプアニューギニア + + + パラグアイ + + + ペルー + + + フィリピン + + + ポーランド + + + ポルトガル + + + カタール + + + ルーマニア + + + ロシア + + + ルワンダ + + + セントクリストファー・ネービス + + + セントルシア + + + セントビンセント・グレナディーン + + + サモア + + + サンマリノ + + + サントメ・プリンシペ + + + サウジアラビア + + + セネガル + + + セルビア + + + セーシェル + + + シエラレオネ + + + シンガポール + + + スロバキア + + + スロベニア + + + ソロモン諸島 + + + ソマリア + + + 南アフリカ + + + 南スーダン + + + スペイン + + + スリランカ + + + スーダン + + + スリナム + + + スウェーデン + + + スイス + + + シリア + + + 台湾 + + + タジキスタン + + + タンザニア + + + タイ + + + 東ティモール + + + トーゴ + + + トンガ + + + トリニダード・トバゴ + + + チュニジア + + + トルコ + + + トルクメニスタン + + + ツバル + + + ウガンダ + + + ウクライナ + + + アラブ首長国連邦 + + + イギリス + + + アメリカ合衆国 + + + ウルグアイ + + + ウズベキスタン + + + バヌアツ + + + バチカン市国 + + + ベネズエラ + + + ベトナム + + + イエメン + + + ザンビア + + + ジンバブエ + + + オランダ領アンティル + + + ヨーロッパ + + + 全世界 + + + アルバムのタイトル。 + + + 現在のタイトルと異なる場合のアルバムの原題。 + + + アルバムの簡単な概要または説明。 + + + 同じタイトルの他のアルバムと区別するためのコメント。 + + + リリースタイトルで使用される文字体系。 + + + アルバムのリリース状況。 + + + アルバムのディスク数。 + + + アルバムのトラック数。 + + + リリースのタイトル。 + + + アルバムのメディア形式。 + + + アルバムのパッケージ。 + + + アルバムのバーコード。 + + + アルバムのカタログ番号。 + + + アルバムをリリースしたレーベル。 + + + アルバムのAmazon標準識別番号。 + + + リリースのMusicBrainz識別子。 + + + リリースグループのMusicBrainz識別子。 + + + リリースアーティストのMusicBrainz識別子。 + + + アルバムが最初にリリースされた日付。 + + + アルバムが最初にリリースされた年。 + + + アルバムが再リリースされた日付。 + + + アルバムが再リリースされた年。 + + + アルバムのリリース国。 + + + オリジナルなどのリリースのバージョン。 + + + アルバムの言語の2文字コード。 + + + アルバムの言語の名前。 + + + アルバムの言語の現地名。 + + + アルバムのジャンル。 + + + アルバムのタグ。 + + + アルバムのリリースタイプ。 + + + アルバムのトラック。 + + + カバーを変更 + + + カバー画像 + + + カバーなし + + + カバー画像を更新しました。 + + + カバー画像をアップロードできませんでした。 + + + 貢献者 + + + 貢献者 Id + + + 役割 + + + 貢献者を追加 + + + アーティストに貢献した人々。 + + + 評価 + + + 評価 + + + 最大評価 + + + 出典 + + + 投票数 + + + 評価を追加 + + + さまざまな情報源によるアーティストの評価。 + + + 著者 + + + 翻訳者 + + + イラストレーター + + + 出版社 + + + ナレーター + + + 俳優 + + + 監督 + + + 脚本家 + + + 作曲者 + + + 作詞者 + + + 編曲者 + + + 指揮者 + + + プロデューサー + + + エグゼクティブプロデューサー + + + エンジニア + + + ミキサー + + + リミキサー + + + レコードレーベル + + + ボーカル + + + バッキングボーカル + + + ギター + + + ベースギター + + + ドラム + + + パーカッション + + + キーボード + + + ピアノ + + + シンセサイザー + + + 弦楽器 + + + 木管楽器 + + + 金管楽器 + + + 合唱 + + + 管弦楽編曲者 + + + 演奏者 + + + ユーザー + + + MusicBrainz + + + Discogs + + + Last.fm + + + ジャンル + + + ジャンルを追加 + + + タグ + + + タグを追加 + + + リリースタイプ + + + リリースタイプを追加 + + + カタログ番号 + + + カタログ番号を追加 + + + カバー + + + 前面 + + + 背面 + + + ブックレット + + + メディア + + + トレイ + + + 背表紙 + + + 帯 + + + ステッカー + + + ポスター + + + ライナーノーツ + + + 透かし + + + 背景 + + + バナー + + + ロゴ + + + サムネイル + + + 識別子 + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.resx new file mode 100644 index 00000000..880ed67d --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.resx @@ -0,0 +1,1509 @@ + + + + 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 + + + Back to artist + + + Edit album + + + Save + + + The album was saved. + + + The item could not be saved. + + + Delete album + + + The album was deleted. + + + Are you sure you want to delete this item? + + + The item could not be deleted. + + + General information + + + Title + + + Original title + + + Description + + + Disambiguation + + + Script + + + Release status + + + Total discs + + + Total tracks + + + Release title + + + Media format + + + Packaging + + + Barcode + + + Catalog numbers + + + Label + + + ASIN + + + MusicBrainz release Id + + + MusicBrainz release group Id + + + MusicBrainz release artist Id + + + Release information + + + Original release date + + + Original release year + + + Re-release date + + + Re-release year + + + Release country + + + Release version + + + Language + + + Language code + + + Language name + + + Native name + + + Original language + + + Genres + + + Tags + + + Release types + + + Tracks + + + This album has no tracks + + + Remove + + + Bootleg + + + Cancelled + + + Expunged + + + Official + + + Promotion + + + Pseudo Release + + + Withdrawn + + + 10 inch Acetate + + + 10 inch Shellac + + + 10 inch Vinyl + + + 12 inch Acetate + + + 12 inch Laser Disc + + + 12 inch Shellac + + + 12 inch Vinyl + + + 3 inch Vinyl + + + 3.5 inch Floppy Disk + + + 5.25 inch Floppy Disk + + + 7 inch Acetate + + + 7 inch Flexi Disc + + + 7 inch Shellac + + + 7 inch Vinyl + + + 8 inch Laser Disc + + + Eight Track Cartridge + + + 8 cm CD + + + 8 cm CD Plus G + + + 8 cm CD Minus R + + + Acetate + + + Betacam SP + + + Betamax + + + Blu Ray + + + Blu Ray Minus R + + + Blu Spec CD + + + Cartridge + + + Cassette + + + CD + + + CD Plus G + + + CD Minusi + + + CD Minus R + + + CDV + + + CED + + + Copy Control CD + + + DAT + + + Data CD + + + Data DVD + + + Data DVD Minus R + + + Data Play + + + DCC + + + Digital Media + + + Download Card + + + DTSCD + + + Dual Disc + + + Dual Disc CD Side + + + Dual Disc DVD Side + + + Dual Disc DVD Audio Side + + + Dual Disc DVD Video Side + + + DVD + + + DVD Audio + + + DVD Minus R Video + + + DVD Video + + + DVD Plus + + + DVD Plus CD Side + + + DVD Plus DVD Audio Side + + + DVD Plus DVD Video Side + + + Edison Diamond Disc + + + Enhanced CD + + + Flexi Disc + + + Floppy Disk + + + HDDVD + + + HDCD + + + Hi Pac + + + HQCD + + + Hybrid SACD + + + Hybrid SACDCD Layer + + + Hybrid SACDSACD Layer + + + Hybrid SACDSACD Layer 2 Channels + + + Hybrid SACDSACD Layer Multichannel + + + Ki T Album + + + Laser Disc + + + Microcassette + + + Micro SD + + + Mini Disc + + + Mini DVD + + + Mini DVD Audio + + + Mini DVD Video + + + Minimax CD + + + Minimax DVD + + + Minimax DVD Audio + + + Minimax DVD Video + + + Mixed Mode CD + + + Other + + + Pathe Disc + + + Phonograph Record + + + Piano Roll + + + Playbutton + + + Play Tape + + + Reel To Reel + + + ROM Cartridge + + + SACD + + + SACD 2 Channels + + + SACD Multichannel + + + SD Card + + + Shellac + + + SHMCD + + + SHMSACD + + + SHMSACD Multichannel + + + Slot Music + + + SVCD + + + Tefifon + + + UMD + + + USB Flash Drive + + + VCD + + + VHD + + + VHS + + + Vinyl + + + Vinyl Disc + + + Vinyl Disc CD Side + + + Vinyl Disc DVD Side + + + Vinyl Disc Vinyl Side + + + Wax Cylinder + + + Zip Disk + + + Book + + + Box + + + Cardboard Paper Sleeve + + + Cassette Case + + + Clamshell Case + + + Digibook + + + Digifile + + + Digipak + + + Discbox Slider + + + Fatbox + + + Gatefold Cover + + + Jewel Case + + + Keep Case + + + Longbox + + + Metal Tin + + + Plastic Sleeve + + + Slidepack + + + Slim Jewel Case + + + Slipcase + + + Snap Case + + + Snap Pack + + + Super Jewel Box + + + None + + + Afghanistan + + + Albania + + + Algeria + + + Andorra + + + Angola + + + Antigua & Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaijan + + + Bahamas + + + Bahrain + + + Bangladesh + + + Barbados + + + Belarus + + + Belgium + + + Belize + + + Benin + + + Bhutan + + + Bolivia + + + Bosnia & Herzegovina + + + Botswana + + + Brazil + + + Brunei + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Cape Verde + + + Cambodia + + + Cameroon + + + Canada + + + Central African Republic + + + Chad + + + Chile + + + China + + + Colombia + + + Comoros + + + Congo - Brazzaville + + + Congo - Kinshasa + + + Costa Rica + + + Côte d’Ivoire + + + Croatia + + + Cuba + + + Cyprus + + + Czechia + + + Denmark + + + Djibouti + + + Dominica + + + Dominican Republic + + + Ecuador + + + Egypt + + + El Salvador + + + Equatorial Guinea + + + Eritrea + + + Estonia + + + Eswatini + + + Ethiopia + + + Fiji + + + Finland + + + France + + + Gabon + + + Gambia + + + Georgia + + + Germany + + + Ghana + + + Greece + + + Grenada + + + Guatemala + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Hungary + + + Iceland + + + India + + + Indonesia + + + Iran + + + Iraq + + + Ireland + + + Israel + + + Italy + + + Jamaica + + + Japan + + + Jordan + + + Kazakhstan + + + Kenya + + + Kiribati + + + North Korea + + + South Korea + + + Kuwait + + + Kyrgyzstan + + + Laos + + + Latvia + + + Lebanon + + + Lesotho + + + Liberia + + + Libya + + + Liechtenstein + + + Lithuania + + + Luxembourg + + + Madagascar + + + Malawi + + + Malaysia + + + Maldives + + + Mali + + + Malta + + + Marshall Islands + + + Mauritania + + + Mauritius + + + Mexico + + + Micronesia + + + Moldova + + + Monaco + + + Mongolia + + + Montenegro + + + Morocco + + + Mozambique + + + Myanmar (Burma) + + + Namibia + + + Nauru + + + Nepal + + + Netherlands + + + New Zealand + + + Nicaragua + + + Niger + + + Nigeria + + + North Macedonia + + + Norway + + + Oman + + + Pakistan + + + Palau + + + Palestinian Territories + + + Panama + + + Papua New Guinea + + + Paraguay + + + Peru + + + Philippines + + + Poland + + + Portugal + + + Qatar + + + Romania + + + Russia + + + Rwanda + + + St. Kitts & Nevis + + + St. Lucia + + + St. Vincent & Grenadines + + + Samoa + + + San Marino + + + São Tomé & Príncipe + + + Saudi Arabia + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Singapore + + + Slovakia + + + Slovenia + + + Solomon Islands + + + Somalia + + + South Africa + + + South Sudan + + + Spain + + + Sri Lanka + + + Sudan + + + Suriname + + + Sweden + + + Switzerland + + + Syria + + + Taiwan + + + Tajikistan + + + Tanzania + + + Thailand + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad & Tobago + + + Tunisia + + + Türkiye + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ukraine + + + United Arab Emirates + + + United Kingdom + + + United States + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + Vatican City + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabwe + + + Netherlands Antilles + + + Europe + + + Worldwide + + + The title of the album. + + + The original title of the album, when it differs from the current one. + + + A short summary or description of the album. + + + A comment that distinguishes the album from others with the same title. + + + The script used in the release title. + + + The release status of the album. + + + The number of discs of the album. + + + The number of tracks of the album. + + + The title of the release. + + + The media format of the album. + + + The packaging of the album. + + + The barcode of the album. + + + The catalog numbers of the album. + + + The label that released the album. + + + The Amazon Standard Identification Number of the album. + + + The MusicBrainz identifier of the release. + + + The MusicBrainz identifier of the release group. + + + The MusicBrainz identifier of the release artist. + + + The date when the album was originally released. + + + The year when the album was originally released. + + + The date when the album was released again. + + + The year when the album was released again. + + + The country of release of the album. + + + The version of the release, like the original one. + + + The two letter code of the language of the album. + + + The name of the language of the album. + + + The native name of the language of the album. + + + The genres of the album. + + + The tags of the album. + + + The release types of the album. + + + The tracks of the album. + + + Change cover + + + Cover image + + + No cover + + + The cover image was updated. + + + The cover image could not be uploaded. + + + Contributors + + + Contributor Id + + + Role + + + Add contributor + + + The people that contributed to the artist. + + + Ratings + + + Rating + + + Maximum rating + + + Source + + + Vote count + + + Add rating + + + The ratings of the artist from different sources. + + + Author + + + Translator + + + Illustrator + + + Publisher + + + Narrator + + + Actor + + + Director + + + Screenwriter + + + Composer + + + Lyricist + + + Arranger + + + Conductor + + + Producer + + + Executive Producer + + + Engineer + + + Mixer + + + Remixer + + + Record Label + + + Vocals + + + Backing Vocals + + + Guitar + + + Bass Guitar + + + Drums + + + Percussion + + + Keyboards + + + Piano + + + Synthesizer + + + Strings + + + Woodwinds + + + Brass + + + Choir + + + Orchestrator + + + Performer + + + User + + + MusicBrainz + + + Discogs + + + Last.fm + + + Genre + + + Add genre + + + Tag + + + Add tag + + + Release type + + + Add release type + + + Catalog number + + + Add catalog number + + + Cover + + + Front + + + Back + + + Booklet + + + Medium + + + Tray + + + Spine + + + Obi + + + Sticker + + + Poster + + + Liner notes + + + Watermark + + + Backdrop + + + Banner + + + Logo + + + Thumbnail + + + Identifiers + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ro-RO.resx new file mode 100644 index 00000000..68b6915d --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.ro-RO.resx @@ -0,0 +1,1509 @@ + + + + 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 + + + Înapoi la artist + + + Editează albumul + + + Salvează + + + Albumul a fost salvat. + + + Elementul nu a putut fi salvat. + + + Șterge albumul + + + Albumul a fost șters. + + + Sigur doriți să ștergeți acest element? + + + Elementul nu a putut fi șters. + + + Informații generale + + + Titlu + + + Titlu original + + + Descriere + + + Dezambiguizare + + + Scriere + + + Starea lansării + + + Total discuri + + + Total piese + + + Titlul lansării + + + Format media + + + Ambalare + + + Cod de bare + + + Numere de catalog + + + Casă de discuri + + + ASIN + + + Id lansare MusicBrainz + + + Id grup lansare MusicBrainz + + + Id artist lansare MusicBrainz + + + Informații de lansare + + + Data lansării originale + + + Anul lansării originale + + + Data relansării + + + Anul relansării + + + Țara de lansare + + + Versiunea lansării + + + Limbă + + + Codul limbii + + + Denumirea limbii + + + Denumire nativă + + + Limba originală + + + Genuri + + + Etichete + + + Tipuri de lansare + + + Piese + + + Acest album nu are piese + + + Elimină + + + Bootleg + + + Anulat + + + Eliminat + + + Oficial + + + Promoție + + + Pseudo-lansare + + + Retras + + + Acetat de 10 inch + + + Șelac de 10 inch + + + Vinil de 10 inch + + + Acetat de 12 inch + + + Disc laser de 12 inch + + + Șelac de 12 inch + + + Vinil de 12 inch + + + Vinil de 3 inch + + + Dischetă de 3,5 inch + + + Dischetă de 5,25 inch + + + Acetat de 7 inch + + + Flexi Disc de 7 inch + + + Șelac de 7 inch + + + Vinil de 7 inch + + + Disc laser de 8 inch + + + Cartuș cu opt piste + + + CD de 8 cm + + + CD de 8 cm Plus G + + + CD de 8 cm Minus R + + + Acetat + + + Betacam SP + + + Betamax + + + Blu-ray + + + Blu-ray Minus R + + + Blu Spec CD + + + Cartuș + + + Casetă + + + CD + + + CD Plus G + + + CD Minusi + + + CD Minus R + + + CDV + + + CED + + + CD Copy Control + + + DAT + + + CD de date + + + DVD de date + + + Date DVD Minus R + + + Data Play + + + DCC + + + Media digitală + + + Card de descărcare + + + DTSCD + + + Dual Disc + + + Dual Disc partea CD + + + Dual Disc partea DVD + + + Dual Disc partea DVD Audio + + + Dual Disc partea DVD Video + + + DVD + + + DVD Audio + + + DVD Minus R Video + + + DVD Video + + + DVD Plus + + + DVD Plus partea CD + + + DVD Plus partea DVD Audio + + + DVD Plus partea DVD Video + + + Edison Diamond Disc + + + CD îmbunătățit + + + Flexi Disc + + + Dischetă + + + HDDVD + + + HDCD + + + Hi Pac + + + HQCD + + + SACD hibrid + + + SACD hibrid strat CD + + + SACD hibrid strat SACD + + + SACD hibrid strat SACD 2 canale + + + SACD hibrid strat SACD multicanal + + + Ki T Album + + + Disc laser + + + Microcasetă + + + Micro SD + + + Mini Disc + + + Mini DVD + + + Mini DVD Audio + + + Mini DVD Video + + + CD Minimax + + + DVD Minimax + + + DVD Audio Minimax + + + DVD Video Minimax + + + CD cu mod mixt + + + Altele + + + Pathe Disc + + + Disc de fonograf + + + Rulou de pian + + + Playbutton + + + Play Tape + + + Bandă pe rolă + + + Cartuș ROM + + + SACD + + + SACD 2 canale + + + SACD multicanal + + + Card SD + + + Șelac + + + SHMCD + + + SHMSACD + + + SHMSACD multicanal + + + Slot Music + + + SVCD + + + Tefifon + + + UMD + + + Unitate flash USB + + + VCD + + + VHD + + + VHS + + + Vinil + + + Disc vinil + + + Disc vinil partea CD + + + Disc vinil partea DVD + + + Disc vinil partea vinil + + + Cilindru de ceară + + + Disc Zip + + + Carte + + + Cutie + + + Buzunar din carton + + + Carcasă de casetă + + + Carcasă clamshell + + + Digibook + + + Digifile + + + Digipak + + + Discbox Slider + + + Fatbox + + + Copertă gatefold + + + Carcasă jewel + + + Carcasă keep + + + Longbox + + + Cutie metalică + + + Buzunar de plastic + + + Slidepack + + + Carcasă jewel subțire + + + Carcasă glisantă + + + Carcasă snap + + + Ambalaj snap + + + Super Jewel Box + + + Niciunul + + + Afganistan + + + Albania + + + Algeria + + + Andorra + + + Angola + + + Antigua și Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaidjan + + + Bahamas + + + Bahrain + + + Bangladesh + + + Barbados + + + Belarus + + + Belgia + + + Belize + + + Benin + + + Bhutan + + + Bolivia + + + Bosnia și Herțegovina + + + Botswana + + + Brazilia + + + Brunei + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Capul Verde + + + Cambodgia + + + Camerun + + + Canada + + + Republica Centrafricană + + + Ciad + + + Chile + + + China + + + Columbia + + + Comore + + + Congo - Brazzaville + + + Congo - Kinshasa + + + Costa Rica + + + Coasta de Fildeș + + + Croația + + + Cuba + + + Cipru + + + Cehia + + + Danemarca + + + Djibouti + + + Dominica + + + Republica Dominicană + + + Ecuador + + + Egipt + + + El Salvador + + + Guineea Ecuatorială + + + Eritreea + + + Estonia + + + Eswatini + + + Etiopia + + + Fiji + + + Finlanda + + + Franța + + + Gabon + + + Gambia + + + Georgia + + + Germania + + + Ghana + + + Grecia + + + Grenada + + + Guatemala + + + Guineea + + + Guineea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Ungaria + + + Islanda + + + India + + + Indonezia + + + Iran + + + Irak + + + Irlanda + + + Israel + + + Italia + + + Jamaica + + + Japonia + + + Iordania + + + Kazahstan + + + Kenya + + + Kiribati + + + Coreea de Nord + + + Coreea de Sud + + + Kuweit + + + Kârgâzstan + + + Laos + + + Letonia + + + Liban + + + Lesotho + + + Liberia + + + Libia + + + Liechtenstein + + + Lituania + + + Luxemburg + + + Madagascar + + + Malawi + + + Malaysia + + + Maldive + + + Mali + + + Malta + + + Insulele Marshall + + + Mauritania + + + Mauritius + + + Mexic + + + Micronezia + + + Moldova + + + Monaco + + + Mongolia + + + Muntenegru + + + Maroc + + + Mozambic + + + Myanmar (Birmania) + + + Namibia + + + Nauru + + + Nepal + + + Țările de Jos + + + Noua Zeelandă + + + Nicaragua + + + Niger + + + Nigeria + + + Macedonia de Nord + + + Norvegia + + + Oman + + + Pakistan + + + Palau + + + Teritoriile Palestiniene + + + Panama + + + Papua Noua Guinee + + + Paraguay + + + Peru + + + Filipine + + + Polonia + + + Portugalia + + + Qatar + + + România + + + Rusia + + + Rwanda + + + Saint Kitts și Nevis + + + Sfânta Lucia + + + Saint Vincent și Grenadine + + + Samoa + + + San Marino + + + São Tomé și Príncipe + + + Arabia Saudită + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Singapore + + + Slovacia + + + Slovenia + + + Insulele Solomon + + + Somalia + + + Africa de Sud + + + Sudanul de Sud + + + Spania + + + Sri Lanka + + + Sudan + + + Suriname + + + Suedia + + + Elveția + + + Siria + + + Taiwan + + + Tadjikistan + + + Tanzania + + + Thailanda + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad și Tobago + + + Tunisia + + + Turcia + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ucraina + + + Emiratele Arabe Unite + + + Regatul Unit + + + Statele Unite + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + Vatican + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabwe + + + Antilele Neerlandeze + + + Europa + + + La nivel mondial + + + Titlul albumului. + + + Titlul original al albumului, când diferă de cel actual. + + + Un scurt rezumat sau o descriere a albumului. + + + Un comentariu care distinge albumul de altele cu același titlu. + + + Scrierea folosită în titlul lansării. + + + Starea de lansare a albumului. + + + Numărul de discuri ale albumului. + + + Numărul de piese ale albumului. + + + Titlul lansării. + + + Formatul media al albumului. + + + Ambalajul albumului. + + + Codul de bare al albumului. + + + Numerele de catalog ale albumului. + + + Casa de discuri care a lansat albumul. + + + Numărul standard de identificare Amazon al albumului. + + + Identificatorul MusicBrainz al lansării. + + + Identificatorul MusicBrainz al grupului de lansări. + + + Identificatorul MusicBrainz al artistului lansării. + + + Data la care albumul a fost lansat inițial. + + + Anul în care albumul a fost lansat inițial. + + + Data la care albumul a fost relansat. + + + Anul în care albumul a fost relansat. + + + Țara de lansare a albumului. + + + Versiunea lansării, cum ar fi cea originală. + + + Codul din două litere al limbii albumului. + + + Numele limbii albumului. + + + Numele nativ al limbii albumului. + + + Genurile albumului. + + + Etichetele albumului. + + + Tipurile de lansare ale albumului. + + + Piesele albumului. + + + Schimbă coperta + + + Imagine de copertă + + + Fără copertă + + + Imaginea de copertă a fost actualizată. + + + Imaginea de copertă nu a putut fi încărcată. + + + Contribuitori + + + Id contribuitor + + + Rol + + + Adaugă contributor + + + Persoanele care au contribuit la artist. + + + Ratinguri + + + Rating + + + Rating maxim + + + Sursă + + + Număr de voturi + + + Adaugă rating + + + Evaluările artistului din surse diferite. + + + Autor + + + Traducător + + + Ilustrator + + + Editor + + + Narator + + + Actor + + + Regizor + + + Scenarist + + + Compozitor + + + Textier + + + Aranjor + + + Dirijor + + + Producător + + + Producător executiv + + + Inginer de sunet + + + Mixer + + + Remixer + + + Casă de discuri + + + Voce + + + Voci de acompaniament + + + Chitară + + + Chitară bas + + + Tobe + + + Percuție + + + Claviaturi + + + Pian + + + Sintetizator + + + Instrumente cu corzi + + + Instrumente de suflat din lemn + + + Instrumente de suflat din alamă + + + Cor + + + Orchestrator + + + Interpret + + + Utilizator + + + MusicBrainz + + + Discogs + + + Last.fm + + + Gen + + + Adaugă gen + + + Etichetă + + + Adaugă etichetă + + + Tip de lansare + + + Adaugă tip de lansare + + + Număr de catalog + + + Adaugă număr de catalog + + + Copertă + + + Față + + + Spate + + + Broșură + + + Suport + + + Tavă + + + Cotă + + + Obi + + + Autocolant + + + Poster + + + Note + + + Filigran + + + Fundal + + + Banner + + + Logo + + + Miniatură + + + Identificatori + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.uk-UA.resx new file mode 100644 index 00000000..45d369f7 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.uk-UA.resx @@ -0,0 +1,1509 @@ + + + + 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 + + + Назад до виконавця + + + Редагувати альбом + + + Зберегти + + + Альбом збережено. + + + Не вдалося зберегти елемент. + + + Видалити альбом + + + Альбом видалено. + + + Ви впевнені, що хочете видалити цей елемент? + + + Не вдалося видалити елемент. + + + Загальна інформація + + + Назва + + + Оригінальна назва + + + Опис + + + Уточнення + + + Письмо + + + Статус випуску + + + Усього дисків + + + Усього треків + + + Назва випуску + + + Формат носія + + + Пакування + + + Штрихкод + + + Номери каталогу + + + Лейбл + + + ASIN + + + Ідентифікатор випуску MusicBrainz + + + Ідентифікатор групи випуску MusicBrainz + + + Ідентифікатор виконавця випуску MusicBrainz + + + Інформація про випуск + + + Дата першого випуску + + + Рік першого випуску + + + Дата перевипуску + + + Рік перевипуску + + + Країна випуску + + + Версія випуску + + + Мова + + + Код мови + + + Назва мови + + + Власна назва + + + Оригінальна мова + + + Жанри + + + Теги + + + Типи випуску + + + Треки + + + Цей альбом не має треків + + + Видалити + + + Бутлег + + + Скасовано + + + Вилучено + + + Офіційний + + + Промо + + + Псевдовидання + + + Відкликано + + + Ацетат 10 дюймів + + + Шелак 10 дюймів + + + Вініл 10 дюймів + + + Ацетат 12 дюймів + + + Лазерний диск 12 дюймів + + + Шелак 12 дюймів + + + Вініл 12 дюймів + + + Вініл 3 дюйми + + + Флопі-диск 3,5 дюйма + + + Флопі-диск 5,25 дюйма + + + Ацетат 7 дюймів + + + Флексі-диск 7 дюймів + + + Шелак 7 дюймів + + + Вініл 7 дюймів + + + Лазерний диск 8 дюймів + + + Восьмидоріжкова касета + + + CD 8 см + + + CD 8 см Plus G + + + CD-R 8 см + + + Ацетат + + + Betacam SP + + + Betamax + + + Blu-ray + + + Blu-ray-R + + + Blu-spec CD + + + Картридж + + + Касета + + + CD + + + CD Plus G + + + CD-i + + + CD-R + + + CDV + + + CED + + + Copy Control CD + + + DAT + + + CD з даними + + + DVD з даними + + + DVD-R з даними + + + Data Play + + + DCC + + + Цифровий носій + + + Картка завантаження + + + DTSCD + + + Dual Disc + + + Dual Disc, сторона CD + + + Dual Disc, сторона DVD + + + Dual Disc, сторона DVD-аудіо + + + Dual Disc, сторона DVD-відео + + + DVD + + + DVD-аудіо + + + DVD-R відео + + + DVD-відео + + + DVD Plus + + + DVD Plus, сторона CD + + + DVD Plus, сторона DVD-аудіо + + + DVD Plus, сторона DVD-відео + + + Edison Diamond Disc + + + Розширений CD + + + Флексі-диск + + + Флопі-диск + + + HDDVD + + + HDCD + + + Hi Pac + + + HQCD + + + Гібридний SACD + + + Гібридний SACD, шар CD + + + Гібридний SACD, шар SACD + + + Гібридний SACD, шар SACD, 2 канали + + + Гібридний SACD, шар SACD, багатоканальний + + + Ki T Album + + + Лазерний диск + + + Мікрокасета + + + MicroSD + + + Мінідиск + + + Міні DVD + + + Міні DVD-аудіо + + + Міні DVD-відео + + + Minimax CD + + + Minimax DVD + + + Minimax DVD-аудіо + + + Minimax DVD-відео + + + CD змішаного режиму + + + Інше + + + Pathe Disc + + + Грамофонна платівка + + + Ролик піаноли + + + Playbutton + + + PlayTape + + + Котушкова стрічка + + + ROM-картридж + + + SACD + + + SACD, 2 канали + + + SACD багатоканальний + + + SD-карта + + + Шелак + + + SHMCD + + + SHMSACD + + + SHMSACD багатоканальний + + + SlotMusic + + + SVCD + + + Tefifon + + + UMD + + + USB-флешка + + + VCD + + + VHD + + + VHS + + + Вініл + + + Вініловий диск + + + Вініловий диск, сторона CD + + + Вініловий диск, сторона DVD + + + Вініловий диск, вінілова сторона + + + Восковий циліндр + + + Zip-диск + + + Книга + + + Бокс + + + Картонний паперовий конверт + + + Корпус касети + + + Кейс-черепашка + + + Диджибук + + + Диджифайл + + + Диджипак + + + Слайдер дискового боксу + + + Фатбокс + + + Обкладинка-розгортка + + + Джевел-кейс + + + Кіп-кейс + + + Лонгбокс + + + Металева бляшанка + + + Пластиковий конверт + + + Слайд-пак + + + Тонкий джевел-кейс + + + Сліпкейс + + + Снеп-кейс + + + Снеп-пак + + + Супер-джевел-бокс + + + Немає + + + Афганістан + + + Албанія + + + Алжир + + + Андорра + + + Ангола + + + Антигуа і Барбуда + + + Аргентина + + + Вірменія + + + Австралія + + + Австрія + + + Азербайджан + + + Багамські острови + + + Бахрейн + + + Бангладеш + + + Барбадос + + + Білорусь + + + Бельгія + + + Беліз + + + Бенін + + + Бутан + + + Болівія + + + Боснія і Герцеговина + + + Ботсвана + + + Бразилія + + + Бруней + + + Болгарія + + + Буркіна-Фасо + + + Бурунді + + + Кабо-Верде + + + Камбоджа + + + Камерун + + + Канада + + + Центральноафриканська Республіка + + + Чад + + + Чилі + + + Китай + + + Колумбія + + + Коморські острови + + + Конго - Браззавіль + + + Конго - Кіншаса + + + Коста-Рика + + + Кот-д'Івуар + + + Хорватія + + + Куба + + + Кіпр + + + Чехія + + + Данія + + + Джибуті + + + Домініка + + + Домініканська Республіка + + + Еквадор + + + Єгипет + + + Сальвадор + + + Екваторіальна Гвінея + + + Еритрея + + + Естонія + + + Есватіні + + + Ефіопія + + + Фіджі + + + Фінляндія + + + Франція + + + Габон + + + Гамбія + + + Грузія + + + Німеччина + + + Гана + + + Греція + + + Гренада + + + Гватемала + + + Гвінея + + + Гвінея-Бісау + + + Гаяна + + + Гаїті + + + Гондурас + + + Угорщина + + + Ісландія + + + Індія + + + Індонезія + + + Іран + + + Ірак + + + Ірландія + + + Ізраїль + + + Італія + + + Ямайка + + + Японія + + + Йорданія + + + Казахстан + + + Кенія + + + Кірибаті + + + Північна Корея + + + Південна Корея + + + Кувейт + + + Киргизстан + + + Лаос + + + Латвія + + + Ліван + + + Лесото + + + Ліберія + + + Лівія + + + Ліхтенштейн + + + Литва + + + Люксембург + + + Мадагаскар + + + Малаві + + + Малайзія + + + Мальдіви + + + Малі + + + Мальта + + + Маршаллові Острови + + + Мавританія + + + Маврикій + + + Мексика + + + Мікронезія + + + Молдова + + + Монако + + + Монголія + + + Чорногорія + + + Марокко + + + Мозамбік + + + М'янма (Бірма) + + + Намібія + + + Науру + + + Непал + + + Нідерланди + + + Нова Зеландія + + + Нікарагуа + + + Нігер + + + Нігерія + + + Північна Македонія + + + Норвегія + + + Оман + + + Пакистан + + + Палау + + + Палестинські території + + + Панама + + + Папуа-Нова Гвінея + + + Парагвай + + + Перу + + + Філіппіни + + + Польща + + + Португалія + + + Катар + + + Румунія + + + Росія + + + Руанда + + + Сент-Кітс і Невіс + + + Сент-Люсія + + + Сент-Вінсент і Гренадини + + + Самоа + + + Сан-Марино + + + Сан-Томе і Принсіпі + + + Саудівська Аравія + + + Сенегал + + + Сербія + + + Сейшельські Острови + + + Сьєрра-Леоне + + + Сінгапур + + + Словаччина + + + Словенія + + + Соломонові Острови + + + Сомалі + + + Південно-Африканська Республіка + + + Південний Судан + + + Іспанія + + + Шрі-Ланка + + + Судан + + + Суринам + + + Швеція + + + Швейцарія + + + Сирія + + + Тайвань + + + Таджикистан + + + Танзанія + + + Таїланд + + + Тимор-Лешті + + + Того + + + Тонга + + + Тринідад і Тобаго + + + Туніс + + + Туреччина + + + Туркменістан + + + Тувалу + + + Уганда + + + Україна + + + Об'єднані Арабські Емірати + + + Велика Британія + + + Сполучені Штати Америки + + + Уругвай + + + Узбекистан + + + Вануату + + + Ватикан + + + Венесуела + + + В'єтнам + + + Ємен + + + Замбія + + + Зімбабве + + + Нідерландські Антильські острови + + + Європа + + + Увесь світ + + + Назва альбому. + + + Оригінальна назва альбому, якщо вона відрізняється від поточної. + + + Короткий опис або резюме альбому. + + + Коментар, який відрізняє альбом від інших з тією самою назвою. + + + Система письма, використана в назві релізу. + + + Статус випуску альбому. + + + Кількість дисків альбому. + + + Кількість треків альбому. + + + Назва релізу. + + + Медіаформат альбому. + + + Пакування альбому. + + + Штрих-код альбому. + + + Каталожні номери альбому. + + + Лейбл, який випустив альбом. + + + Стандартний ідентифікаційний номер Amazon альбому. + + + Ідентифікатор релізу у MusicBrainz. + + + Ідентифікатор групи релізів у MusicBrainz. + + + Ідентифікатор виконавця релізу у MusicBrainz. + + + Дата первинного випуску альбому. + + + Рік первинного випуску альбому. + + + Дата повторного випуску альбому. + + + Рік повторного випуску альбому. + + + Країна випуску альбому. + + + Версія релізу, наприклад оригінальна. + + + Дволітерний код мови альбому. + + + Назва мови альбому. + + + Рідна назва мови альбому. + + + Жанри альбому. + + + Теги альбому. + + + Типи випуску альбому. + + + Треки альбому. + + + Змінити обкладинку + + + Зображення обкладинки + + + Немає обкладинки + + + Зображення обкладинки оновлено. + + + Не вдалося завантажити зображення обкладинки. + + + Учасники + + + Ідентифікатор учасника + + + Роль + + + Додати учасника + + + Люди, які зробили внесок у виконавця. + + + Оцінки + + + Оцінка + + + Максимальна оцінка + + + Джерело + + + Кількість голосів + + + Додати оцінку + + + Оцінки виконавця з різних джерел. + + + Автор + + + Перекладач + + + Ілюстратор + + + Видавець + + + Оповідач + + + Актор + + + Режисер + + + Сценарист + + + Композитор + + + Автор текстів + + + Аранжувальник + + + Диригент + + + Продюсер + + + Виконавчий продюсер + + + Інженер + + + Мікшер + + + Реміксер + + + Лейбл звукозапису + + + Вокал + + + Бек-вокал + + + Гітара + + + Бас-гітара + + + Барабани + + + Перкусія + + + Клавішні + + + Піаніно + + + Синтезатор + + + Струнні + + + Дерев'яні духові + + + Мідні духові + + + Хор + + + Оркестратор + + + Виконавець + + + Користувач + + + MusicBrainz + + + Discogs + + + Last.fm + + + Жанр + + + Додати жанр + + + Тег + + + Додати тег + + + Тип випуску + + + Додати тип випуску + + + Номер каталогу + + + Додати номер каталогу + + + Обкладинка + + + Передня частина + + + Задня частина + + + Буклет + + + Носій + + + Лоток + + + Корінець + + + Обі + + + Наліпка + + + Плакат + + + Вкладка + + + Водяний знак + + + Фон + + + Банер + + + Логотип + + + Мініатюра + + + Ідентифікатори + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.zh-CN.resx new file mode 100644 index 00000000..f215465e --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.zh-CN.resx @@ -0,0 +1,1509 @@ + + + + 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 + + + 返回艺术家 + + + 编辑专辑 + + + 保存 + + + 专辑已保存。 + + + 无法保存该项目。 + + + 删除专辑 + + + 专辑已删除。 + + + 确定要删除此项目吗? + + + 无法删除该项目。 + + + 常规信息 + + + 标题 + + + 原标题 + + + 简介 + + + 消歧义 + + + 文字 + + + 发行状态 + + + 光盘总数 + + + 曲目总数 + + + 发行标题 + + + 媒介格式 + + + 包装 + + + 条码 + + + 目录编号 + + + 唱片公司 + + + ASIN + + + MusicBrainz 发行 Id + + + MusicBrainz 发行组 Id + + + MusicBrainz 发行艺术家 Id + + + 发行信息 + + + 首次发行日期 + + + 首次发行年份 + + + 再发行日期 + + + 再发行年份 + + + 发行国家 + + + 发行版本 + + + 语言 + + + 语言代码 + + + 语言名称 + + + 本地语名称 + + + 原语言 + + + 体裁 + + + 标签 + + + 发行类型 + + + 曲目 + + + 此专辑没有曲目 + + + 移除 + + + 盗版 + + + 已取消 + + + 已删除 + + + 官方 + + + 宣传 + + + 伪发行 + + + 已撤回 + + + 10 英寸醋酸盐唱片 + + + 10 英寸虫胶唱片 + + + 10 英寸黑胶 + + + 12 英寸醋酸盐唱片 + + + 12 英寸 Laser Disc + + + 12 英寸虫胶唱片 + + + 12 英寸黑胶 + + + 3 英寸黑胶 + + + 3.5 英寸软盘 + + + 5.25 英寸软盘 + + + 7 英寸醋酸盐唱片 + + + 7 英寸 Flexi Disc + + + 7 英寸虫胶唱片 + + + 7 英寸黑胶 + + + 8 英寸 Laser Disc + + + 八轨磁带盒 + + + 8 厘米 CD + + + 8 厘米 CD Plus G + + + 8 厘米 CD-R + + + 醋酸盐唱片 + + + Betacam SP + + + Betamax + + + Blu-ray + + + Blu-ray-R + + + Blu Spec CD + + + 卡带 + + + 盒式磁带 + + + CD + + + CD Plus G + + + CD Minusi + + + CD-R + + + CDV + + + CED + + + 复制控制 CD + + + DAT + + + 数据 CD + + + 数据 DVD + + + 数据 DVD-R + + + Data Play + + + DCC + + + 数字媒体 + + + 下载卡 + + + DTSCD + + + Dual Disc + + + Dual Disc CD 面 + + + Dual Disc DVD 面 + + + Dual Disc DVD 音频面 + + + Dual Disc DVD 视频面 + + + DVD + + + DVD 音频 + + + DVD-R 视频 + + + DVD 视频 + + + DVD Plus + + + DVD Plus CD 面 + + + DVD Plus DVD 音频面 + + + DVD Plus DVD 视频面 + + + Edison Diamond Disc + + + 增强型 CD + + + Flexi Disc + + + 软盘 + + + HDDVD + + + HDCD + + + Hi Pac + + + HQCD + + + 混合 SACD + + + 混合 SACDCD 层 + + + 混合 SACDSACD 层 + + + 混合 SACDSACD 层 2 声道 + + + 混合 SACDSACD 层多声道 + + + Ki T Album + + + Laser Disc + + + 微型盒式磁带 + + + Micro SD + + + Mini Disc + + + Mini DVD + + + Mini DVD 音频 + + + Mini DVD 视频 + + + Minimax CD + + + Minimax DVD + + + Minimax DVD 音频 + + + Minimax DVD 视频 + + + 混合模式 CD + + + 其他 + + + Pathe Disc + + + 留声机唱片 + + + 钢琴卷 + + + Playbutton + + + Play Tape + + + 开盘式磁带 + + + ROM 卡带 + + + SACD + + + SACD 2 声道 + + + SACD 多声道 + + + SD Card + + + 虫胶唱片 + + + SHMCD + + + SHMSACD + + + SHMSACD 多声道 + + + Slot Music + + + SVCD + + + Tefifon + + + UMD + + + USB 闪存盘 + + + VCD + + + VHD + + + VHS + + + 黑胶 + + + 黑胶唱片 + + + 黑胶唱片 CD 面 + + + 黑胶唱片 DVD 面 + + + 黑胶唱片 黑胶面 + + + 蜡筒 + + + Zip Disk + + + 书 + + + 盒装 + + + 纸板纸质套 + + + 盒式磁带盒 + + + 翻盖盒 + + + Digibook + + + Digifile + + + Digipak + + + Discbox Slider + + + Fatbox + + + 对开封面 + + + 珠宝盒 + + + Keep Case + + + 长盒 + + + 金属盒 + + + 塑料套 + + + Slidepack + + + 超薄珠宝盒 + + + 封套 + + + 卡扣盒 + + + Snap Pack + + + Super Jewel Box + + + 无 + + + 阿富汗 + + + 阿尔巴尼亚 + + + 阿尔及利亚 + + + 安道尔 + + + 安哥拉 + + + 安提瓜和巴布达 + + + 阿根廷 + + + 亚美尼亚 + + + 澳大利亚 + + + 奥地利 + + + 阿塞拜疆 + + + 巴哈马 + + + 巴林 + + + 孟加拉国 + + + 巴巴多斯 + + + 白俄罗斯 + + + 比利时 + + + 伯利兹 + + + 贝宁 + + + 不丹 + + + 玻利维亚 + + + 波斯尼亚和黑塞哥维那 + + + 博茨瓦纳 + + + 巴西 + + + 文莱 + + + 保加利亚 + + + 布基纳法索 + + + 布隆迪 + + + 佛得角 + + + 柬埔寨 + + + 喀麦隆 + + + 加拿大 + + + 中非共和国 + + + 乍得 + + + 智利 + + + 中国 + + + 哥伦比亚 + + + 科摩罗 + + + 刚果(布拉柴维尔) + + + 刚果(金沙萨) + + + 哥斯达黎加 + + + 科特迪瓦 + + + 克罗地亚 + + + 古巴 + + + 塞浦路斯 + + + 捷克 + + + 丹麦 + + + 吉布提 + + + 多米尼克 + + + 多米尼加共和国 + + + 厄瓜多尔 + + + 埃及 + + + 萨尔瓦多 + + + 赤道几内亚 + + + 厄立特里亚 + + + 爱沙尼亚 + + + 斯威士兰 + + + 埃塞俄比亚 + + + 斐济 + + + 芬兰 + + + 法国 + + + 加蓬 + + + 冈比亚 + + + 格鲁吉亚 + + + 德国 + + + 加纳 + + + 希腊 + + + 格林纳达 + + + 危地马拉 + + + 几内亚 + + + 几内亚比绍 + + + 圭亚那 + + + 海地 + + + 洪都拉斯 + + + 匈牙利 + + + 冰岛 + + + 印度 + + + 印度尼西亚 + + + 伊朗 + + + 伊拉克 + + + 爱尔兰 + + + 以色列 + + + 意大利 + + + 牙买加 + + + 日本 + + + 约旦 + + + 哈萨克斯坦 + + + 肯尼亚 + + + 基里巴斯 + + + 朝鲜 + + + 韩国 + + + 科威特 + + + 吉尔吉斯斯坦 + + + 老挝 + + + 拉脱维亚 + + + 黎巴嫩 + + + 莱索托 + + + 利比里亚 + + + 利比亚 + + + 列支敦士登 + + + 立陶宛 + + + 卢森堡 + + + 马达加斯加 + + + 马拉维 + + + 马来西亚 + + + 马尔代夫 + + + 马里 + + + 马耳他 + + + 马绍尔群岛 + + + 毛里塔尼亚 + + + 毛里求斯 + + + 墨西哥 + + + 密克罗尼西亚 + + + 摩尔多瓦 + + + 摩纳哥 + + + 蒙古 + + + 黑山 + + + 摩洛哥 + + + 莫桑比克 + + + 缅甸 + + + 纳米比亚 + + + 瑙鲁 + + + 尼泊尔 + + + 荷兰 + + + 新西兰 + + + 尼加拉瓜 + + + 尼日尔 + + + 尼日利亚 + + + 北马其顿 + + + 挪威 + + + 阿曼 + + + 巴基斯坦 + + + 帕劳 + + + 巴勒斯坦领土 + + + 巴拿马 + + + 巴布亚新几内亚 + + + 巴拉圭 + + + 秘鲁 + + + 菲律宾 + + + 波兰 + + + 葡萄牙 + + + 卡塔尔 + + + 罗马尼亚 + + + 俄罗斯 + + + 卢旺达 + + + 圣基茨和尼维斯 + + + 圣卢西亚 + + + 圣文森特和格林纳丁斯 + + + 萨摩亚 + + + 圣马力诺 + + + 圣多美和普林西比 + + + 沙特阿拉伯 + + + 塞内加尔 + + + 塞尔维亚 + + + 塞舌尔 + + + 塞拉利昂 + + + 新加坡 + + + 斯洛伐克 + + + 斯洛文尼亚 + + + 所罗门群岛 + + + 索马里 + + + 南非 + + + 南苏丹 + + + 西班牙 + + + 斯里兰卡 + + + 苏丹 + + + 苏里南 + + + 瑞典 + + + 瑞士 + + + 叙利亚 + + + 台湾 + + + 塔吉克斯坦 + + + 坦桑尼亚 + + + 泰国 + + + 东帝汶 + + + 多哥 + + + 汤加 + + + 特立尼达和多巴哥 + + + 突尼斯 + + + 土耳其 + + + 土库曼斯坦 + + + 图瓦卢 + + + 乌干达 + + + 乌克兰 + + + 阿拉伯联合酋长国 + + + 英国 + + + 美国 + + + 乌拉圭 + + + 乌兹别克斯坦 + + + 瓦努阿图 + + + 梵蒂冈 + + + 委内瑞拉 + + + 越南 + + + 也门 + + + 赞比亚 + + + 津巴布韦 + + + 荷属安的列斯 + + + 欧洲 + + + 全球 + + + 专辑的标题。 + + + 与当前标题不同时的专辑原始标题。 + + + 专辑的简短摘要或描述。 + + + 用于将专辑与同名专辑区分开的说明。 + + + 发行标题中使用的文字。 + + + 专辑的发行状态。 + + + 专辑的唱片数量。 + + + 专辑的音轨数量。 + + + 发行的标题。 + + + 专辑的媒体格式。 + + + 专辑的包装。 + + + 专辑的条形码。 + + + 专辑的目录编号。 + + + 发行该专辑的唱片公司。 + + + 专辑的亚马逊标准识别号。 + + + 发行的MusicBrainz标识符。 + + + 发行组的MusicBrainz标识符。 + + + 发行艺术家的MusicBrainz标识符。 + + + 专辑最初发行的日期。 + + + 专辑最初发行的年份。 + + + 专辑再次发行的日期。 + + + 专辑再次发行的年份。 + + + 专辑的发行国家/地区。 + + + 发行的版本,例如原始版本。 + + + 专辑语言的两字母代码。 + + + 专辑语言的名称。 + + + 专辑语言的本地名称。 + + + 专辑的流派。 + + + 专辑的标签。 + + + 专辑的发行类型。 + + + 专辑的音轨。 + + + 更改封面 + + + 封面图片 + + + 无封面 + + + 封面图片已更新。 + + + 无法上传封面图片。 + + + 贡献者 + + + 贡献者 Id + + + 角色 + + + 添加贡献者 + + + 为艺术家做出贡献的人员。 + + + 评分 + + + 评分 + + + 最高评分 + + + 来源 + + + 票数 + + + 添加评分 + + + 来自不同来源的艺术家评分。 + + + 作者 + + + 译者 + + + 插画师 + + + 出版商 + + + 旁白 + + + 演员 + + + 导演 + + + 编剧 + + + 作曲 + + + 作词 + + + 编曲 + + + 指挥 + + + 制作人 + + + 执行制作人 + + + 工程师 + + + 混音师 + + + 重混师 + + + 唱片公司 + + + 人声 + + + 和声 + + + 吉他 + + + 贝斯 + + + 鼓 + + + 打击乐 + + + 键盘 + + + 钢琴 + + + 合成器 + + + 弦乐 + + + 木管乐 + + + 铜管乐 + + + 合唱 + + + 配器 + + + 表演者 + + + 用户 + + + MusicBrainz + + + Discogs + + + Last.fm + + + 流派 + + + 添加流派 + + + 标签 + + + 添加标签 + + + 发行类型 + + + 添加发行类型 + + + 目录编号 + + + 添加目录编号 + + + 封面 + + + 正面 + + + 背面 + + + 小册子 + + + 介质 + + + 托盘 + + + 书脊 + + + 腰带 + + + 贴纸 + + + 海报 + + + 内页 + + + 水印 + + + 背景 + + + 横幅 + + + 标志 + + + 缩略图 + + + 标识符 + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ar-SA.resx new file mode 100644 index 00000000..d99952cb --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ar-SA.resx @@ -0,0 +1,60 @@ + + + + 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/Library/AudioLibrary/MusicLibrary/Artists/Index.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.de-DE.resx new file mode 100644 index 00000000..f0b0fab2 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.de-DE.resx @@ -0,0 +1,60 @@ + + + + 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 + + + Suchen + + + Einträge + + + von + + + Seite + + + Zurück + + + Weiter + + + Sortieren: A-Z + + + Sortieren: Z-A + + + Diese Bibliothek hat keine Einträge + + + Keine Einträge entsprechen den aktuellen Filtern + + + Alle + + + Details anzeigen + + + Löschen + + + Möchten Sie dieses Element wirklich löschen? + + + Das Element konnte nicht gelöscht werden. + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.en-US.resx new file mode 100644 index 00000000..1120e9db --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.en-US.resx @@ -0,0 +1,60 @@ + + + + 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 + + + Search + + + items + + + of + + + Page + + + Previous + + + Next + + + Sort: A-Z + + + Sort: Z-A + + + This library has no items + + + No items match the current filters + + + All + + + View details + + + Delete + + + Are you sure you want to delete this item? + + + The item could not be deleted. + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.es-ES.resx new file mode 100644 index 00000000..58ceea6a --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.es-ES.resx @@ -0,0 +1,60 @@ + + + + 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 + + + Buscar + + + elementos + + + de + + + Página + + + Anterior + + + Siguiente + + + Ordenar: A-Z + + + Ordenar: Z-A + + + Esta biblioteca no tiene elementos + + + Ningún elemento coincide con los filtros actuales + + + Todas + + + Ver detalles + + + Eliminar + + + ¿Seguro que quieres eliminar este elemento? + + + No se ha podido eliminar el elemento. + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.fr-FR.resx new file mode 100644 index 00000000..7d497880 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.fr-FR.resx @@ -0,0 +1,60 @@ + + + + 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 + + + Rechercher + + + éléments + + + sur + + + Page + + + Précédent + + + Suivant + + + Trier : A-Z + + + Trier : Z-A + + + Cette bibliothèque ne contient aucun élément + + + Aucun élément ne correspond aux filtres actuels + + + Toutes + + + Voir les détails + + + Supprimer + + + Voulez-vous vraiment supprimer cet élément ? + + + L'élément n'a pas pu être supprimé. + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.it-IT.resx new file mode 100644 index 00000000..cfbcec6f --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.it-IT.resx @@ -0,0 +1,60 @@ + + + + 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 + + + Cerca + + + elementi + + + di + + + Pagina + + + Precedente + + + Successivo + + + Ordina: A-Z + + + Ordina: Z-A + + + Questa biblioteca non contiene elementi + + + Nessun elemento corrisponde ai filtri correnti + + + Tutte + + + Visualizza dettagli + + + Elimina + + + Sei sicuro di voler eliminare questo elemento? + + + Non è stato possibile eliminare l'elemento. + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ja-JP.resx new file mode 100644 index 00000000..16875e52 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ja-JP.resx @@ -0,0 +1,60 @@ + + + + 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 + + + 検索 + + + 件 + + + / + + + ページ + + + 前へ + + + 次へ + + + 並べ替え: A-Z + + + 並べ替え: Z-A + + + このライブラリには項目がありません + + + 現在のフィルターに一致する項目はありません + + + すべて + + + 詳細を表示 + + + 削除 + + + この項目を削除してもよろしいですか? + + + 項目を削除できませんでした。 + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.resx new file mode 100644 index 00000000..1120e9db --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.resx @@ -0,0 +1,60 @@ + + + + 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 + + + Search + + + items + + + of + + + Page + + + Previous + + + Next + + + Sort: A-Z + + + Sort: Z-A + + + This library has no items + + + No items match the current filters + + + All + + + View details + + + Delete + + + Are you sure you want to delete this item? + + + The item could not be deleted. + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ro-RO.resx new file mode 100644 index 00000000..8ec59558 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.ro-RO.resx @@ -0,0 +1,60 @@ + + + + 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 + + + Caută + + + elemente + + + din + + + Pagina + + + Înapoi + + + Înainte + + + Sortare: A-Z + + + Sortare: Z-A + + + Această bibliotecă nu are elemente + + + Niciun element nu corespunde filtrelor curente + + + Toate + + + Vezi detalii + + + Șterge + + + Sigur doriți să ștergeți acest element? + + + Elementul nu a putut fi șters. + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.uk-UA.resx new file mode 100644 index 00000000..be1c4469 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.uk-UA.resx @@ -0,0 +1,60 @@ + + + + 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/Library/AudioLibrary/MusicLibrary/Artists/Index.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.zh-CN.resx new file mode 100644 index 00000000..35ed518d --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.zh-CN.resx @@ -0,0 +1,60 @@ + + + + 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 + + + 搜索 + + + 项 + + + / + + + 页 + + + 上一页 + + + 下一页 + + + 排序: A-Z + + + 排序: Z-A + + + 此库中没有项目 + + + 没有项目符合当前筛选条件 + + + 全部 + + + 查看详情 + + + 删除 + + + 确定要删除此项目吗? + + + 无法删除该项目。 + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ar-SA.resx new file mode 100644 index 00000000..14698b57 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ar-SA.resx @@ -0,0 +1,1086 @@ + + + + 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 + + + العودة إلى الفنانين + + + تعديل الفنان + + + حفظ + + + تم حفظ الفنان. + + + تعذر حفظ العنصر. + + + حذف الفنان + + + تم حذف الفنان. + + + هل أنت متأكد من أنك تريد حذف هذا العنصر؟ + + + تعذر حذف العنصر. + + + معلومات عامة + + + الاسم + + + اسم الفرز + + + التوضيح + + + النوع + + + الجنس + + + البلد + + + الموقع الإلكتروني + + + معرّف فنان MusicBrainz + + + IPIs + + + ISNIs + + + تاريخ البدء + + + تاريخ الانتهاء + + + منتهٍ + + + الأنواع + + + الوسوم + + + المناطق + + + المنطقة + + + منطقة البداية + + + منطقة النهاية + + + الاسم + + + اسم الفرز + + + التوضيح + + + النوع + + + رمز ISO 3166 + + + معرّف منطقة MusicBrainz + + + الأسماء المستعارة + + + الاسم + + + اسم الفرز + + + النوع + + + اللغة + + + أساسي + + + تاريخ البدء + + + تاريخ الانتهاء + + + منتهٍ + + + إضافة اسم مستعار + + + المساهمون + + + معرّف المساهم + + + الدور + + + إضافة مساهم + + + التقييمات + + + التقييم + + + أقصى تقييم + + + المصدر + + + عدد الأصوات + + + إضافة تقييم + + + إزالة + + + الألبومات + + + لا توجد ألبومات لهذا الفنان + + + تم حذف الألبوم. + + + شخص + + + مجموعة + + + أوركسترا + + + جوقة + + + شخصية + + + آخر + + + ذكر + + + أنثى + + + لا ينطبق + + + مؤلف + + + مترجم + + + رسام + + + ناشر + + + راوٍ + + + ممثل + + + مخرج + + + كاتب سيناريو + + + ملحن + + + كاتب كلمات + + + موزع + + + قائد أوركسترا + + + منتج + + + منتج تنفيذي + + + مهندس صوت + + + خالط صوت + + + معيد المزج + + + شركة تسجيلات + + + غناء + + + غناء مساند + + + غيتار + + + غيتار باس + + + طبول + + + إيقاع + + + لوحات المفاتيح + + + بيانو + + + مركب صوتي + + + آلات وترية + + + آلات نفخ خشبية + + + آلات نفخ نحاسية + + + منسق أوركسترالي + + + المستخدم + + + MusicBrainz + + + Discogs + + + Last.fm + + + أفغانستان + + + ألبانيا + + + الجزائر + + + أندورا + + + أنغولا + + + أنتيغوا وبربودا + + + الأرجنتين + + + أرمينيا + + + أستراليا + + + النمسا + + + أذربيجان + + + الباهاما + + + البحرين + + + بنغلاديش + + + بربادوس + + + بيلاروسيا + + + بلجيكا + + + بليز + + + بنين + + + بوتان + + + بوليفيا + + + البوسنة والهرسك + + + بوتسوانا + + + البرازيل + + + بروناي + + + بلغاريا + + + بوركينا فاسو + + + بوروندي + + + الرأس الأخضر + + + كمبوديا + + + الكاميرون + + + كندا + + + جمهورية أفريقيا الوسطى + + + تشاد + + + تشيلي + + + الصين + + + كولومبيا + + + جزر القمر + + + الكونغو - برازافيل + + + الكونغو - كينشاسا + + + كوستاريكا + + + ساحل العاج + + + كرواتيا + + + كوبا + + + قبرص + + + التشيك + + + الدنمارك + + + جيبوتي + + + دومينيكا + + + جمهورية الدومينيكان + + + الإكوادور + + + مصر + + + السلفادور + + + غينيا الاستوائية + + + إريتريا + + + إستونيا + + + إسواتيني + + + إثيوبيا + + + فيجي + + + فنلندا + + + فرنسا + + + الغابون + + + غامبيا + + + جورجيا + + + ألمانيا + + + غانا + + + اليونان + + + غرينادا + + + غواتيمالا + + + غينيا + + + غينيا بيساو + + + غيانا + + + هايتي + + + هندوراس + + + هنغاريا + + + آيسلندا + + + الهند + + + إندونيسيا + + + إيران + + + العراق + + + أيرلندا + + + إسرائيل + + + إيطاليا + + + جامايكا + + + اليابان + + + الأردن + + + كازاخستان + + + كينيا + + + كيريباتي + + + كوريا الشمالية + + + كوريا الجنوبية + + + الكويت + + + قيرغيزستان + + + لاوس + + + لاتفيا + + + لبنان + + + ليسوتو + + + ليبيريا + + + ليبيا + + + ليختنشتاين + + + ليتوانيا + + + لوكسمبورغ + + + مدغشقر + + + مالاوي + + + ماليزيا + + + المالديف + + + مالي + + + مالطا + + + جزر مارشال + + + موريتانيا + + + موريشيوس + + + المكسيك + + + ميكرونيزيا + + + مولدوفا + + + موناكو + + + منغوليا + + + الجبل الأسود + + + المغرب + + + موزمبيق + + + ميانمار (بورما) + + + ناميبيا + + + ناورو + + + نيبال + + + هولندا + + + نيوزيلندا + + + نيكاراغوا + + + النيجر + + + نيجيريا + + + مقدونيا الشمالية + + + النرويج + + + عُمان + + + باكستان + + + بالاو + + + الأراضي الفلسطينية + + + بنما + + + بابوا غينيا الجديدة + + + باراغواي + + + بيرو + + + الفلبين + + + بولندا + + + البرتغال + + + قطر + + + رومانيا + + + روسيا + + + رواندا + + + سانت كيتس ونيفيس + + + سانت لوسيا + + + سانت فينسنت والغرينادين + + + ساموا + + + سان مارينو + + + ساو تومي وبرينسيبي + + + المملكة العربية السعودية + + + السنغال + + + صربيا + + + سيشل + + + سيراليون + + + سنغافورة + + + سلوفاكيا + + + سلوفينيا + + + جزر سليمان + + + الصومال + + + جنوب أفريقيا + + + جنوب السودان + + + إسبانيا + + + سريلانكا + + + السودان + + + سورينام + + + السويد + + + سويسرا + + + سوريا + + + تايوان + + + طاجيكستان + + + تنزانيا + + + تايلاند + + + تيمور الشرقية + + + توغو + + + تونغا + + + ترينيداد وتوباغو + + + تونس + + + تركيا + + + تركمانستان + + + توفالو + + + أوغندا + + + أوكرانيا + + + الإمارات العربية المتحدة + + + المملكة المتحدة + + + الولايات المتحدة + + + أوروغواي + + + أوزبكستان + + + فانواتو + + + مدينة الفاتيكان + + + فنزويلا + + + فيتنام + + + اليمن + + + زامبيا + + + زيمبابوي + + + جزر الأنتيل الهولندية + + + أوروبا + + + العالم + + + الإصدارات + + + ألبوم + + + بث + + + EP + + + أغنية منفردة + + + دراما صوتية + + + كتاب صوتي + + + تجميعة + + + مزيج دي جي + + + نسخة تجريبية + + + تسجيل ميداني + + + مقابلة + + + حي + + + ميكستايب + + + ريمكس + + + موسيقى تصويرية + + + كلام منطوق + + + مؤدٍ + + + اسم الفنان. + + + الاسم المستخدم لترتيب الفنان عندما يختلف عن الاسم المعروض. + + + تعليق يميز الفنان عن غيره ممن يحملون الاسم نفسه. + + + نوع الفنان، مثل شخص أو مجموعة. + + + جنس الفنان. + + + رمز الدولة المكون من حرفين للفنان. + + + الموقع الرسمي للفنان. + + + معرّف MusicBrainz للفنان. + + + أرقام معلومات الأطراف المعنية الخاصة بالفنان. + + + معرّفات الأسماء المعيارية الدولية الخاصة بالفنان. + + + تاريخ بدء نشاط الفنان. + + + تاريخ انتهاء نشاط الفنان. + + + ما إذا كان الفنان لم يعد نشطاً. + + + الأنواع الموسيقية الخاصة بالفنان. + + + الوسوم الخاصة بالفنان. + + + اسم المنطقة. + + + الاسم المستخدم لترتيب المنطقة. + + + تعليق يميز المنطقة عن غيرها ممن تحمل الاسم نفسه. + + + نوع المنطقة. + + + رمز ISO 3166 للمنطقة. + + + معرّف MusicBrainz للمنطقة. + + + الأسماء البديلة للفنان. + + + الأشخاص الذين ساهموا في الفنان. + + + تقييمات الفنان من مصادر مختلفة. + + + تغيير الغلاف + + + صورة الغلاف + + + لا يوجد غلاف + + + تم تحديث صورة الغلاف. + + + تعذّر تحميل صورة الغلاف. + + + النوع + + + إضافة نوع + + + وسم + + + إضافة وسم + + + IPI + + + إضافة IPI + + + ISNI + + + إضافة ISNI + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.de-DE.resx new file mode 100644 index 00000000..58bf363f --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.de-DE.resx @@ -0,0 +1,1086 @@ + + + + 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 + + + Zurück zu den Künstlern + + + Künstler bearbeiten + + + Speichern + + + Der Künstler wurde gespeichert. + + + Das Element konnte nicht gespeichert werden. + + + Künstler löschen + + + Der Künstler wurde gelöscht. + + + Möchten Sie dieses Element wirklich löschen? + + + Das Element konnte nicht gelöscht werden. + + + Allgemeine Informationen + + + Name + + + Sortiername + + + Disambiguierung + + + Typ + + + Geschlecht + + + Land + + + Website + + + MusicBrainz-Künstler-Id + + + IPIs + + + ISNIs + + + Anfangsdatum + + + Enddatum + + + Beendet + + + Genres + + + Schlagwörter + + + Gebiete + + + Gebiet + + + Anfangsgebiet + + + Endgebiet + + + Name + + + Sortiername + + + Disambiguierung + + + Typ + + + ISO-3166-Code + + + MusicBrainz-Gebiet-Id + + + Aliase + + + Name + + + Sortiername + + + Typ + + + Gebietsschema + + + Primär + + + Anfangsdatum + + + Enddatum + + + Beendet + + + Alias hinzufügen + + + Mitwirkende + + + Mitwirkenden-Id + + + Rolle + + + Mitwirkenden hinzufügen + + + Bewertungen + + + Bewertung + + + Höchstbewertung + + + Quelle + + + Stimmenzahl + + + Bewertung hinzufügen + + + Entfernen + + + Alben + + + Dieser Künstler hat keine Alben + + + Das Album wurde gelöscht. + + + Person + + + Gruppe + + + Orchester + + + Chor + + + Charakter + + + Sonstige + + + Männlich + + + Weiblich + + + Nicht zutreffend + + + Autor + + + Übersetzer + + + Illustrator + + + Verlag + + + Erzähler + + + Schauspieler + + + Regisseur + + + Drehbuchautor + + + Komponist + + + Liedtexter + + + Arrangeur + + + Dirigent + + + Produzent + + + Ausführender Produzent + + + Toningenieur + + + Mixer + + + Remixer + + + Plattenlabel + + + Gesang + + + Hintergrundgesang + + + Gitarre + + + Bassgitarre + + + Schlagzeug + + + Perkussion + + + Keyboards + + + Klavier + + + Synthesizer + + + Streicher + + + Holzbläser + + + Blechbläser + + + Orchestrator + + + Benutzer + + + MusicBrainz + + + Discogs + + + Last.fm + + + Afghanistan + + + Albanien + + + Algerien + + + Andorra + + + Angola + + + Antigua und Barbuda + + + Argentinien + + + Armenien + + + Australien + + + Österreich + + + Aserbaidschan + + + Bahamas + + + Bahrain + + + Bangladesch + + + Barbados + + + Belarus + + + Belgien + + + Belize + + + Benin + + + Bhutan + + + Bolivien + + + Bosnien und Herzegowina + + + Botsuana + + + Brasilien + + + Brunei + + + Bulgarien + + + Burkina Faso + + + Burundi + + + Kap Verde + + + Kambodscha + + + Kamerun + + + Kanada + + + Zentralafrikanische Republik + + + Tschad + + + Chile + + + China + + + Kolumbien + + + Komoren + + + Kongo - Brazzaville + + + Kongo - Kinshasa + + + Costa Rica + + + Côte d'Ivoire + + + Kroatien + + + Kuba + + + Zypern + + + Tschechien + + + Dänemark + + + Dschibuti + + + Dominica + + + Dominikanische Republik + + + Ecuador + + + Ägypten + + + El Salvador + + + Äquatorialguinea + + + Eritrea + + + Estland + + + Eswatini + + + Äthiopien + + + Fidschi + + + Finnland + + + Frankreich + + + Gabun + + + Gambia + + + Georgien + + + Deutschland + + + Ghana + + + Griechenland + + + Grenada + + + Guatemala + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Ungarn + + + Island + + + Indien + + + Indonesien + + + Iran + + + Irak + + + Irland + + + Israel + + + Italien + + + Jamaika + + + Japan + + + Jordanien + + + Kasachstan + + + Kenia + + + Kiribati + + + Nordkorea + + + Südkorea + + + Kuwait + + + Kirgisistan + + + Laos + + + Lettland + + + Libanon + + + Lesotho + + + Liberia + + + Libyen + + + Liechtenstein + + + Litauen + + + Luxemburg + + + Madagaskar + + + Malawi + + + Malaysia + + + Malediven + + + Mali + + + Malta + + + Marshallinseln + + + Mauretanien + + + Mauritius + + + Mexiko + + + Mikronesien + + + Moldau + + + Monaco + + + Mongolei + + + Montenegro + + + Marokko + + + Mosambik + + + Myanmar (Burma) + + + Namibia + + + Nauru + + + Nepal + + + Niederlande + + + Neuseeland + + + Nicaragua + + + Niger + + + Nigeria + + + Nordmazedonien + + + Norwegen + + + Oman + + + Pakistan + + + Palau + + + Palästinensische Autonomiegebiete + + + Panama + + + Papua-Neuguinea + + + Paraguay + + + Peru + + + Philippinen + + + Polen + + + Portugal + + + Katar + + + Rumänien + + + Russland + + + Ruanda + + + St. Kitts und Nevis + + + St. Lucia + + + St. Vincent und die Grenadinen + + + Samoa + + + San Marino + + + São Tomé und Príncipe + + + Saudi-Arabien + + + Senegal + + + Serbien + + + Seychellen + + + Sierra Leone + + + Singapur + + + Slowakei + + + Slowenien + + + Salomonen + + + Somalia + + + Südafrika + + + Südsudan + + + Spanien + + + Sri Lanka + + + Sudan + + + Suriname + + + Schweden + + + Schweiz + + + Syrien + + + Taiwan + + + Tadschikistan + + + Tansania + + + Thailand + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad und Tobago + + + Tunesien + + + Türkei + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ukraine + + + Vereinigte Arabische Emirate + + + Vereinigtes Königreich + + + Vereinigte Staaten + + + Uruguay + + + Usbekistan + + + Vanuatu + + + Vatikanstadt + + + Venezuela + + + Vietnam + + + Jemen + + + Sambia + + + Simbabwe + + + Niederländische Antillen + + + Europa + + + Weltweit + + + Veröffentlichungen + + + Album + + + Sendung + + + EP + + + Single + + + Hörspiel + + + Hörbuch + + + Kompilation + + + DJ-Mix + + + Demo + + + Feldaufnahme + + + Interview + + + Live + + + Mixtape + + + Remix + + + Soundtrack + + + Gesprochenes Wort + + + Interpret + + + Der Name des Künstlers. + + + Der Name, nach dem der Künstler sortiert wird, wenn er vom Anzeigenamen abweicht. + + + Ein Kommentar, der den Künstler von anderen mit demselben Namen unterscheidet. + + + Der Typ des Künstlers, etwa eine Person oder eine Gruppe. + + + Das Geschlecht des Künstlers. + + + Der zweibuchstabige Ländercode des Künstlers. + + + Die offizielle Website des Künstlers. + + + Die MusicBrainz-Kennung des Künstlers. + + + Die Interested-Parties-Information-Nummern des Künstlers. + + + Die International Standard Name Identifiers des Künstlers. + + + Das Datum, an dem der Künstler seine Tätigkeit begann. + + + Das Datum, an dem der Künstler seine Tätigkeit beendete. + + + Ob der Künstler nicht mehr aktiv ist. + + + Die Genres des Künstlers. + + + Die Tags des Künstlers. + + + Der Name des Gebiets. + + + Der Name, nach dem das Gebiet sortiert wird. + + + Ein Kommentar, der das Gebiet von anderen mit demselben Namen unterscheidet. + + + Der Typ des Gebiets. + + + Der ISO-3166-Code des Gebiets. + + + Die MusicBrainz-Kennung des Gebiets. + + + Die alternativen Namen des Künstlers. + + + Die Personen, die zum Künstler beigetragen haben. + + + Die Bewertungen des Künstlers aus verschiedenen Quellen. + + + Cover ändern + + + Coverbild + + + Kein Cover + + + Das Coverbild wurde aktualisiert. + + + Das Coverbild konnte nicht hochgeladen werden. + + + Genre + + + Genre hinzufügen + + + Schlagwort + + + Schlagwort hinzufügen + + + IPI + + + IPI hinzufügen + + + ISNI + + + ISNI hinzufügen + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.en-US.resx new file mode 100644 index 00000000..bbf79a82 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.en-US.resx @@ -0,0 +1,1086 @@ + + + + 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 + + + Back to artists + + + Edit artist + + + Save + + + The artist was saved. + + + The item could not be saved. + + + Delete artist + + + The artist was deleted. + + + Are you sure you want to delete this item? + + + The item could not be deleted. + + + General information + + + Name + + + Sort name + + + Disambiguation + + + Type + + + Gender + + + Country + + + Website + + + MusicBrainz artist Id + + + IPIs + + + ISNIs + + + Begin date + + + End date + + + Ended + + + Genres + + + Tags + + + Areas + + + Area + + + Begin area + + + End area + + + Name + + + Sort name + + + Disambiguation + + + Type + + + ISO 3166 code + + + MusicBrainz area Id + + + Aliases + + + Name + + + Sort name + + + Type + + + Locale + + + Primary + + + Begin date + + + End date + + + Ended + + + Add alias + + + Contributors + + + Contributor Id + + + Role + + + Add contributor + + + Ratings + + + Rating + + + Maximum rating + + + Source + + + Vote count + + + Add rating + + + Remove + + + Albums + + + This artist has no albums + + + The album was deleted. + + + Person + + + Group + + + Orchestra + + + Choir + + + Character + + + Other + + + Male + + + Female + + + Not Applicable + + + Author + + + Translator + + + Illustrator + + + Publisher + + + Narrator + + + Actor + + + Director + + + Screenwriter + + + Composer + + + Lyricist + + + Arranger + + + Conductor + + + Producer + + + Executive Producer + + + Engineer + + + Mixer + + + Remixer + + + Record Label + + + Vocals + + + Backing Vocals + + + Guitar + + + Bass Guitar + + + Drums + + + Percussion + + + Keyboards + + + Piano + + + Synthesizer + + + Strings + + + Woodwinds + + + Brass + + + Orchestrator + + + User + + + MusicBrainz + + + Discogs + + + Last.fm + + + Afghanistan + + + Albania + + + Algeria + + + Andorra + + + Angola + + + Antigua & Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaijan + + + Bahamas + + + Bahrain + + + Bangladesh + + + Barbados + + + Belarus + + + Belgium + + + Belize + + + Benin + + + Bhutan + + + Bolivia + + + Bosnia & Herzegovina + + + Botswana + + + Brazil + + + Brunei + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Cape Verde + + + Cambodia + + + Cameroon + + + Canada + + + Central African Republic + + + Chad + + + Chile + + + China + + + Colombia + + + Comoros + + + Congo - Brazzaville + + + Congo - Kinshasa + + + Costa Rica + + + Côte d’Ivoire + + + Croatia + + + Cuba + + + Cyprus + + + Czechia + + + Denmark + + + Djibouti + + + Dominica + + + Dominican Republic + + + Ecuador + + + Egypt + + + El Salvador + + + Equatorial Guinea + + + Eritrea + + + Estonia + + + Eswatini + + + Ethiopia + + + Fiji + + + Finland + + + France + + + Gabon + + + Gambia + + + Georgia + + + Germany + + + Ghana + + + Greece + + + Grenada + + + Guatemala + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Hungary + + + Iceland + + + India + + + Indonesia + + + Iran + + + Iraq + + + Ireland + + + Israel + + + Italy + + + Jamaica + + + Japan + + + Jordan + + + Kazakhstan + + + Kenya + + + Kiribati + + + North Korea + + + South Korea + + + Kuwait + + + Kyrgyzstan + + + Laos + + + Latvia + + + Lebanon + + + Lesotho + + + Liberia + + + Libya + + + Liechtenstein + + + Lithuania + + + Luxembourg + + + Madagascar + + + Malawi + + + Malaysia + + + Maldives + + + Mali + + + Malta + + + Marshall Islands + + + Mauritania + + + Mauritius + + + Mexico + + + Micronesia + + + Moldova + + + Monaco + + + Mongolia + + + Montenegro + + + Morocco + + + Mozambique + + + Myanmar (Burma) + + + Namibia + + + Nauru + + + Nepal + + + Netherlands + + + New Zealand + + + Nicaragua + + + Niger + + + Nigeria + + + North Macedonia + + + Norway + + + Oman + + + Pakistan + + + Palau + + + Palestinian Territories + + + Panama + + + Papua New Guinea + + + Paraguay + + + Peru + + + Philippines + + + Poland + + + Portugal + + + Qatar + + + Romania + + + Russia + + + Rwanda + + + St. Kitts & Nevis + + + St. Lucia + + + St. Vincent & Grenadines + + + Samoa + + + San Marino + + + São Tomé & Príncipe + + + Saudi Arabia + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Singapore + + + Slovakia + + + Slovenia + + + Solomon Islands + + + Somalia + + + South Africa + + + South Sudan + + + Spain + + + Sri Lanka + + + Sudan + + + Suriname + + + Sweden + + + Switzerland + + + Syria + + + Taiwan + + + Tajikistan + + + Tanzania + + + Thailand + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad & Tobago + + + Tunisia + + + Türkiye + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ukraine + + + United Arab Emirates + + + United Kingdom + + + United States + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + Vatican City + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabwe + + + Netherlands Antilles + + + Europe + + + Worldwide + + + Releases + + + Album + + + Broadcast + + + EP + + + Single + + + Audio drama + + + Audiobook + + + Compilation + + + DJ mix + + + Demo + + + Field recording + + + Interview + + + Live + + + Mixtape + + + Remix + + + Soundtrack + + + Spoken word + + + Performer + + + The name of the artist. + + + The name used to sort the artist, when it differs from the display name. + + + A comment that distinguishes the artist from others with the same name. + + + The type of the artist, like a person or a group. + + + The gender of the artist. + + + The two letter code of the country of the artist. + + + The official website of the artist. + + + The MusicBrainz identifier of the artist. + + + The Interested Parties Information numbers of the artist. + + + The International Standard Name Identifiers of the artist. + + + The date when the artist began its activity. + + + The date when the artist ended its activity. + + + Whether the artist is no longer active. + + + The genres of the artist. + + + The tags of the artist. + + + The name of the area. + + + The name used to sort the area. + + + A comment that distinguishes the area from others with the same name. + + + The type of the area. + + + The ISO 3166 code of the area. + + + The MusicBrainz identifier of the area. + + + The alternative names of the artist. + + + The people that contributed to the artist. + + + The ratings of the artist from different sources. + + + Change cover + + + Cover image + + + No cover + + + The cover image was updated. + + + The cover image could not be uploaded. + + + Genre + + + Add genre + + + Tag + + + Add tag + + + IPI + + + Add IPI + + + ISNI + + + Add ISNI + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.es-ES.resx new file mode 100644 index 00000000..e9476462 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.es-ES.resx @@ -0,0 +1,1086 @@ + + + + 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 + + + Volver a los artistas + + + Editar artista + + + Guardar + + + El artista se ha guardado. + + + No se ha podido guardar el elemento. + + + Eliminar artista + + + El artista se ha eliminado. + + + ¿Seguro que quieres eliminar este elemento? + + + No se ha podido eliminar el elemento. + + + Información General + + + Nombre + + + Nombre de ordenación + + + Desambiguación + + + Tipo + + + Género + + + País + + + Sitio web + + + Id de artista de MusicBrainz + + + IPIs + + + ISNIs + + + Fecha de inicio + + + Fecha de fin + + + Finalizado + + + Géneros + + + Etiquetas + + + Áreas + + + Área + + + Área de inicio + + + Área de fin + + + Nombre + + + Nombre de ordenación + + + Desambiguación + + + Tipo + + + Código ISO 3166 + + + Id de área de MusicBrainz + + + Alias + + + Nombre + + + Nombre de ordenación + + + Tipo + + + Configuración regional + + + Principal + + + Fecha de inicio + + + Fecha de fin + + + Finalizado + + + Añadir alias + + + Colaboradores + + + Id de colaborador + + + Rol + + + Añadir colaborador + + + Valoraciones + + + Valoración + + + Valoración máxima + + + Fuente + + + Número de votos + + + Añadir valoración + + + Eliminar + + + Álbumes + + + Este artista no tiene álbumes + + + El álbum se ha eliminado. + + + Persona + + + Grupo + + + Orquesta + + + Coro + + + Personaje + + + Otro + + + Masculino + + + Femenino + + + No aplicable + + + Autor + + + Traductor + + + Ilustrador + + + Editorial + + + Narrador + + + Actor + + + Director + + + Guionista + + + Compositor + + + Letrista + + + Arreglista + + + Director de orquesta + + + Productor + + + Productor ejecutivo + + + Ingeniero + + + Mezclador + + + Remezclador + + + Discográfica + + + Voces + + + Coros + + + Guitarra + + + Bajo + + + Batería + + + Percusión + + + Teclados + + + Piano + + + Sintetizador + + + Cuerdas + + + Viento madera + + + Metales + + + Orquestador + + + Usuario + + + MusicBrainz + + + Discogs + + + Last.fm + + + Afganistán + + + Albania + + + Argelia + + + Andorra + + + Angola + + + Antigua y Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaiyán + + + Bahamas + + + Baréin + + + Bangladés + + + Barbados + + + Bielorrusia + + + Bélgica + + + Belice + + + Benín + + + Bután + + + Bolivia + + + Bosnia y Herzegovina + + + Botsuana + + + Brasil + + + Brunéi + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Cabo Verde + + + Camboya + + + Camerún + + + Canadá + + + República Centroafricana + + + Chad + + + Chile + + + China + + + Colombia + + + Comoras + + + Congo - Brazzaville + + + Congo - Kinsasa + + + Costa Rica + + + Costa de Marfil + + + Croacia + + + Cuba + + + Chipre + + + Chequia + + + Dinamarca + + + Yibuti + + + Dominica + + + República Dominicana + + + Ecuador + + + Egipto + + + El Salvador + + + Guinea Ecuatorial + + + Eritrea + + + Estonia + + + Esuatini + + + Etiopía + + + Fiyi + + + Finlandia + + + Francia + + + Gabón + + + Gambia + + + Georgia + + + Alemania + + + Ghana + + + Grecia + + + Granada + + + Guatemala + + + Guinea + + + Guinea-Bisáu + + + Guyana + + + Haití + + + Honduras + + + Hungría + + + Islandia + + + India + + + Indonesia + + + Irán + + + Irak + + + Irlanda + + + Israel + + + Italia + + + Jamaica + + + Japón + + + Jordania + + + Kazajistán + + + Kenia + + + Kiribati + + + Corea del Norte + + + Corea del Sur + + + Kuwait + + + Kirguistán + + + Laos + + + Letonia + + + Líbano + + + Lesoto + + + Liberia + + + Libia + + + Liechtenstein + + + Lituania + + + Luxemburgo + + + Madagascar + + + Malaui + + + Malasia + + + Maldivas + + + Malí + + + Malta + + + Islas Marshall + + + Mauritania + + + Mauricio + + + México + + + Micronesia + + + Moldavia + + + Mónaco + + + Mongolia + + + Montenegro + + + Marruecos + + + Mozambique + + + Myanmar (Birmania) + + + Namibia + + + Nauru + + + Nepal + + + Países Bajos + + + Nueva Zelanda + + + Nicaragua + + + Níger + + + Nigeria + + + Macedonia del Norte + + + Noruega + + + Omán + + + Pakistán + + + Palaos + + + Territorios Palestinos + + + Panamá + + + Papúa Nueva Guinea + + + Paraguay + + + Perú + + + Filipinas + + + Polonia + + + Portugal + + + Catar + + + Rumanía + + + Rusia + + + Ruanda + + + San Cristóbal y Nieves + + + Santa Lucía + + + San Vicente y las Granadinas + + + Samoa + + + San Marino + + + Santo Tomé y Príncipe + + + Arabia Saudí + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leona + + + Singapur + + + Eslovaquia + + + Eslovenia + + + Islas Salomón + + + Somalia + + + Sudáfrica + + + Sudán del Sur + + + España + + + Sri Lanka + + + Sudán + + + Surinam + + + Suecia + + + Suiza + + + Siria + + + Taiwán + + + Tayikistán + + + Tanzania + + + Tailandia + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad y Tobago + + + Túnez + + + Turquía + + + Turkmenistán + + + Tuvalu + + + Uganda + + + Ucrania + + + Emiratos Árabes Unidos + + + Reino Unido + + + Estados Unidos + + + Uruguay + + + Uzbekistán + + + Vanuatu + + + Ciudad del Vaticano + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabue + + + Antillas Neerlandesas + + + Europa + + + Mundial + + + Publicaciones + + + Álbum + + + Emisión + + + EP + + + Sencillo + + + Audio drama + + + Audiolibro + + + Recopilación + + + Mezcla de DJ + + + Demo + + + Grabación de campo + + + Entrevista + + + Directo + + + Mixtape + + + Remezcla + + + Banda sonora + + + Palabra hablada + + + Intérprete + + + El nombre del artista. + + + El nombre usado para ordenar al artista, cuando difiere del nombre mostrado. + + + Un comentario que distingue al artista de otros con el mismo nombre. + + + El tipo de artista, como una persona o un grupo. + + + El género del artista. + + + El código de dos letras del país del artista. + + + El sitio web oficial del artista. + + + El identificador MusicBrainz del artista. + + + Los números de Información de Partes Interesadas del artista. + + + Los Identificadores Internacionales Normalizados de Nombre del artista. + + + La fecha en que el artista comenzó su actividad. + + + La fecha en que el artista terminó su actividad. + + + Indica si el artista ya no está activo. + + + Los géneros del artista. + + + Las etiquetas del artista. + + + El nombre del área. + + + El nombre usado para ordenar el área. + + + Un comentario que distingue el área de otras con el mismo nombre. + + + El tipo de área. + + + El código ISO 3166 del área. + + + El identificador MusicBrainz del área. + + + Los nombres alternativos del artista. + + + Las personas que contribuyeron al artista. + + + Las valoraciones del artista de diferentes fuentes. + + + Cambiar la portada + + + Imagen de portada + + + Sin portada + + + La imagen de portada se actualizó. + + + No se pudo subir la imagen de portada. + + + Género + + + Añadir género + + + Etiqueta + + + Añadir etiqueta + + + IPI + + + Añadir IPI + + + ISNI + + + Añadir ISNI + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.fr-FR.resx new file mode 100644 index 00000000..08fe26ea --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.fr-FR.resx @@ -0,0 +1,1086 @@ + + + + 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 + + + Retour aux artistes + + + Modifier l'artiste + + + Enregistrer + + + L'artiste a été enregistré. + + + L'élément n'a pas pu être enregistré. + + + Supprimer l'artiste + + + L'artiste a été supprimé. + + + Voulez-vous vraiment supprimer cet élément ? + + + L'élément n'a pas pu être supprimé. + + + Informations Générales + + + Nom + + + Nom de tri + + + Désambiguïsation + + + Type + + + Genre + + + Pays + + + Site web + + + Id d'artiste MusicBrainz + + + IPIs + + + ISNIs + + + Date de début + + + Date de fin + + + Terminé + + + Genres + + + Étiquettes + + + Zones + + + Zone + + + Zone de début + + + Zone de fin + + + Nom + + + Nom de tri + + + Désambiguïsation + + + Type + + + Code ISO 3166 + + + Id de zone MusicBrainz + + + Alias + + + Nom + + + Nom de tri + + + Type + + + Paramètres régionaux + + + Principal + + + Date de début + + + Date de fin + + + Terminé + + + Ajouter un alias + + + Contributeurs + + + Id du contributeur + + + Rôle + + + Ajouter un contributeur + + + Évaluations + + + Évaluation + + + Évaluation maximale + + + Source + + + Nombre de votes + + + Ajouter une évaluation + + + Supprimer + + + Albums + + + Cet artiste n'a aucun album + + + L'album a été supprimé. + + + Personne + + + Groupe + + + Orchestre + + + Chœur + + + Personnage + + + Autre + + + Masculin + + + Féminin + + + Non applicable + + + Auteur + + + Traducteur + + + Illustrateur + + + Éditeur + + + Narrateur + + + Acteur + + + Réalisateur + + + Scénariste + + + Compositeur + + + Parolier + + + Arrangeur + + + Chef d'orchestre + + + Producteur + + + Producteur exécutif + + + Ingénieur du son + + + Mixeur + + + Remixeur + + + Maison de disques + + + Chant + + + Chœurs + + + Guitare + + + Guitare basse + + + Batterie + + + Percussions + + + Claviers + + + Piano + + + Synthétiseur + + + Cordes + + + Bois + + + Cuivres + + + Orchestrateur + + + Utilisateur + + + MusicBrainz + + + Discogs + + + Last.fm + + + Afghanistan + + + Albanie + + + Algérie + + + Andorre + + + Angola + + + Antigua-et-Barbuda + + + Argentine + + + Arménie + + + Australie + + + Autriche + + + Azerbaïdjan + + + Bahamas + + + Bahreïn + + + Bangladesh + + + Barbade + + + Biélorussie + + + Belgique + + + Belize + + + Bénin + + + Bhoutan + + + Bolivie + + + Bosnie-Herzégovine + + + Botswana + + + Brésil + + + Brunei + + + Bulgarie + + + Burkina Faso + + + Burundi + + + Cap-Vert + + + Cambodge + + + Cameroun + + + Canada + + + République centrafricaine + + + Tchad + + + Chili + + + Chine + + + Colombie + + + Comores + + + Congo-Brazzaville + + + Congo-Kinshasa + + + Costa Rica + + + Côte d'Ivoire + + + Croatie + + + Cuba + + + Chypre + + + Tchéquie + + + Danemark + + + Djibouti + + + Dominique + + + République dominicaine + + + Équateur + + + Égypte + + + Salvador + + + Guinée équatoriale + + + Érythrée + + + Estonie + + + Eswatini + + + Éthiopie + + + Fidji + + + Finlande + + + France + + + Gabon + + + Gambie + + + Géorgie + + + Allemagne + + + Ghana + + + Grèce + + + Grenade + + + Guatemala + + + Guinée + + + Guinée-Bissau + + + Guyana + + + Haïti + + + Honduras + + + Hongrie + + + Islande + + + Inde + + + Indonésie + + + Iran + + + Irak + + + Irlande + + + Israël + + + Italie + + + Jamaïque + + + Japon + + + Jordanie + + + Kazakhstan + + + Kenya + + + Kiribati + + + Corée du Nord + + + Corée du Sud + + + Koweït + + + Kirghizstan + + + Laos + + + Lettonie + + + Liban + + + Lesotho + + + Liberia + + + Libye + + + Liechtenstein + + + Lituanie + + + Luxembourg + + + Madagascar + + + Malawi + + + Malaisie + + + Maldives + + + Mali + + + Malte + + + Îles Marshall + + + Mauritanie + + + Maurice + + + Mexique + + + Micronésie + + + Moldavie + + + Monaco + + + Mongolie + + + Monténégro + + + Maroc + + + Mozambique + + + Myanmar (Birmanie) + + + Namibie + + + Nauru + + + Népal + + + Pays-Bas + + + Nouvelle-Zélande + + + Nicaragua + + + Niger + + + Nigeria + + + Macédoine du Nord + + + Norvège + + + Oman + + + Pakistan + + + Palaos + + + Territoires palestiniens + + + Panama + + + Papouasie-Nouvelle-Guinée + + + Paraguay + + + Pérou + + + Philippines + + + Pologne + + + Portugal + + + Qatar + + + Roumanie + + + Russie + + + Rwanda + + + Saint-Christophe-et-Niévès + + + Sainte-Lucie + + + Saint-Vincent-et-les Grenadines + + + Samoa + + + Saint-Marin + + + Sao Tomé-et-Principe + + + Arabie saoudite + + + Sénégal + + + Serbie + + + Seychelles + + + Sierra Leone + + + Singapour + + + Slovaquie + + + Slovénie + + + Îles Salomon + + + Somalie + + + Afrique du Sud + + + Soudan du Sud + + + Espagne + + + Sri Lanka + + + Soudan + + + Suriname + + + Suède + + + Suisse + + + Syrie + + + Taïwan + + + Tadjikistan + + + Tanzanie + + + Thaïlande + + + Timor oriental + + + Togo + + + Tonga + + + Trinité-et-Tobago + + + Tunisie + + + Turquie + + + Turkménistan + + + Tuvalu + + + Ouganda + + + Ukraine + + + Émirats arabes unis + + + Royaume-Uni + + + États-Unis + + + Uruguay + + + Ouzbékistan + + + Vanuatu + + + État de la Cité du Vatican + + + Venezuela + + + Viêt Nam + + + Yémen + + + Zambie + + + Zimbabwe + + + Antilles néerlandaises + + + Europe + + + Monde + + + Publications + + + Album + + + Diffusion + + + EP + + + Single + + + Drame audio + + + Livre audio + + + Compilation + + + Mix DJ + + + Démo + + + Enregistrement de terrain + + + Entretien + + + Live + + + Mixtape + + + Remix + + + Bande originale + + + Texte parlé + + + Interprète + + + Le nom de l'artiste. + + + Le nom utilisé pour trier l'artiste, lorsqu'il diffère du nom affiché. + + + Un commentaire qui distingue l'artiste des autres portant le même nom. + + + Le type de l'artiste, comme une personne ou un groupe. + + + Le genre de l'artiste. + + + Le code à deux lettres du pays de l'artiste. + + + Le site web officiel de l'artiste. + + + L'identifiant MusicBrainz de l'artiste. + + + Les numéros IPI de l'artiste. + + + Les identifiants ISNI de l'artiste. + + + La date à laquelle l'artiste a commencé son activité. + + + La date à laquelle l'artiste a terminé son activité. + + + Indique si l'artiste n'est plus actif. + + + Les genres de l'artiste. + + + Les étiquettes de l'artiste. + + + Le nom de la zone. + + + Le nom utilisé pour trier la zone. + + + Un commentaire qui distingue la zone des autres portant le même nom. + + + Le type de la zone. + + + Le code ISO 3166 de la zone. + + + L'identifiant MusicBrainz de la zone. + + + Les noms alternatifs de l'artiste. + + + Les personnes ayant contribué à l'artiste. + + + Les notes de l'artiste provenant de différentes sources. + + + Changer la couverture + + + Image de couverture + + + Aucune couverture + + + L'image de couverture a été mise à jour. + + + L'image de couverture n'a pas pu être téléversée. + + + Genre + + + Ajouter un genre + + + Étiquette + + + Ajouter une étiquette + + + IPI + + + Ajouter un IPI + + + ISNI + + + Ajouter un ISNI + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.it-IT.resx new file mode 100644 index 00000000..e2bf7d51 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.it-IT.resx @@ -0,0 +1,1086 @@ + + + + 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 + + + Torna agli artisti + + + Modifica artista + + + Salva + + + L'artista è stato salvato. + + + Non è stato possibile salvare l'elemento. + + + Elimina artista + + + L'artista è stato eliminato. + + + Sei sicuro di voler eliminare questo elemento? + + + Non è stato possibile eliminare l'elemento. + + + Informazioni Generali + + + Nome + + + Nome di ordinamento + + + Disambiguazione + + + Tipo + + + Genere + + + Paese + + + Sito web + + + Id artista MusicBrainz + + + IPIs + + + ISNIs + + + Data di inizio + + + Data di fine + + + Concluso + + + Generi + + + Etichette + + + Aree + + + Area + + + Area di inizio + + + Area di fine + + + Nome + + + Nome di ordinamento + + + Disambiguazione + + + Tipo + + + Codice ISO 3166 + + + Id area MusicBrainz + + + Alias + + + Nome + + + Nome di ordinamento + + + Tipo + + + Impostazioni locali + + + Principale + + + Data di inizio + + + Data di fine + + + Concluso + + + Aggiungi alias + + + Collaboratori + + + Id collaboratore + + + Ruolo + + + Aggiungi collaboratore + + + Valutazioni + + + Valutazione + + + Valutazione massima + + + Fonte + + + Numero di voti + + + Aggiungi valutazione + + + Rimuovi + + + Album + + + Questo artista non ha album + + + L'album è stato eliminato. + + + Persona + + + Gruppo + + + Orchestra + + + Coro + + + Personaggio + + + Altro + + + Maschio + + + Femmina + + + Non applicabile + + + Autore + + + Traduttore + + + Illustratore + + + Editore + + + Narratore + + + Attore + + + Regista + + + Sceneggiatore + + + Compositore + + + Paroliere + + + Arrangiatore + + + Direttore d'orchestra + + + Produttore + + + Produttore esecutivo + + + Tecnico del suono + + + Mixer + + + Remixer + + + Etichetta discografica + + + Voce + + + Voci di supporto + + + Chitarra + + + Basso + + + Batteria + + + Percussioni + + + Tastiere + + + Pianoforte + + + Sintetizzatore + + + Archi + + + Legni + + + Ottoni + + + Orchestratore + + + Utente + + + MusicBrainz + + + Discogs + + + Last.fm + + + Afghanistan + + + Albania + + + Algeria + + + Andorra + + + Angola + + + Antigua e Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaigian + + + Bahamas + + + Bahrein + + + Bangladesh + + + Barbados + + + Bielorussia + + + Belgio + + + Belize + + + Benin + + + Bhutan + + + Bolivia + + + Bosnia ed Erzegovina + + + Botswana + + + Brasile + + + Brunei + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Capo Verde + + + Cambogia + + + Camerun + + + Canada + + + Repubblica Centrafricana + + + Ciad + + + Cile + + + Cina + + + Colombia + + + Comore + + + Congo - Brazzaville + + + Congo - Kinshasa + + + Costa Rica + + + Costa d'Avorio + + + Croazia + + + Cuba + + + Cipro + + + Cechia + + + Danimarca + + + Gibuti + + + Dominica + + + Repubblica Dominicana + + + Ecuador + + + Egitto + + + El Salvador + + + Guinea Equatoriale + + + Eritrea + + + Estonia + + + Eswatini + + + Etiopia + + + Figi + + + Finlandia + + + Francia + + + Gabon + + + Gambia + + + Georgia + + + Germania + + + Ghana + + + Grecia + + + Grenada + + + Guatemala + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Ungheria + + + Islanda + + + India + + + Indonesia + + + Iran + + + Iraq + + + Irlanda + + + Israele + + + Italia + + + Giamaica + + + Giappone + + + Giordania + + + Kazakistan + + + Kenya + + + Kiribati + + + Corea del Nord + + + Corea del Sud + + + Kuwait + + + Kirghizistan + + + Laos + + + Lettonia + + + Libano + + + Lesotho + + + Liberia + + + Libia + + + Liechtenstein + + + Lituania + + + Lussemburgo + + + Madagascar + + + Malawi + + + Malaysia + + + Maldive + + + Mali + + + Malta + + + Isole Marshall + + + Mauritania + + + Mauritius + + + Messico + + + Micronesia + + + Moldavia + + + Monaco + + + Mongolia + + + Montenegro + + + Marocco + + + Mozambico + + + Myanmar (Birmania) + + + Namibia + + + Nauru + + + Nepal + + + Paesi Bassi + + + Nuova Zelanda + + + Nicaragua + + + Niger + + + Nigeria + + + Macedonia del Nord + + + Norvegia + + + Oman + + + Pakistan + + + Palau + + + Territori palestinesi + + + Panama + + + Papua Nuova Guinea + + + Paraguay + + + Perù + + + Filippine + + + Polonia + + + Portogallo + + + Qatar + + + Romania + + + Russia + + + Ruanda + + + Saint Kitts e Nevis + + + Saint Lucia + + + Saint Vincent e Grenadine + + + Samoa + + + San Marino + + + São Tomé e Príncipe + + + Arabia Saudita + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Singapore + + + Slovacchia + + + Slovenia + + + Isole Salomone + + + Somalia + + + Sudafrica + + + Sudan del Sud + + + Spagna + + + Sri Lanka + + + Sudan + + + Suriname + + + Svezia + + + Svizzera + + + Siria + + + Taiwan + + + Tagikistan + + + Tanzania + + + Thailandia + + + Timor Est + + + Togo + + + Tonga + + + Trinidad e Tobago + + + Tunisia + + + Turchia + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ucraina + + + Emirati Arabi Uniti + + + Regno Unito + + + Stati Uniti + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + Città del Vaticano + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabwe + + + Antille Olandesi + + + Europa + + + Mondiale + + + Pubblicazioni + + + Album + + + Trasmissione + + + EP + + + Singolo + + + Dramma audio + + + Audiolibro + + + Compilation + + + DJ mix + + + Demo + + + Registrazione sul campo + + + Intervista + + + Dal vivo + + + Mixtape + + + Remix + + + Colonna sonora + + + Parlato + + + Esecutore + + + Il nome dell'artista. + + + Il nome usato per ordinare l'artista, quando differisce dal nome visualizzato. + + + Un commento che distingue l'artista da altri con lo stesso nome. + + + Il tipo di artista, come una persona o un gruppo. + + + Il genere dell'artista. + + + Il codice di due lettere del paese dell'artista. + + + Il sito web ufficiale dell'artista. + + + L'identificatore MusicBrainz dell'artista. + + + I numeri di Interested Parties Information dell'artista. + + + Gli International Standard Name Identifiers dell'artista. + + + La data in cui l'artista ha iniziato la sua attività. + + + La data in cui l'artista ha terminato la sua attività. + + + Indica se l'artista non è più attivo. + + + I generi dell'artista. + + + I tag dell'artista. + + + Il nome dell'area. + + + Il nome usato per ordinare l'area. + + + Un commento che distingue l'area da altre con lo stesso nome. + + + Il tipo dell'area. + + + Il codice ISO 3166 dell'area. + + + L'identificatore MusicBrainz dell'area. + + + I nomi alternativi dell'artista. + + + Le persone che hanno contribuito all'artista. + + + Le valutazioni dell'artista da diverse fonti. + + + Cambia copertina + + + Immagine di copertina + + + Nessuna copertina + + + L'immagine di copertina è stata aggiornata. + + + Impossibile caricare l'immagine di copertina. + + + Genere + + + Aggiungi genere + + + Etichetta + + + Aggiungi etichetta + + + IPI + + + Aggiungi IPI + + + ISNI + + + Aggiungi ISNI + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ja-JP.resx new file mode 100644 index 00000000..490821f4 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ja-JP.resx @@ -0,0 +1,1086 @@ + + + + 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 + + + アーティストに戻る + + + アーティストを編集 + + + 保存 + + + アーティストを保存しました。 + + + 項目を保存できませんでした。 + + + アーティストを削除 + + + アーティストを削除しました。 + + + この項目を削除してもよろしいですか? + + + 項目を削除できませんでした。 + + + 一般情報 + + + 名前 + + + 並べ替え名 + + + 曖昧さ回避 + + + 種類 + + + 性別 + + + 国 + + + ウェブサイト + + + MusicBrainz アーティスト Id + + + IPIs + + + ISNIs + + + 開始日 + + + 終了日 + + + 終了 + + + ジャンル + + + タグ + + + 地域 + + + 地域 + + + 開始地域 + + + 終了地域 + + + 名前 + + + 並べ替え名 + + + 曖昧さ回避 + + + 種類 + + + ISO 3166 コード + + + MusicBrainz 地域 Id + + + 別名 + + + 名前 + + + 並べ替え名 + + + 種類 + + + ロケール + + + 優先 + + + 開始日 + + + 終了日 + + + 終了 + + + 別名を追加 + + + 貢献者 + + + 貢献者 Id + + + 役割 + + + 貢献者を追加 + + + 評価 + + + 評価 + + + 最大評価 + + + 出典 + + + 投票数 + + + 評価を追加 + + + 削除 + + + アルバム + + + このアーティストにはアルバムがありません + + + アルバムを削除しました。 + + + 個人 + + + グループ + + + オーケストラ + + + 合唱 + + + キャラクター + + + その他 + + + 男性 + + + 女性 + + + 該当なし + + + 著者 + + + 翻訳者 + + + イラストレーター + + + 出版社 + + + ナレーター + + + 俳優 + + + 監督 + + + 脚本家 + + + 作曲者 + + + 作詞者 + + + 編曲者 + + + 指揮者 + + + プロデューサー + + + エグゼクティブプロデューサー + + + エンジニア + + + ミキサー + + + リミキサー + + + レコードレーベル + + + ボーカル + + + バッキングボーカル + + + ギター + + + ベースギター + + + ドラム + + + パーカッション + + + キーボード + + + ピアノ + + + シンセサイザー + + + 弦楽器 + + + 木管楽器 + + + 金管楽器 + + + 管弦楽編曲者 + + + ユーザー + + + MusicBrainz + + + Discogs + + + Last.fm + + + アフガニスタン + + + アルバニア + + + アルジェリア + + + アンドラ + + + アンゴラ + + + アンティグア・バーブーダ + + + アルゼンチン + + + アルメニア + + + オーストラリア + + + オーストリア + + + アゼルバイジャン + + + バハマ + + + バーレーン + + + バングラデシュ + + + バルバドス + + + ベラルーシ + + + ベルギー + + + ベリーズ + + + ベナン + + + ブータン + + + ボリビア + + + ボスニア・ヘルツェゴビナ + + + ボツワナ + + + ブラジル + + + ブルネイ + + + ブルガリア + + + ブルキナファソ + + + ブルンジ + + + カーボベルデ + + + カンボジア + + + カメルーン + + + カナダ + + + 中央アフリカ共和国 + + + チャド + + + チリ + + + 中国 + + + コロンビア + + + コモロ + + + コンゴ共和国 + + + コンゴ民主共和国 + + + コスタリカ + + + コートジボワール + + + クロアチア + + + キューバ + + + キプロス + + + チェコ + + + デンマーク + + + ジブチ + + + ドミニカ国 + + + ドミニカ共和国 + + + エクアドル + + + エジプト + + + エルサルバドル + + + 赤道ギニア + + + エリトリア + + + エストニア + + + エスワティニ + + + エチオピア + + + フィジー + + + フィンランド + + + フランス + + + ガボン + + + ガンビア + + + ジョージア + + + ドイツ + + + ガーナ + + + ギリシャ + + + グレナダ + + + グアテマラ + + + ギニア + + + ギニアビサウ + + + ガイアナ + + + ハイチ + + + ホンジュラス + + + ハンガリー + + + アイスランド + + + インド + + + インドネシア + + + イラン + + + イラク + + + アイルランド + + + イスラエル + + + イタリア + + + ジャマイカ + + + 日本 + + + ヨルダン + + + カザフスタン + + + ケニア + + + キリバス + + + 北朝鮮 + + + 韓国 + + + クウェート + + + キルギス + + + ラオス + + + ラトビア + + + レバノン + + + レソト + + + リベリア + + + リビア + + + リヒテンシュタイン + + + リトアニア + + + ルクセンブルク + + + マダガスカル + + + マラウイ + + + マレーシア + + + モルディブ + + + マリ + + + マルタ + + + マーシャル諸島 + + + モーリタニア + + + モーリシャス + + + メキシコ + + + ミクロネシア + + + モルドバ + + + モナコ + + + モンゴル + + + モンテネグロ + + + モロッコ + + + モザンビーク + + + ミャンマー + + + ナミビア + + + ナウル + + + ネパール + + + オランダ + + + ニュージーランド + + + ニカラグア + + + ニジェール + + + ナイジェリア + + + 北マケドニア + + + ノルウェー + + + オマーン + + + パキスタン + + + パラオ + + + パレスチナ + + + パナマ + + + パプアニューギニア + + + パラグアイ + + + ペルー + + + フィリピン + + + ポーランド + + + ポルトガル + + + カタール + + + ルーマニア + + + ロシア + + + ルワンダ + + + セントクリストファー・ネービス + + + セントルシア + + + セントビンセント・グレナディーン + + + サモア + + + サンマリノ + + + サントメ・プリンシペ + + + サウジアラビア + + + セネガル + + + セルビア + + + セーシェル + + + シエラレオネ + + + シンガポール + + + スロバキア + + + スロベニア + + + ソロモン諸島 + + + ソマリア + + + 南アフリカ + + + 南スーダン + + + スペイン + + + スリランカ + + + スーダン + + + スリナム + + + スウェーデン + + + スイス + + + シリア + + + 台湾 + + + タジキスタン + + + タンザニア + + + タイ + + + 東ティモール + + + トーゴ + + + トンガ + + + トリニダード・トバゴ + + + チュニジア + + + トルコ + + + トルクメニスタン + + + ツバル + + + ウガンダ + + + ウクライナ + + + アラブ首長国連邦 + + + イギリス + + + アメリカ合衆国 + + + ウルグアイ + + + ウズベキスタン + + + バヌアツ + + + バチカン市国 + + + ベネズエラ + + + ベトナム + + + イエメン + + + ザンビア + + + ジンバブエ + + + オランダ領アンティル + + + ヨーロッパ + + + 全世界 + + + リリース + + + アルバム + + + 放送 + + + EP + + + シングル + + + オーディオドラマ + + + オーディオブック + + + コンピレーション + + + DJミックス + + + デモ + + + フィールドレコーディング + + + インタビュー + + + ライブ + + + ミックステープ + + + リミックス + + + サウンドトラック + + + スポークンワード + + + 演奏者 + + + アーティストの名前。 + + + 表示名と異なる場合にアーティストの並べ替えに使う名前。 + + + 同じ名前の他のアーティストと区別するためのコメント。 + + + 人物やグループなどのアーティストの種類。 + + + アーティストの性別。 + + + アーティストの国の2文字コード。 + + + アーティストの公式ウェブサイト。 + + + アーティストのMusicBrainz識別子。 + + + アーティストのIPI番号。 + + + アーティストのISNI。 + + + アーティストが活動を開始した日付。 + + + アーティストが活動を終了した日付。 + + + アーティストが活動を終了しているかどうか。 + + + アーティストのジャンル。 + + + アーティストのタグ。 + + + 地域の名前。 + + + 地域の並べ替えに使う名前。 + + + 同じ名前の他の地域と区別するためのコメント。 + + + 地域の種類。 + + + 地域のISO 3166コード。 + + + 地域のMusicBrainz識別子。 + + + アーティストの別名。 + + + アーティストに貢献した人々。 + + + さまざまな情報源によるアーティストの評価。 + + + カバーを変更 + + + カバー画像 + + + カバーなし + + + カバー画像を更新しました。 + + + カバー画像をアップロードできませんでした。 + + + ジャンル + + + ジャンルを追加 + + + タグ + + + タグを追加 + + + IPI + + + IPI を追加 + + + ISNI + + + ISNI を追加 + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.resx new file mode 100644 index 00000000..bbf79a82 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.resx @@ -0,0 +1,1086 @@ + + + + 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 + + + Back to artists + + + Edit artist + + + Save + + + The artist was saved. + + + The item could not be saved. + + + Delete artist + + + The artist was deleted. + + + Are you sure you want to delete this item? + + + The item could not be deleted. + + + General information + + + Name + + + Sort name + + + Disambiguation + + + Type + + + Gender + + + Country + + + Website + + + MusicBrainz artist Id + + + IPIs + + + ISNIs + + + Begin date + + + End date + + + Ended + + + Genres + + + Tags + + + Areas + + + Area + + + Begin area + + + End area + + + Name + + + Sort name + + + Disambiguation + + + Type + + + ISO 3166 code + + + MusicBrainz area Id + + + Aliases + + + Name + + + Sort name + + + Type + + + Locale + + + Primary + + + Begin date + + + End date + + + Ended + + + Add alias + + + Contributors + + + Contributor Id + + + Role + + + Add contributor + + + Ratings + + + Rating + + + Maximum rating + + + Source + + + Vote count + + + Add rating + + + Remove + + + Albums + + + This artist has no albums + + + The album was deleted. + + + Person + + + Group + + + Orchestra + + + Choir + + + Character + + + Other + + + Male + + + Female + + + Not Applicable + + + Author + + + Translator + + + Illustrator + + + Publisher + + + Narrator + + + Actor + + + Director + + + Screenwriter + + + Composer + + + Lyricist + + + Arranger + + + Conductor + + + Producer + + + Executive Producer + + + Engineer + + + Mixer + + + Remixer + + + Record Label + + + Vocals + + + Backing Vocals + + + Guitar + + + Bass Guitar + + + Drums + + + Percussion + + + Keyboards + + + Piano + + + Synthesizer + + + Strings + + + Woodwinds + + + Brass + + + Orchestrator + + + User + + + MusicBrainz + + + Discogs + + + Last.fm + + + Afghanistan + + + Albania + + + Algeria + + + Andorra + + + Angola + + + Antigua & Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaijan + + + Bahamas + + + Bahrain + + + Bangladesh + + + Barbados + + + Belarus + + + Belgium + + + Belize + + + Benin + + + Bhutan + + + Bolivia + + + Bosnia & Herzegovina + + + Botswana + + + Brazil + + + Brunei + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Cape Verde + + + Cambodia + + + Cameroon + + + Canada + + + Central African Republic + + + Chad + + + Chile + + + China + + + Colombia + + + Comoros + + + Congo - Brazzaville + + + Congo - Kinshasa + + + Costa Rica + + + Côte d’Ivoire + + + Croatia + + + Cuba + + + Cyprus + + + Czechia + + + Denmark + + + Djibouti + + + Dominica + + + Dominican Republic + + + Ecuador + + + Egypt + + + El Salvador + + + Equatorial Guinea + + + Eritrea + + + Estonia + + + Eswatini + + + Ethiopia + + + Fiji + + + Finland + + + France + + + Gabon + + + Gambia + + + Georgia + + + Germany + + + Ghana + + + Greece + + + Grenada + + + Guatemala + + + Guinea + + + Guinea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Hungary + + + Iceland + + + India + + + Indonesia + + + Iran + + + Iraq + + + Ireland + + + Israel + + + Italy + + + Jamaica + + + Japan + + + Jordan + + + Kazakhstan + + + Kenya + + + Kiribati + + + North Korea + + + South Korea + + + Kuwait + + + Kyrgyzstan + + + Laos + + + Latvia + + + Lebanon + + + Lesotho + + + Liberia + + + Libya + + + Liechtenstein + + + Lithuania + + + Luxembourg + + + Madagascar + + + Malawi + + + Malaysia + + + Maldives + + + Mali + + + Malta + + + Marshall Islands + + + Mauritania + + + Mauritius + + + Mexico + + + Micronesia + + + Moldova + + + Monaco + + + Mongolia + + + Montenegro + + + Morocco + + + Mozambique + + + Myanmar (Burma) + + + Namibia + + + Nauru + + + Nepal + + + Netherlands + + + New Zealand + + + Nicaragua + + + Niger + + + Nigeria + + + North Macedonia + + + Norway + + + Oman + + + Pakistan + + + Palau + + + Palestinian Territories + + + Panama + + + Papua New Guinea + + + Paraguay + + + Peru + + + Philippines + + + Poland + + + Portugal + + + Qatar + + + Romania + + + Russia + + + Rwanda + + + St. Kitts & Nevis + + + St. Lucia + + + St. Vincent & Grenadines + + + Samoa + + + San Marino + + + São Tomé & Príncipe + + + Saudi Arabia + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Singapore + + + Slovakia + + + Slovenia + + + Solomon Islands + + + Somalia + + + South Africa + + + South Sudan + + + Spain + + + Sri Lanka + + + Sudan + + + Suriname + + + Sweden + + + Switzerland + + + Syria + + + Taiwan + + + Tajikistan + + + Tanzania + + + Thailand + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad & Tobago + + + Tunisia + + + Türkiye + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ukraine + + + United Arab Emirates + + + United Kingdom + + + United States + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + Vatican City + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabwe + + + Netherlands Antilles + + + Europe + + + Worldwide + + + Releases + + + Album + + + Broadcast + + + EP + + + Single + + + Audio drama + + + Audiobook + + + Compilation + + + DJ mix + + + Demo + + + Field recording + + + Interview + + + Live + + + Mixtape + + + Remix + + + Soundtrack + + + Spoken word + + + Performer + + + The name of the artist. + + + The name used to sort the artist, when it differs from the display name. + + + A comment that distinguishes the artist from others with the same name. + + + The type of the artist, like a person or a group. + + + The gender of the artist. + + + The two letter code of the country of the artist. + + + The official website of the artist. + + + The MusicBrainz identifier of the artist. + + + The Interested Parties Information numbers of the artist. + + + The International Standard Name Identifiers of the artist. + + + The date when the artist began its activity. + + + The date when the artist ended its activity. + + + Whether the artist is no longer active. + + + The genres of the artist. + + + The tags of the artist. + + + The name of the area. + + + The name used to sort the area. + + + A comment that distinguishes the area from others with the same name. + + + The type of the area. + + + The ISO 3166 code of the area. + + + The MusicBrainz identifier of the area. + + + The alternative names of the artist. + + + The people that contributed to the artist. + + + The ratings of the artist from different sources. + + + Change cover + + + Cover image + + + No cover + + + The cover image was updated. + + + The cover image could not be uploaded. + + + Genre + + + Add genre + + + Tag + + + Add tag + + + IPI + + + Add IPI + + + ISNI + + + Add ISNI + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ro-RO.resx new file mode 100644 index 00000000..6f23f468 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.ro-RO.resx @@ -0,0 +1,1086 @@ + + + + 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 + + + Înapoi la artiști + + + Editează artist + + + Salvare + + + Artistul a fost salvat. + + + Elementul nu a putut fi salvat. + + + Șterge artist + + + Artistul a fost șters. + + + Sigur doriți să ștergeți acest element? + + + Elementul nu a putut fi șters. + + + Informații Generale + + + Nume + + + Nume de sortare + + + Dezambiguizare + + + Tip + + + Gen + + + Țară + + + Site web + + + Id artist MusicBrainz + + + IPIs + + + ISNIs + + + Data de început + + + Data de sfârșit + + + Încheiat + + + Genuri + + + Etichete + + + Zone + + + Zonă + + + Zona de început + + + Zona de sfârșit + + + Nume + + + Nume de sortare + + + Dezambiguizare + + + Tip + + + Cod ISO 3166 + + + Id zonă MusicBrainz + + + Aliasuri + + + Nume + + + Nume de sortare + + + Tip + + + Setare regională + + + Principal + + + Data de început + + + Data de sfârșit + + + Încheiat + + + Adaugă alias + + + Contribuitori + + + Id contribuitor + + + Rol + + + Adaugă contributor + + + Ratinguri + + + Rating + + + Rating maxim + + + Sursă + + + Număr de voturi + + + Adaugă rating + + + Elimină + + + Albume + + + Acest artist nu are albume + + + Albumul a fost șters. + + + Persoană + + + Grup + + + Orchestră + + + Cor + + + Personaj + + + Altele + + + Masculin + + + Feminin + + + Nu se aplică + + + Autor + + + Traducător + + + Ilustrator + + + Editor + + + Narator + + + Actor + + + Regizor + + + Scenarist + + + Compozitor + + + Textier + + + Aranjor + + + Dirijor + + + Producător + + + Producător executiv + + + Inginer de sunet + + + Mixer + + + Remixer + + + Casă de discuri + + + Voce + + + Voci de acompaniament + + + Chitară + + + Chitară bas + + + Tobe + + + Percuție + + + Claviaturi + + + Pian + + + Sintetizator + + + Instrumente cu corzi + + + Instrumente de suflat din lemn + + + Instrumente de suflat din alamă + + + Orchestrator + + + Utilizator + + + MusicBrainz + + + Discogs + + + Last.fm + + + Afganistan + + + Albania + + + Algeria + + + Andorra + + + Angola + + + Antigua și Barbuda + + + Argentina + + + Armenia + + + Australia + + + Austria + + + Azerbaidjan + + + Bahamas + + + Bahrain + + + Bangladesh + + + Barbados + + + Belarus + + + Belgia + + + Belize + + + Benin + + + Bhutan + + + Bolivia + + + Bosnia și Herțegovina + + + Botswana + + + Brazilia + + + Brunei + + + Bulgaria + + + Burkina Faso + + + Burundi + + + Capul Verde + + + Cambodgia + + + Camerun + + + Canada + + + Republica Centrafricană + + + Ciad + + + Chile + + + China + + + Columbia + + + Comore + + + Congo - Brazzaville + + + Congo - Kinshasa + + + Costa Rica + + + Coasta de Fildeș + + + Croația + + + Cuba + + + Cipru + + + Cehia + + + Danemarca + + + Djibouti + + + Dominica + + + Republica Dominicană + + + Ecuador + + + Egipt + + + El Salvador + + + Guineea Ecuatorială + + + Eritreea + + + Estonia + + + Eswatini + + + Etiopia + + + Fiji + + + Finlanda + + + Franța + + + Gabon + + + Gambia + + + Georgia + + + Germania + + + Ghana + + + Grecia + + + Grenada + + + Guatemala + + + Guineea + + + Guineea-Bissau + + + Guyana + + + Haiti + + + Honduras + + + Ungaria + + + Islanda + + + India + + + Indonezia + + + Iran + + + Irak + + + Irlanda + + + Israel + + + Italia + + + Jamaica + + + Japonia + + + Iordania + + + Kazahstan + + + Kenya + + + Kiribati + + + Coreea de Nord + + + Coreea de Sud + + + Kuweit + + + Kârgâzstan + + + Laos + + + Letonia + + + Liban + + + Lesotho + + + Liberia + + + Libia + + + Liechtenstein + + + Lituania + + + Luxemburg + + + Madagascar + + + Malawi + + + Malaysia + + + Maldive + + + Mali + + + Malta + + + Insulele Marshall + + + Mauritania + + + Mauritius + + + Mexic + + + Micronezia + + + Moldova + + + Monaco + + + Mongolia + + + Muntenegru + + + Maroc + + + Mozambic + + + Myanmar (Birmania) + + + Namibia + + + Nauru + + + Nepal + + + Țările de Jos + + + Noua Zeelandă + + + Nicaragua + + + Niger + + + Nigeria + + + Macedonia de Nord + + + Norvegia + + + Oman + + + Pakistan + + + Palau + + + Teritoriile Palestiniene + + + Panama + + + Papua Noua Guinee + + + Paraguay + + + Peru + + + Filipine + + + Polonia + + + Portugalia + + + Qatar + + + România + + + Rusia + + + Rwanda + + + Saint Kitts și Nevis + + + Sfânta Lucia + + + Saint Vincent și Grenadine + + + Samoa + + + San Marino + + + São Tomé și Príncipe + + + Arabia Saudită + + + Senegal + + + Serbia + + + Seychelles + + + Sierra Leone + + + Singapore + + + Slovacia + + + Slovenia + + + Insulele Solomon + + + Somalia + + + Africa de Sud + + + Sudanul de Sud + + + Spania + + + Sri Lanka + + + Sudan + + + Suriname + + + Suedia + + + Elveția + + + Siria + + + Taiwan + + + Tadjikistan + + + Tanzania + + + Thailanda + + + Timor-Leste + + + Togo + + + Tonga + + + Trinidad și Tobago + + + Tunisia + + + Turcia + + + Turkmenistan + + + Tuvalu + + + Uganda + + + Ucraina + + + Emiratele Arabe Unite + + + Regatul Unit + + + Statele Unite + + + Uruguay + + + Uzbekistan + + + Vanuatu + + + Vatican + + + Venezuela + + + Vietnam + + + Yemen + + + Zambia + + + Zimbabwe + + + Antilele Neerlandeze + + + Europa + + + La nivel mondial + + + Publicații + + + Album + + + Emisiune + + + EP + + + Single + + + Dramă audio + + + Carte audio + + + Compilație + + + Mix DJ + + + Demo + + + Înregistrare de teren + + + Interviu + + + Live + + + Mixtape + + + Remix + + + Coloană sonoră + + + Text recitat + + + Interpret + + + Numele artistului. + + + Numele folosit pentru sortarea artistului, când acesta diferă de numele afișat. + + + Un comentariu care distinge artistul de alții cu același nume. + + + Tipul artistului, cum ar fi o persoană sau un grup. + + + Genul artistului. + + + Codul din două litere al țării artistului. + + + Site-ul web oficial al artistului. + + + Identificatorul MusicBrainz al artistului. + + + Numerele de informații ale părților interesate ale artistului. + + + Identificatorii internaționali standard de nume ai artistului. + + + Data la care artistul și-a început activitatea. + + + Data la care artistul și-a încheiat activitatea. + + + Dacă artistul nu mai este activ. + + + Genurile artistului. + + + Etichetele artistului. + + + Numele zonei. + + + Numele folosit pentru sortarea zonei. + + + Un comentariu care distinge zona de altele cu același nume. + + + Tipul zonei. + + + Codul ISO 3166 al zonei. + + + Identificatorul MusicBrainz al zonei. + + + Numele alternative ale artistului. + + + Persoanele care au contribuit la artist. + + + Evaluările artistului din surse diferite. + + + Schimbă coperta + + + Imagine de copertă + + + Fără copertă + + + Imaginea de copertă a fost actualizată. + + + Imaginea de copertă nu a putut fi încărcată. + + + Gen + + + Adaugă gen + + + Etichetă + + + Adaugă etichetă + + + IPI + + + Adaugă IPI + + + ISNI + + + Adaugă ISNI + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.uk-UA.resx new file mode 100644 index 00000000..5bbfe32d --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.uk-UA.resx @@ -0,0 +1,1086 @@ + + + + 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 + + + Повернутися до виконавців + + + Редагувати виконавця + + + Зберегти + + + Виконавця збережено. + + + Не вдалося зберегти елемент. + + + Видалити виконавця + + + Виконавця видалено. + + + Ви впевнені, що хочете видалити цей елемент? + + + Не вдалося видалити елемент. + + + Загальна інформація + + + Ім'я + + + Назва для сортування + + + Уточнення + + + Тип + + + Стать + + + Країна + + + Вебсайт + + + Ідентифікатор виконавця MusicBrainz + + + IPIs + + + ISNIs + + + Дата початку + + + Дата закінчення + + + Завершено + + + Жанри + + + Теги + + + Області + + + Область + + + Початкова область + + + Кінцева область + + + Ім'я + + + Назва для сортування + + + Уточнення + + + Тип + + + Код ISO 3166 + + + Ідентифікатор області MusicBrainz + + + Псевдоніми + + + Ім'я + + + Назва для сортування + + + Тип + + + Локаль + + + Основний + + + Дата початку + + + Дата закінчення + + + Завершено + + + Додати псевдонім + + + Учасники + + + Ідентифікатор учасника + + + Роль + + + Додати учасника + + + Оцінки + + + Оцінка + + + Максимальна оцінка + + + Джерело + + + Кількість голосів + + + Додати оцінку + + + Видалити + + + Альбоми + + + У цього виконавця немає альбомів + + + Альбом видалено. + + + Особа + + + Гурт + + + Оркестр + + + Хор + + + Персонаж + + + Інше + + + Чоловіча + + + Жіноча + + + Не застосовно + + + Автор + + + Перекладач + + + Ілюстратор + + + Видавець + + + Оповідач + + + Актор + + + Режисер + + + Сценарист + + + Композитор + + + Автор текстів + + + Аранжувальник + + + Диригент + + + Продюсер + + + Виконавчий продюсер + + + Інженер + + + Мікшер + + + Реміксер + + + Лейбл звукозапису + + + Вокал + + + Бек-вокал + + + Гітара + + + Бас-гітара + + + Барабани + + + Перкусія + + + Клавішні + + + Піаніно + + + Синтезатор + + + Струнні + + + Дерев'яні духові + + + Мідні духові + + + Оркестратор + + + Користувач + + + MusicBrainz + + + Discogs + + + Last.fm + + + Афганістан + + + Албанія + + + Алжир + + + Андорра + + + Ангола + + + Антигуа і Барбуда + + + Аргентина + + + Вірменія + + + Австралія + + + Австрія + + + Азербайджан + + + Багамські острови + + + Бахрейн + + + Бангладеш + + + Барбадос + + + Білорусь + + + Бельгія + + + Беліз + + + Бенін + + + Бутан + + + Болівія + + + Боснія і Герцеговина + + + Ботсвана + + + Бразилія + + + Бруней + + + Болгарія + + + Буркіна-Фасо + + + Бурунді + + + Кабо-Верде + + + Камбоджа + + + Камерун + + + Канада + + + Центральноафриканська Республіка + + + Чад + + + Чилі + + + Китай + + + Колумбія + + + Коморські острови + + + Конго - Браззавіль + + + Конго - Кіншаса + + + Коста-Рика + + + Кот-д'Івуар + + + Хорватія + + + Куба + + + Кіпр + + + Чехія + + + Данія + + + Джибуті + + + Домініка + + + Домініканська Республіка + + + Еквадор + + + Єгипет + + + Сальвадор + + + Екваторіальна Гвінея + + + Еритрея + + + Естонія + + + Есватіні + + + Ефіопія + + + Фіджі + + + Фінляндія + + + Франція + + + Габон + + + Гамбія + + + Грузія + + + Німеччина + + + Гана + + + Греція + + + Гренада + + + Гватемала + + + Гвінея + + + Гвінея-Бісау + + + Гаяна + + + Гаїті + + + Гондурас + + + Угорщина + + + Ісландія + + + Індія + + + Індонезія + + + Іран + + + Ірак + + + Ірландія + + + Ізраїль + + + Італія + + + Ямайка + + + Японія + + + Йорданія + + + Казахстан + + + Кенія + + + Кірибаті + + + Північна Корея + + + Південна Корея + + + Кувейт + + + Киргизстан + + + Лаос + + + Латвія + + + Ліван + + + Лесото + + + Ліберія + + + Лівія + + + Ліхтенштейн + + + Литва + + + Люксембург + + + Мадагаскар + + + Малаві + + + Малайзія + + + Мальдіви + + + Малі + + + Мальта + + + Маршаллові Острови + + + Мавританія + + + Маврикій + + + Мексика + + + Мікронезія + + + Молдова + + + Монако + + + Монголія + + + Чорногорія + + + Марокко + + + Мозамбік + + + М'янма (Бірма) + + + Намібія + + + Науру + + + Непал + + + Нідерланди + + + Нова Зеландія + + + Нікарагуа + + + Нігер + + + Нігерія + + + Північна Македонія + + + Норвегія + + + Оман + + + Пакистан + + + Палау + + + Палестинські території + + + Панама + + + Папуа-Нова Гвінея + + + Парагвай + + + Перу + + + Філіппіни + + + Польща + + + Португалія + + + Катар + + + Румунія + + + Росія + + + Руанда + + + Сент-Кітс і Невіс + + + Сент-Люсія + + + Сент-Вінсент і Гренадини + + + Самоа + + + Сан-Марино + + + Сан-Томе і Принсіпі + + + Саудівська Аравія + + + Сенегал + + + Сербія + + + Сейшельські Острови + + + Сьєрра-Леоне + + + Сінгапур + + + Словаччина + + + Словенія + + + Соломонові Острови + + + Сомалі + + + Південно-Африканська Республіка + + + Південний Судан + + + Іспанія + + + Шрі-Ланка + + + Судан + + + Суринам + + + Швеція + + + Швейцарія + + + Сирія + + + Тайвань + + + Таджикистан + + + Танзанія + + + Таїланд + + + Тимор-Лешті + + + Того + + + Тонга + + + Тринідад і Тобаго + + + Туніс + + + Туреччина + + + Туркменістан + + + Тувалу + + + Уганда + + + Україна + + + Об'єднані Арабські Емірати + + + Велика Британія + + + Сполучені Штати Америки + + + Уругвай + + + Узбекистан + + + Вануату + + + Ватикан + + + Венесуела + + + В'єтнам + + + Ємен + + + Замбія + + + Зімбабве + + + Нідерландські Антильські острови + + + Європа + + + Увесь світ + + + Релізи + + + Альбом + + + Трансляція + + + EP + + + Сингл + + + Аудіодрама + + + Аудіокнига + + + Збірка + + + DJ-мікс + + + Демо + + + Польовий запис + + + Інтерв'ю + + + Наживо + + + Мікстейп + + + Ремікс + + + Саундтрек + + + Усне слово + + + Виконавець + + + Ім'я виконавця. + + + Ім'я, яке використовується для сортування виконавця, коли воно відрізняється від відображуваного імені. + + + Коментар, який відрізняє виконавця від інших з тим самим ім'ям. + + + Тип виконавця, наприклад особа чи гурт. + + + Стать виконавця. + + + Дволітерний код країни виконавця. + + + Офіційний вебсайт виконавця. + + + Ідентифікатор виконавця у MusicBrainz. + + + Номери IPI виконавця. + + + Ідентифікатори ISNI виконавця. + + + Дата початку діяльності виконавця. + + + Дата завершення діяльності виконавця. + + + Чи виконавець більше не активний. + + + Жанри виконавця. + + + Теги виконавця. + + + Назва області. + + + Ім'я, яке використовується для сортування області. + + + Коментар, який відрізняє область від інших з тією самою назвою. + + + Тип області. + + + Код ISO 3166 області. + + + Ідентифікатор області у MusicBrainz. + + + Альтернативні імена виконавця. + + + Люди, які зробили внесок у виконавця. + + + Оцінки виконавця з різних джерел. + + + Змінити обкладинку + + + Зображення обкладинки + + + Немає обкладинки + + + Зображення обкладинки оновлено. + + + Не вдалося завантажити зображення обкладинки. + + + Жанр + + + Додати жанр + + + Тег + + + Додати тег + + + IPI + + + Додати IPI + + + ISNI + + + Додати ISNI + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.zh-CN.resx new file mode 100644 index 00000000..e1f06152 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.zh-CN.resx @@ -0,0 +1,1086 @@ + + + + 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 + + + 返回艺术家 + + + 编辑艺术家 + + + 保存 + + + 艺术家已保存。 + + + 无法保存该项目。 + + + 删除艺术家 + + + 艺术家已删除。 + + + 确定要删除此项目吗? + + + 无法删除该项目。 + + + 常规信息 + + + 名称 + + + 排序名称 + + + 消歧义 + + + 类型 + + + 性别 + + + 国家 + + + 网站 + + + MusicBrainz 艺术家 Id + + + IPIs + + + ISNIs + + + 开始日期 + + + 结束日期 + + + 已结束 + + + 体裁 + + + 标签 + + + 地区 + + + 地区 + + + 起始地区 + + + 结束地区 + + + 名称 + + + 排序名称 + + + 消歧义 + + + 类型 + + + ISO 3166 代码 + + + MusicBrainz 地区 Id + + + 别名 + + + 名称 + + + 排序名称 + + + 类型 + + + 区域设置 + + + 主要 + + + 开始日期 + + + 结束日期 + + + 已结束 + + + 添加别名 + + + 贡献者 + + + 贡献者 Id + + + 角色 + + + 添加贡献者 + + + 评分 + + + 评分 + + + 最高评分 + + + 来源 + + + 票数 + + + 添加评分 + + + 删除 + + + 专辑 + + + 此艺术家没有专辑 + + + 专辑已删除。 + + + 个人 + + + 团体 + + + 管弦乐团 + + + 合唱 + + + 角色 + + + 其他 + + + 男 + + + 女 + + + 不适用 + + + 作者 + + + 译者 + + + 插画师 + + + 出版商 + + + 旁白 + + + 演员 + + + 导演 + + + 编剧 + + + 作曲 + + + 作词 + + + 编曲 + + + 指挥 + + + 制作人 + + + 执行制作人 + + + 工程师 + + + 混音师 + + + 重混师 + + + 唱片公司 + + + 人声 + + + 和声 + + + 吉他 + + + 贝斯 + + + 鼓 + + + 打击乐 + + + 键盘 + + + 钢琴 + + + 合成器 + + + 弦乐 + + + 木管乐 + + + 铜管乐 + + + 配器 + + + 用户 + + + MusicBrainz + + + Discogs + + + Last.fm + + + 阿富汗 + + + 阿尔巴尼亚 + + + 阿尔及利亚 + + + 安道尔 + + + 安哥拉 + + + 安提瓜和巴布达 + + + 阿根廷 + + + 亚美尼亚 + + + 澳大利亚 + + + 奥地利 + + + 阿塞拜疆 + + + 巴哈马 + + + 巴林 + + + 孟加拉国 + + + 巴巴多斯 + + + 白俄罗斯 + + + 比利时 + + + 伯利兹 + + + 贝宁 + + + 不丹 + + + 玻利维亚 + + + 波斯尼亚和黑塞哥维那 + + + 博茨瓦纳 + + + 巴西 + + + 文莱 + + + 保加利亚 + + + 布基纳法索 + + + 布隆迪 + + + 佛得角 + + + 柬埔寨 + + + 喀麦隆 + + + 加拿大 + + + 中非共和国 + + + 乍得 + + + 智利 + + + 中国 + + + 哥伦比亚 + + + 科摩罗 + + + 刚果(布拉柴维尔) + + + 刚果(金沙萨) + + + 哥斯达黎加 + + + 科特迪瓦 + + + 克罗地亚 + + + 古巴 + + + 塞浦路斯 + + + 捷克 + + + 丹麦 + + + 吉布提 + + + 多米尼克 + + + 多米尼加共和国 + + + 厄瓜多尔 + + + 埃及 + + + 萨尔瓦多 + + + 赤道几内亚 + + + 厄立特里亚 + + + 爱沙尼亚 + + + 斯威士兰 + + + 埃塞俄比亚 + + + 斐济 + + + 芬兰 + + + 法国 + + + 加蓬 + + + 冈比亚 + + + 格鲁吉亚 + + + 德国 + + + 加纳 + + + 希腊 + + + 格林纳达 + + + 危地马拉 + + + 几内亚 + + + 几内亚比绍 + + + 圭亚那 + + + 海地 + + + 洪都拉斯 + + + 匈牙利 + + + 冰岛 + + + 印度 + + + 印度尼西亚 + + + 伊朗 + + + 伊拉克 + + + 爱尔兰 + + + 以色列 + + + 意大利 + + + 牙买加 + + + 日本 + + + 约旦 + + + 哈萨克斯坦 + + + 肯尼亚 + + + 基里巴斯 + + + 朝鲜 + + + 韩国 + + + 科威特 + + + 吉尔吉斯斯坦 + + + 老挝 + + + 拉脱维亚 + + + 黎巴嫩 + + + 莱索托 + + + 利比里亚 + + + 利比亚 + + + 列支敦士登 + + + 立陶宛 + + + 卢森堡 + + + 马达加斯加 + + + 马拉维 + + + 马来西亚 + + + 马尔代夫 + + + 马里 + + + 马耳他 + + + 马绍尔群岛 + + + 毛里塔尼亚 + + + 毛里求斯 + + + 墨西哥 + + + 密克罗尼西亚 + + + 摩尔多瓦 + + + 摩纳哥 + + + 蒙古 + + + 黑山 + + + 摩洛哥 + + + 莫桑比克 + + + 缅甸 + + + 纳米比亚 + + + 瑙鲁 + + + 尼泊尔 + + + 荷兰 + + + 新西兰 + + + 尼加拉瓜 + + + 尼日尔 + + + 尼日利亚 + + + 北马其顿 + + + 挪威 + + + 阿曼 + + + 巴基斯坦 + + + 帕劳 + + + 巴勒斯坦领土 + + + 巴拿马 + + + 巴布亚新几内亚 + + + 巴拉圭 + + + 秘鲁 + + + 菲律宾 + + + 波兰 + + + 葡萄牙 + + + 卡塔尔 + + + 罗马尼亚 + + + 俄罗斯 + + + 卢旺达 + + + 圣基茨和尼维斯 + + + 圣卢西亚 + + + 圣文森特和格林纳丁斯 + + + 萨摩亚 + + + 圣马力诺 + + + 圣多美和普林西比 + + + 沙特阿拉伯 + + + 塞内加尔 + + + 塞尔维亚 + + + 塞舌尔 + + + 塞拉利昂 + + + 新加坡 + + + 斯洛伐克 + + + 斯洛文尼亚 + + + 所罗门群岛 + + + 索马里 + + + 南非 + + + 南苏丹 + + + 西班牙 + + + 斯里兰卡 + + + 苏丹 + + + 苏里南 + + + 瑞典 + + + 瑞士 + + + 叙利亚 + + + 台湾 + + + 塔吉克斯坦 + + + 坦桑尼亚 + + + 泰国 + + + 东帝汶 + + + 多哥 + + + 汤加 + + + 特立尼达和多巴哥 + + + 突尼斯 + + + 土耳其 + + + 土库曼斯坦 + + + 图瓦卢 + + + 乌干达 + + + 乌克兰 + + + 阿拉伯联合酋长国 + + + 英国 + + + 美国 + + + 乌拉圭 + + + 乌兹别克斯坦 + + + 瓦努阿图 + + + 梵蒂冈 + + + 委内瑞拉 + + + 越南 + + + 也门 + + + 赞比亚 + + + 津巴布韦 + + + 荷属安的列斯 + + + 欧洲 + + + 全球 + + + 发行 + + + 专辑 + + + 广播 + + + EP + + + 单曲 + + + 音频剧 + + + 有声书 + + + 合辑 + + + DJ 混音 + + + 小样 + + + 实地录音 + + + 访谈 + + + 现场 + + + 混音带 + + + 混音版 + + + 原声带 + + + 口语 + + + 表演者 + + + 艺术家名称。 + + + 与显示名称不同时用于对艺术家排序的名称。 + + + 用于将艺术家与同名者区分开的说明。 + + + 艺术家的类型,例如个人或团体。 + + + 艺术家的性别。 + + + 艺术家的国家/地区两字母代码。 + + + 艺术家的官方网站。 + + + 艺术家的MusicBrainz标识符。 + + + 艺术家的利害关系方信息编号。 + + + 艺术家的国际标准名称标识符。 + + + 艺术家开始活动的日期。 + + + 艺术家结束活动的日期。 + + + 艺术家是否已停止活动。 + + + 艺术家的流派。 + + + 艺术家的标签。 + + + 地区名称。 + + + 用于对地区排序的名称。 + + + 用于将该地区与同名地区区分开的说明。 + + + 地区的类型。 + + + 地区的ISO 3166代码。 + + + 地区的MusicBrainz标识符。 + + + 艺术家的别名。 + + + 为艺术家做出贡献的人员。 + + + 来自不同来源的艺术家评分。 + + + 更改封面 + + + 封面图片 + + + 无封面 + + + 封面图片已更新。 + + + 无法上传封面图片。 + + + 流派 + + + 添加流派 + + + 标签 + + + 添加标签 + + + IPI + + + 添加 IPI + + + ISNI + + + 添加 ISNI + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ar-SA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ar-SA.resx new file mode 100644 index 00000000..2bf6599a --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ar-SA.resx @@ -0,0 +1,1182 @@ + + + + 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 + + + العودة إلى الألبوم + + + تعديل المقطع + + + حفظ + + + تم حفظ المقطع. + + + تعذر حفظ العنصر. + + + حذف المقطع + + + تم حذف المقطع. + + + هل أنت متأكد من أنك تريد حذف هذا العنصر؟ + + + تعذر حذف العنصر. + + + معلومات عامة + + + المسار + + + العنوان + + + العنوان الأصلي + + + رقم المقطع + + + رقم القرص + + + الكتابة + + + المفتاح + + + BPM + + + الأنواع + + + الوسوم + + + المدة (بالثواني) + + + المعرّفات + + + معرّف التسجيل MusicBrainz + + + معرّف مقطع MusicBrainz + + + العمل + + + عنوان العمل + + + معرّف MusicBrainz للعمل + + + المزاجات + + + ISRCs + + + دو كبير + + + دو# كبير + + + ري كبير + + + ري# كبير + + + مي كبير + + + فا كبير + + + فا# كبير + + + صول كبير + + + صول# كبير + + + لا كبير + + + لا# كبير + + + سي كبير + + + دو صغير + + + دو# صغير + + + ري صغير + + + ري# صغير + + + مي صغير + + + فا صغير + + + فا# صغير + + + صول صغير + + + صول# صغير + + + لا صغير + + + لا# صغير + + + سي صغير + + + مسار الملف للمقطوعة. + + + عنوان المقطوعة. + + + العنوان الأصلي للمقطوعة عندما يختلف عن الحالي. + + + موضع المقطوعة على القرص. + + + رقم القرص الذي تنتمي إليه المقطوعة. + + + الكتابة المستخدمة في لغة المقطوعة. + + + المقام الموسيقي للمقطوعة. + + + سرعة المقطوعة بعدد النبضات في الدقيقة. + + + الأنواع الموسيقية الخاصة بالمقطع. + + + الوسوم الخاصة بالمقطع. + + + مدة المقطوعة بالثواني. + + + معرّف MusicBrainz للتسجيل. + + + معرّف MusicBrainz للمقطوعة. + + + عنوان العمل الذي سُجلت منه المقطوعة. + + + معرّف MusicBrainz للعمل. + + + الحالات المزاجية الخاصة بالمقطع. + + + رموز ISRC الخاصة بالمقطع. + + + الوصف + + + ملخص قصير أو وصف للمقطع. + + + إزالة الالتباس + + + تعليق يميز المقطع عن غيره ممن يحملون العنوان نفسه. + + + تسجيل فيديو + + + ما إذا كان تسجيل المقطع تسجيل فيديو. + + + معلومات الإصدار + + + تاريخ الإصدار الأصلي + + + تاريخ الإصدار الأول للمقطع. + + + سنة الإصدار الأصلية + + + السنة التي صدر فيها المقطع أول مرة. + + + تاريخ إعادة الإصدار + + + تاريخ إعادة إصدار المقطع. + + + سنة إعادة الإصدار + + + السنة التي أعيد فيها إصدار المقطع. + + + بلد الإصدار + + + بلد إصدار المقطع. + + + إصدار النسخة + + + نسخة الإصدار، مثل النسخة الأصلية. + + + اللغة + + + اللغة الأصلية + + + خصائص الصوت + + + معدل أخذ العينات (Hz) + + + معدل أخذ العينات لصوت المقطع بالهرتز (Hz). + + + القنوات + + + عدد قنوات الصوت في المقطع. + + + عمق البت + + + عمق بت صوت المقطع. + + + ترميز الصوت + + + ترميز الصوت المستخدم في المقطع. + + + معدل البت (kbps) + + + معدل البت لصوت المقطع بالكيلوبت في الثانية (kbps). + + + AcoustID + + + معرّف بصمة AcoustID لملف صوت المقطع. + + + ReplayGain + + + كسب المقطع (dB) + + + كسب ReplayGain للمقطع بالديسيبل. + + + ذروة المقطع + + + ذروة ReplayGain للمقطع. + + + كسب الألبوم (dB) + + + كسب ReplayGain للألبوم بالديسيبل. + + + ذروة الألبوم + + + ذروة ReplayGain للألبوم. + + + نوع العمل + + + نوع العمل في MusicBrainz، مثل أغنية. + + + أكواد ISWC للعمل + + + رموز ISWC الخاصة بالعمل. + + + لغات العمل + + + لغات العمل. + + + الرمز + + + الاسم + + + الاسم الأصلي + + + إضافة لغة + + + رمز الحرفين للغة المقطع. + + + اسم لغة المقطع. + + + الاسم الأصلي للغة المقطع. + + + رمز اللغة + + + اسم اللغة + + + الاسم الأصلي للغة + + + المساهمون + + + معرّف المساهم + + + الدور + + + إضافة مساهم + + + الأشخاص الذين ساهموا في الفنان. + + + التقييمات + + + التقييم + + + أقصى تقييم + + + المصدر + + + عدد الأصوات + + + إضافة تقييم + + + تقييمات الفنان من مصادر مختلفة. + + + إزالة + + + آخر + + + مؤلف + + + مترجم + + + رسام + + + ناشر + + + راوٍ + + + ممثل + + + مخرج + + + كاتب سيناريو + + + ملحن + + + كاتب كلمات + + + موزع + + + قائد أوركسترا + + + منتج + + + منتج تنفيذي + + + مهندس صوت + + + خالط صوت + + + معيد المزج + + + شركة تسجيلات + + + غناء + + + غناء مساند + + + غيتار + + + غيتار باس + + + طبول + + + إيقاع + + + لوحات المفاتيح + + + بيانو + + + مركب صوتي + + + آلات وترية + + + آلات نفخ خشبية + + + آلات نفخ نحاسية + + + جوقة + + + منسق أوركسترالي + + + مؤدٍ + + + المستخدم + + + MusicBrainz + + + Discogs + + + Last.fm + + + أندورا + + + الإمارات العربية المتحدة + + + أفغانستان + + + أنتيغوا وبربودا + + + ألبانيا + + + أرمينيا + + + جزر الأنتيل الهولندية + + + أنغولا + + + الأرجنتين + + + النمسا + + + أستراليا + + + أذربيجان + + + البوسنة والهرسك + + + بربادوس + + + بنغلاديش + + + بلجيكا + + + بوركينا فاسو + + + بلغاريا + + + البحرين + + + بوروندي + + + بنين + + + بروناي + + + بوليفيا + + + البرازيل + + + الباهاما + + + بوتان + + + بوتسوانا + + + بيلاروسيا + + + بليز + + + كندا + + + الكونغو - كينشاسا + + + جمهورية أفريقيا الوسطى + + + الكونغو - برازافيل + + + سويسرا + + + ساحل العاج + + + تشيلي + + + الكاميرون + + + الصين + + + كولومبيا + + + كوستاريكا + + + كوبا + + + الرأس الأخضر + + + قبرص + + + التشيك + + + ألمانيا + + + جيبوتي + + + الدنمارك + + + دومينيكا + + + جمهورية الدومينيكان + + + الجزائر + + + الإكوادور + + + إستونيا + + + مصر + + + إريتريا + + + إسبانيا + + + إثيوبيا + + + فنلندا + + + فيجي + + + ميكرونيزيا + + + فرنسا + + + الغابون + + + المملكة المتحدة + + + غرينادا + + + جورجيا + + + غانا + + + غامبيا + + + غينيا + + + غينيا الاستوائية + + + اليونان + + + غواتيمالا + + + غينيا بيساو + + + غيانا + + + هندوراس + + + كرواتيا + + + هايتي + + + هنغاريا + + + إندونيسيا + + + أيرلندا + + + إسرائيل + + + الهند + + + العراق + + + إيران + + + آيسلندا + + + إيطاليا + + + جامايكا + + + الأردن + + + اليابان + + + كينيا + + + قيرغيزستان + + + كمبوديا + + + كيريباتي + + + جزر القمر + + + سانت كيتس ونيفيس + + + كوريا الشمالية + + + كوريا الجنوبية + + + الكويت + + + كازاخستان + + + لاوس + + + لبنان + + + سانت لوسيا + + + ليختنشتاين + + + سريلانكا + + + ليبيريا + + + ليسوتو + + + ليتوانيا + + + لوكسمبورغ + + + لاتفيا + + + ليبيا + + + المغرب + + + موناكو + + + مولدوفا + + + الجبل الأسود + + + مدغشقر + + + جزر مارشال + + + مقدونيا الشمالية + + + مالي + + + ميانمار (بورما) + + + منغوليا + + + موريتانيا + + + مالطا + + + موريشيوس + + + المالديف + + + مالاوي + + + المكسيك + + + ماليزيا + + + موزمبيق + + + ناميبيا + + + النيجر + + + نيجيريا + + + نيكاراغوا + + + هولندا + + + النرويج + + + نيبال + + + ناورو + + + نيوزيلندا + + + عُمان + + + بنما + + + بيرو + + + بابوا غينيا الجديدة + + + الفلبين + + + باكستان + + + بولندا + + + الأراضي الفلسطينية + + + البرتغال + + + بالاو + + + باراغواي + + + قطر + + + رومانيا + + + صربيا + + + روسيا + + + رواندا + + + المملكة العربية السعودية + + + جزر سليمان + + + سيشل + + + السودان + + + السويد + + + سنغافورة + + + سلوفينيا + + + سلوفاكيا + + + سيراليون + + + سان مارينو + + + السنغال + + + الصومال + + + سورينام + + + جنوب السودان + + + ساو تومي وبرينسيبي + + + السلفادور + + + سوريا + + + إسواتيني + + + تشاد + + + توغو + + + تايلاند + + + طاجيكستان + + + تيمور الشرقية + + + تركمانستان + + + تونس + + + تونغا + + + تركيا + + + ترينيداد وتوباغو + + + توفالو + + + تايوان + + + تنزانيا + + + أوكرانيا + + + أوغندا + + + الولايات المتحدة + + + أوروغواي + + + أوزبكستان + + + مدينة الفاتيكان + + + سانت فينسنت والغرينادين + + + فنزويلا + + + فيتنام + + + فانواتو + + + ساموا + + + أوروبا + + + العالم + + + اليمن + + + جنوب أفريقيا + + + زامبيا + + + زيمبابوي + + + النوع + + + إضافة نوع + + + وسم + + + إضافة وسم + + + المزاج + + + إضافة مزاج + + + ISRC + + + إضافة ISRC + + + ISWC + + + إضافة ISWC + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.de-DE.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.de-DE.resx new file mode 100644 index 00000000..43c6973b --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.de-DE.resx @@ -0,0 +1,1182 @@ + + + + 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 + + + Zurück zum Album + + + Titel bearbeiten + + + Speichern + + + Der Titel wurde gespeichert. + + + Das Element konnte nicht gespeichert werden. + + + Titel löschen + + + Der Titel wurde gelöscht. + + + Möchten Sie dieses Element wirklich löschen? + + + Das Element konnte nicht gelöscht werden. + + + Allgemeine Informationen + + + Pfad + + + Titel + + + Originaltitel + + + Titelnummer + + + Discnummer + + + Schrift + + + Tonart + + + BPM + + + Genres + + + Schlagwörter + + + Dauer (Sekunden) + + + Kennungen + + + MusicBrainz-Aufnahme-Id + + + MusicBrainz-Titel-Id + + + Werk + + + Werktitel + + + MusicBrainz-Id des Werks + + + Stimmungen + + + ISRCs + + + C-Dur + + + Cis-Dur + + + D-Dur + + + Dis-Dur + + + E-Dur + + + F-Dur + + + Fis-Dur + + + G-Dur + + + Gis-Dur + + + A-Dur + + + Ais-Dur + + + H-Dur + + + C-Moll + + + Cis-Moll + + + D-Moll + + + Dis-Moll + + + E-Moll + + + F-Moll + + + Fis-Moll + + + G-Moll + + + Gis-Moll + + + A-Moll + + + Ais-Moll + + + H-Moll + + + Der Dateisystempfad des Titels. + + + Der Titel des Titels. + + + Der Originaltitel des Titels, wenn er vom aktuellen abweicht. + + + Die Position des Titels auf seiner Disc. + + + Die Nummer der Disc, zu der der Titel gehört. + + + Die Schrift, die von der Sprache des Titels verwendet wird. + + + Die Tonart des Titels. + + + Das Tempo des Titels in Schlägen pro Minute. + + + Die Genres des Titels. + + + Die Tags des Titels. + + + Die Dauer des Titels in Sekunden. + + + Die MusicBrainz-Kennung der Aufnahme. + + + Die MusicBrainz-Kennung des Titels. + + + Der Titel des Werks, von dem der Titel eine Aufnahme ist. + + + Die MusicBrainz-Kennung des Werks. + + + Die Stimmungen des Titels. + + + Die ISRCs des Titels. + + + Beschreibung + + + Eine kurze Zusammenfassung oder Beschreibung des Titels. + + + Abgrenzung + + + Ein Kommentar, der den Titel von anderen mit demselben Namen unterscheidet. + + + Videoaufnahme + + + Ob es sich bei der Aufnahme des Titels um eine Videoaufnahme handelt. + + + Veröffentlichungsinformationen + + + Ursprüngliches Veröffentlichungsdatum + + + Das Datum, an dem der Titel ursprünglich veröffentlicht wurde. + + + Ursprüngliches Veröffentlichungsjahr + + + Das Jahr, in dem der Titel ursprünglich veröffentlicht wurde. + + + Erneutes Veröffentlichungsdatum + + + Das Datum, an dem der Titel erneut veröffentlicht wurde. + + + Erneutes Veröffentlichungsjahr + + + Das Jahr, in dem der Titel erneut veröffentlicht wurde. + + + Veröffentlichungsland + + + Das Land, in dem der Titel veröffentlicht wurde. + + + Veröffentlichungsversion + + + Die Version der Veröffentlichung, wie die ursprüngliche. + + + Sprache + + + Originalsprache + + + Audioeigenschaften + + + Abtastrate (Hz) + + + Die Abtastrate des Audios des Titels in Hz. + + + Kanäle + + + Die Anzahl der Audiokanäle des Titels. + + + Bittiefe + + + Die Bittiefe des Audios des Titels. + + + Audiocodec + + + Der vom Titel verwendete Audiocodec. + + + Bitrate (kbps) + + + Die Bitrate des Audios des Titels in kbps. + + + AcoustID + + + Die AcoustID-Fingerprint-Kennung der Audiodatei des Titels. + + + ReplayGain + + + Titelverstärkung (dB) + + + Die ReplayGain-Titelverstärkung des Titels in Dezibel. + + + Titelspitzenwert + + + Der ReplayGain-Titelspitzenwert des Titels. + + + Albumverstärkung (dB) + + + Die ReplayGain-Albumverstärkung des Titels in Dezibel. + + + Albumspitzenwert + + + Der ReplayGain-Albumspitzenwert des Titels. + + + Werktyp + + + Der MusicBrainz-Typ des Werks, wie Song. + + + Werk-ISWCs + + + Die ISWCs des Werks. + + + Werk-Sprachen + + + Die Sprachen des Werks. + + + Code + + + Name + + + Nativer Name + + + Sprache hinzufügen + + + Der zweibuchstabige Code der Sprache des Titels. + + + Der Name der Sprache des Titels. + + + Der native Name der Sprache des Titels. + + + Sprachcode + + + Sprachname + + + Muttersprachlicher Name + + + Mitwirkende + + + Mitwirkenden-Id + + + Rolle + + + Mitwirkenden hinzufügen + + + Die Personen, die zum Künstler beigetragen haben. + + + Bewertungen + + + Bewertung + + + Höchstbewertung + + + Quelle + + + Stimmenzahl + + + Bewertung hinzufügen + + + Die Bewertungen des Künstlers aus verschiedenen Quellen. + + + Entfernen + + + Sonstige + + + Autor + + + Übersetzer + + + Illustrator + + + Verlag + + + Erzähler + + + Schauspieler + + + Regisseur + + + Drehbuchautor + + + Komponist + + + Liedtexter + + + Arrangeur + + + Dirigent + + + Produzent + + + Ausführender Produzent + + + Toningenieur + + + Mixer + + + Remixer + + + Plattenlabel + + + Gesang + + + Hintergrundgesang + + + Gitarre + + + Bassgitarre + + + Schlagzeug + + + Perkussion + + + Keyboards + + + Klavier + + + Synthesizer + + + Streicher + + + Holzbläser + + + Blechbläser + + + Chor + + + Orchestrator + + + Interpret + + + Benutzer + + + MusicBrainz + + + Discogs + + + Last.fm + + + Andorra + + + Vereinigte Arabische Emirate + + + Afghanistan + + + Antigua und Barbuda + + + Albanien + + + Armenien + + + Niederländische Antillen + + + Angola + + + Argentinien + + + Österreich + + + Australien + + + Aserbaidschan + + + Bosnien und Herzegowina + + + Barbados + + + Bangladesch + + + Belgien + + + Burkina Faso + + + Bulgarien + + + Bahrain + + + Burundi + + + Benin + + + Brunei + + + Bolivien + + + Brasilien + + + Bahamas + + + Bhutan + + + Botsuana + + + Belarus + + + Belize + + + Kanada + + + Kongo - Kinshasa + + + Zentralafrikanische Republik + + + Kongo - Brazzaville + + + Schweiz + + + Côte d'Ivoire + + + Chile + + + Kamerun + + + China + + + Kolumbien + + + Costa Rica + + + Kuba + + + Kap Verde + + + Zypern + + + Tschechien + + + Deutschland + + + Dschibuti + + + Dänemark + + + Dominica + + + Dominikanische Republik + + + Algerien + + + Ecuador + + + Estland + + + Ägypten + + + Eritrea + + + Spanien + + + Äthiopien + + + Finnland + + + Fidschi + + + Mikronesien + + + Frankreich + + + Gabun + + + Vereinigtes Königreich + + + Grenada + + + Georgien + + + Ghana + + + Gambia + + + Guinea + + + Äquatorialguinea + + + Griechenland + + + Guatemala + + + Guinea-Bissau + + + Guyana + + + Honduras + + + Kroatien + + + Haiti + + + Ungarn + + + Indonesien + + + Irland + + + Israel + + + Indien + + + Irak + + + Iran + + + Island + + + Italien + + + Jamaika + + + Jordanien + + + Japan + + + Kenia + + + Kirgisistan + + + Kambodscha + + + Kiribati + + + Komoren + + + St. Kitts und Nevis + + + Nordkorea + + + Südkorea + + + Kuwait + + + Kasachstan + + + Laos + + + Libanon + + + St. Lucia + + + Liechtenstein + + + Sri Lanka + + + Liberia + + + Lesotho + + + Litauen + + + Luxemburg + + + Lettland + + + Libyen + + + Marokko + + + Monaco + + + Moldau + + + Montenegro + + + Madagaskar + + + Marshallinseln + + + Nordmazedonien + + + Mali + + + Myanmar (Burma) + + + Mongolei + + + Mauretanien + + + Malta + + + Mauritius + + + Malediven + + + Malawi + + + Mexiko + + + Malaysia + + + Mosambik + + + Namibia + + + Niger + + + Nigeria + + + Nicaragua + + + Niederlande + + + Norwegen + + + Nepal + + + Nauru + + + Neuseeland + + + Oman + + + Panama + + + Peru + + + Papua-Neuguinea + + + Philippinen + + + Pakistan + + + Polen + + + Palästinensische Autonomiegebiete + + + Portugal + + + Palau + + + Paraguay + + + Katar + + + Rumänien + + + Serbien + + + Russland + + + Ruanda + + + Saudi-Arabien + + + Salomonen + + + Seychellen + + + Sudan + + + Schweden + + + Singapur + + + Slowenien + + + Slowakei + + + Sierra Leone + + + San Marino + + + Senegal + + + Somalia + + + Suriname + + + Südsudan + + + São Tomé und Príncipe + + + El Salvador + + + Syrien + + + Eswatini + + + Tschad + + + Togo + + + Thailand + + + Tadschikistan + + + Timor-Leste + + + Turkmenistan + + + Tunesien + + + Tonga + + + Türkei + + + Trinidad und Tobago + + + Tuvalu + + + Taiwan + + + Tansania + + + Ukraine + + + Uganda + + + Vereinigte Staaten + + + Uruguay + + + Usbekistan + + + Vatikanstadt + + + St. Vincent und die Grenadinen + + + Venezuela + + + Vietnam + + + Vanuatu + + + Samoa + + + Europa + + + Weltweit + + + Jemen + + + Südafrika + + + Sambia + + + Simbabwe + + + Genre + + + Genre hinzufügen + + + Schlagwort + + + Schlagwort hinzufügen + + + Stimmung + + + Stimmung hinzufügen + + + ISRC + + + ISRC hinzufügen + + + ISWC + + + ISWC hinzufügen + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.en-US.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.en-US.resx new file mode 100644 index 00000000..252da4a1 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.en-US.resx @@ -0,0 +1,1182 @@ + + + + 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 + + + Back to album + + + Edit track + + + Save + + + The track was saved. + + + The item could not be saved. + + + Delete track + + + The track was deleted. + + + Are you sure you want to delete this item? + + + The item could not be deleted. + + + General information + + + Path + + + Title + + + Original title + + + Track number + + + Disc number + + + Script + + + Key + + + BPM + + + Genres + + + Tags + + + Duration (seconds) + + + Identifiers + + + MusicBrainz recording Id + + + MusicBrainz track Id + + + Work + + + Work title + + + Work MusicBrainz Id + + + Moods + + + ISRCs + + + C major + + + C# major + + + D major + + + D# major + + + E major + + + F major + + + F# major + + + G major + + + G# major + + + A major + + + A# major + + + B major + + + C minor + + + C# minor + + + D minor + + + D# minor + + + E minor + + + F minor + + + F# minor + + + G minor + + + G# minor + + + A minor + + + A# minor + + + B minor + + + The file system path of the track. + + + The title of the track. + + + The original title of the track, when it differs from the current one. + + + The position of the track on its disc. + + + The number of the disc the track belongs to. + + + The script used by the language of the track. + + + The musical key of the track. + + + The tempo of the track in beats per minute. + + + The genres of the track. + + + The tags of the track. + + + The duration of the track in seconds. + + + The MusicBrainz identifier of the recording. + + + The MusicBrainz identifier of the track. + + + The title of the work the track is a recording of. + + + The MusicBrainz identifier of the work. + + + The moods of the track. + + + The ISRCs of the track. + + + Description + + + A short summary or description of the track. + + + Disambiguation + + + A comment that distinguishes the track from others with the same title. + + + Video recording + + + Whether the recording of the track is a video recording. + + + Release information + + + Original release date + + + The date when the track was originally released. + + + Original release year + + + The year when the track was originally released. + + + Re-release date + + + The date when the track was released again. + + + Re-release year + + + The year when the track was released again. + + + Release country + + + The country of release of the track. + + + Release version + + + The version of the release, like the original one. + + + Language + + + Original language + + + Audio properties + + + Sample rate (Hz) + + + The sample rate of the audio of the track in Hz. + + + Channels + + + The number of audio channels of the track. + + + Bit depth + + + The bit depth of the audio of the track. + + + Audio codec + + + The audio codec used by the track. + + + Bitrate (kbps) + + + The bitrate of the audio of the track in kbps. + + + AcoustID + + + The AcoustID fingerprint identifier of the audio file of the track. + + + ReplayGain + + + Track gain (dB) + + + The ReplayGain track gain of the track in decibels. + + + Track peak + + + The ReplayGain track peak of the track. + + + Album gain (dB) + + + The ReplayGain album gain of the track in decibels. + + + Album peak + + + The ReplayGain album peak of the track. + + + Work type + + + The MusicBrainz type of the work, like Song. + + + Work ISWCs + + + The ISWCs of the work. + + + Work languages + + + The languages of the work. + + + Code + + + Name + + + Native name + + + Add language + + + The two letter code of the language of the track. + + + The name of the language of the track. + + + The native name of the language of the track. + + + Language code + + + Language name + + + Native name + + + Contributors + + + Contributor Id + + + Role + + + Add contributor + + + The people that contributed to the artist. + + + Ratings + + + Rating + + + Maximum rating + + + Source + + + Vote count + + + Add rating + + + The ratings of the artist from different sources. + + + Remove + + + Other + + + Author + + + Translator + + + Illustrator + + + Publisher + + + Narrator + + + Actor + + + Director + + + Screenwriter + + + Composer + + + Lyricist + + + Arranger + + + Conductor + + + Producer + + + Executive Producer + + + Engineer + + + Mixer + + + Remixer + + + Record Label + + + Vocals + + + Backing Vocals + + + Guitar + + + Bass Guitar + + + Drums + + + Percussion + + + Keyboards + + + Piano + + + Synthesizer + + + Strings + + + Woodwinds + + + Brass + + + Choir + + + Orchestrator + + + Performer + + + User + + + MusicBrainz + + + Discogs + + + Last.fm + + + Andorra + + + United Arab Emirates + + + Afghanistan + + + Antigua & Barbuda + + + Albania + + + Armenia + + + Netherlands Antilles + + + Angola + + + Argentina + + + Austria + + + Australia + + + Azerbaijan + + + Bosnia & Herzegovina + + + Barbados + + + Bangladesh + + + Belgium + + + Burkina Faso + + + Bulgaria + + + Bahrain + + + Burundi + + + Benin + + + Brunei + + + Bolivia + + + Brazil + + + Bahamas + + + Bhutan + + + Botswana + + + Belarus + + + Belize + + + Canada + + + Congo - Kinshasa + + + Central African Republic + + + Congo - Brazzaville + + + Switzerland + + + Côte d’Ivoire + + + Chile + + + Cameroon + + + China + + + Colombia + + + Costa Rica + + + Cuba + + + Cape Verde + + + Cyprus + + + Czechia + + + Germany + + + Djibouti + + + Denmark + + + Dominica + + + Dominican Republic + + + Algeria + + + Ecuador + + + Estonia + + + Egypt + + + Eritrea + + + Spain + + + Ethiopia + + + Finland + + + Fiji + + + Micronesia + + + France + + + Gabon + + + United Kingdom + + + Grenada + + + Georgia + + + Ghana + + + Gambia + + + Guinea + + + Equatorial Guinea + + + Greece + + + Guatemala + + + Guinea-Bissau + + + Guyana + + + Honduras + + + Croatia + + + Haiti + + + Hungary + + + Indonesia + + + Ireland + + + Israel + + + India + + + Iraq + + + Iran + + + Iceland + + + Italy + + + Jamaica + + + Jordan + + + Japan + + + Kenya + + + Kyrgyzstan + + + Cambodia + + + Kiribati + + + Comoros + + + St. Kitts & Nevis + + + North Korea + + + South Korea + + + Kuwait + + + Kazakhstan + + + Laos + + + Lebanon + + + St. Lucia + + + Liechtenstein + + + Sri Lanka + + + Liberia + + + Lesotho + + + Lithuania + + + Luxembourg + + + Latvia + + + Libya + + + Morocco + + + Monaco + + + Moldova + + + Montenegro + + + Madagascar + + + Marshall Islands + + + North Macedonia + + + Mali + + + Myanmar (Burma) + + + Mongolia + + + Mauritania + + + Malta + + + Mauritius + + + Maldives + + + Malawi + + + Mexico + + + Malaysia + + + Mozambique + + + Namibia + + + Niger + + + Nigeria + + + Nicaragua + + + Netherlands + + + Norway + + + Nepal + + + Nauru + + + New Zealand + + + Oman + + + Panama + + + Peru + + + Papua New Guinea + + + Philippines + + + Pakistan + + + Poland + + + Palestinian Territories + + + Portugal + + + Palau + + + Paraguay + + + Qatar + + + Romania + + + Serbia + + + Russia + + + Rwanda + + + Saudi Arabia + + + Solomon Islands + + + Seychelles + + + Sudan + + + Sweden + + + Singapore + + + Slovenia + + + Slovakia + + + Sierra Leone + + + San Marino + + + Senegal + + + Somalia + + + Suriname + + + South Sudan + + + São Tomé & Príncipe + + + El Salvador + + + Syria + + + Eswatini + + + Chad + + + Togo + + + Thailand + + + Tajikistan + + + Timor-Leste + + + Turkmenistan + + + Tunisia + + + Tonga + + + Türkiye + + + Trinidad & Tobago + + + Tuvalu + + + Taiwan + + + Tanzania + + + Ukraine + + + Uganda + + + United States + + + Uruguay + + + Uzbekistan + + + Vatican City + + + St. Vincent & Grenadines + + + Venezuela + + + Vietnam + + + Vanuatu + + + Samoa + + + Europe + + + Worldwide + + + Yemen + + + South Africa + + + Zambia + + + Zimbabwe + + + Genre + + + Add genre + + + Tag + + + Add tag + + + Mood + + + Add mood + + + ISRC + + + Add ISRC + + + ISWC + + + Add ISWC + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.es-ES.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.es-ES.resx new file mode 100644 index 00000000..a431f4cd --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.es-ES.resx @@ -0,0 +1,1182 @@ + + + + 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 + + + Volver al álbum + + + Editar pista + + + Guardar + + + La pista se ha guardado. + + + El elemento no se ha podido guardar. + + + Eliminar pista + + + La pista se ha eliminado. + + + ¿Seguro que quieres eliminar este elemento? + + + El elemento no se ha podido eliminar. + + + Información general + + + Ruta + + + Título + + + Título original + + + Número de pista + + + Número de disco + + + Escritura + + + Tonalidad + + + BPM + + + Géneros + + + Etiquetas + + + Duración (segundos) + + + Identificadores + + + Id de grabación de MusicBrainz + + + Id de pista de MusicBrainz + + + Obra + + + Título de la obra + + + Id de MusicBrainz de la obra + + + Estados de ánimo + + + ISRCs + + + Do mayor + + + Do# mayor + + + Re mayor + + + Re# mayor + + + Mi mayor + + + Fa mayor + + + Fa# mayor + + + Sol mayor + + + Sol# mayor + + + La mayor + + + La# mayor + + + Si mayor + + + Do menor + + + Do# menor + + + Re menor + + + Re# menor + + + Mi menor + + + Fa menor + + + Fa# menor + + + Sol menor + + + Sol# menor + + + La menor + + + La# menor + + + Si menor + + + La ruta del archivo de la pista. + + + El título de la pista. + + + El título original de la pista, cuando difiere del actual. + + + La posición de la pista en su disco. + + + El número del disco al que pertenece la pista. + + + El sistema de escritura usado por el idioma de la pista. + + + La tonalidad de la pista. + + + El tempo de la pista en pulsaciones por minuto. + + + Los géneros de la pista. + + + Las etiquetas de la pista. + + + La duración de la pista en segundos. + + + El identificador MusicBrainz de la grabación. + + + El identificador MusicBrainz de la pista. + + + El título de la obra de la que la pista es una grabación. + + + El identificador MusicBrainz de la obra. + + + Los estados de ánimo de la pista. + + + Los ISRC de la pista. + + + Descripción + + + Un resumen o descripción breve de la pista. + + + Desambiguación + + + Un comentario que distingue la pista de otras con el mismo título. + + + Grabación de vídeo + + + Indica si la grabación de la pista es una grabación de vídeo. + + + Información de publicación + + + Fecha de publicación original + + + La fecha en que se publicó originalmente la pista. + + + Año de publicación original + + + El año en que se publicó originalmente la pista. + + + Fecha de republicación + + + La fecha en que se volvió a publicar la pista. + + + Año de republicación + + + El año en que se volvió a publicar la pista. + + + País de publicación + + + El país de publicación de la pista. + + + Versión de publicación + + + La versión de la publicación, como la original. + + + Idioma + + + Idioma original + + + Propiedades de audio + + + Frecuencia de muestreo (Hz) + + + La frecuencia de muestreo del audio de la pista en Hz. + + + Canales + + + El número de canales de audio de la pista. + + + Profundidad de bits + + + La profundidad de bits del audio de la pista. + + + Códec de audio + + + El códec de audio usado por la pista. + + + Tasa de bits (kbps) + + + La tasa de bits del audio de la pista en kbps. + + + AcoustID + + + El identificador de huella AcoustID del archivo de audio de la pista. + + + ReplayGain + + + Ganancia de pista (dB) + + + La ganancia de pista de ReplayGain de la pista en decibelios. + + + Pico de pista + + + El pico de pista de ReplayGain de la pista. + + + Ganancia de álbum (dB) + + + La ganancia de álbum de ReplayGain de la pista en decibelios. + + + Pico de álbum + + + El pico de álbum de ReplayGain de la pista. + + + Tipo de obra + + + El tipo de obra de MusicBrainz, como Canción. + + + ISWC de la obra + + + Los ISWC de la obra. + + + Idiomas de la obra + + + Los idiomas de la obra. + + + Code + + + Name + + + Nombre nativo + + + Añadir idioma + + + El código de dos letras del idioma de la pista. + + + El nombre del idioma de la pista. + + + El nombre nativo del idioma de la pista. + + + Código de idioma + + + Nombre del idioma + + + Nombre nativo + + + Colaboradores + + + Id de colaborador + + + Rol + + + Añadir colaborador + + + Las personas que contribuyeron al artista. + + + Valoraciones + + + Valoración + + + Valoración máxima + + + Fuente + + + Número de votos + + + Añadir valoración + + + Las valoraciones del artista de diferentes fuentes. + + + Eliminar + + + Otro + + + Autor + + + Traductor + + + Ilustrador + + + Editorial + + + Narrador + + + Actor + + + Director + + + Guionista + + + Compositor + + + Letrista + + + Arreglista + + + Director de orquesta + + + Productor + + + Productor ejecutivo + + + Ingeniero + + + Mezclador + + + Remezclador + + + Discográfica + + + Voces + + + Coros + + + Guitarra + + + Bajo + + + Batería + + + Percusión + + + Teclados + + + Piano + + + Sintetizador + + + Cuerdas + + + Viento madera + + + Metales + + + Coro + + + Orquestador + + + Intérprete + + + Usuario + + + MusicBrainz + + + Discogs + + + Last.fm + + + Andorra + + + Emiratos Árabes Unidos + + + Afganistán + + + Antigua y Barbuda + + + Albania + + + Armenia + + + Antillas Neerlandesas + + + Angola + + + Argentina + + + Austria + + + Australia + + + Azerbaiyán + + + Bosnia y Herzegovina + + + Barbados + + + Bangladés + + + Bélgica + + + Burkina Faso + + + Bulgaria + + + Baréin + + + Burundi + + + Benín + + + Brunéi + + + Bolivia + + + Brasil + + + Bahamas + + + Bután + + + Botsuana + + + Bielorrusia + + + Belice + + + Canadá + + + Congo - Kinsasa + + + República Centroafricana + + + Congo - Brazzaville + + + Suiza + + + Costa de Marfil + + + Chile + + + Camerún + + + China + + + Colombia + + + Costa Rica + + + Cuba + + + Cabo Verde + + + Chipre + + + Chequia + + + Alemania + + + Yibuti + + + Dinamarca + + + Dominica + + + República Dominicana + + + Argelia + + + Ecuador + + + Estonia + + + Egipto + + + Eritrea + + + España + + + Etiopía + + + Finlandia + + + Fiyi + + + Micronesia + + + Francia + + + Gabón + + + Reino Unido + + + Granada + + + Georgia + + + Ghana + + + Gambia + + + Guinea + + + Guinea Ecuatorial + + + Grecia + + + Guatemala + + + Guinea-Bisáu + + + Guyana + + + Honduras + + + Croacia + + + Haití + + + Hungría + + + Indonesia + + + Irlanda + + + Israel + + + India + + + Irak + + + Irán + + + Islandia + + + Italia + + + Jamaica + + + Jordania + + + Japón + + + Kenia + + + Kirguistán + + + Camboya + + + Kiribati + + + Comoras + + + San Cristóbal y Nieves + + + Corea del Norte + + + Corea del Sur + + + Kuwait + + + Kazajistán + + + Laos + + + Líbano + + + Santa Lucía + + + Liechtenstein + + + Sri Lanka + + + Liberia + + + Lesoto + + + Lituania + + + Luxemburgo + + + Letonia + + + Libia + + + Marruecos + + + Mónaco + + + Moldavia + + + Montenegro + + + Madagascar + + + Islas Marshall + + + Macedonia del Norte + + + Malí + + + Myanmar (Birmania) + + + Mongolia + + + Mauritania + + + Malta + + + Mauricio + + + Maldivas + + + Malaui + + + México + + + Malasia + + + Mozambique + + + Namibia + + + Níger + + + Nigeria + + + Nicaragua + + + Países Bajos + + + Noruega + + + Nepal + + + Nauru + + + Nueva Zelanda + + + Omán + + + Panamá + + + Perú + + + Papúa Nueva Guinea + + + Filipinas + + + Pakistán + + + Polonia + + + Territorios Palestinos + + + Portugal + + + Palaos + + + Paraguay + + + Catar + + + Rumanía + + + Serbia + + + Rusia + + + Ruanda + + + Arabia Saudí + + + Islas Salomón + + + Seychelles + + + Sudán + + + Suecia + + + Singapur + + + Eslovenia + + + Eslovaquia + + + Sierra Leona + + + San Marino + + + Senegal + + + Somalia + + + Surinam + + + Sudán del Sur + + + Santo Tomé y Príncipe + + + El Salvador + + + Siria + + + Esuatini + + + Chad + + + Togo + + + Tailandia + + + Tayikistán + + + Timor-Leste + + + Turkmenistán + + + Túnez + + + Tonga + + + Turquía + + + Trinidad y Tobago + + + Tuvalu + + + Taiwán + + + Tanzania + + + Ucrania + + + Uganda + + + Estados Unidos + + + Uruguay + + + Uzbekistán + + + Ciudad del Vaticano + + + San Vicente y las Granadinas + + + Venezuela + + + Vietnam + + + Vanuatu + + + Samoa + + + Europa + + + Mundial + + + Yemen + + + Sudáfrica + + + Zambia + + + Zimbabue + + + Género + + + Añadir género + + + Etiqueta + + + Añadir etiqueta + + + Estado de ánimo + + + Añadir estado de ánimo + + + ISRC + + + Añadir ISRC + + + ISWC + + + Añadir ISWC + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.fr-FR.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.fr-FR.resx new file mode 100644 index 00000000..8734fe07 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.fr-FR.resx @@ -0,0 +1,1182 @@ + + + + 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 + + + Retour à l'album + + + Modifier la piste + + + Enregistrer + + + La piste a été enregistrée. + + + L'élément n'a pas pu être enregistré. + + + Supprimer la piste + + + La piste a été supprimée. + + + Voulez-vous vraiment supprimer cet élément ? + + + L'élément n'a pas pu être supprimé. + + + Informations générales + + + Chemin + + + Titre + + + Titre original + + + Numéro de piste + + + Numéro de disque + + + Écriture + + + Tonalité + + + BPM + + + Genres + + + Étiquettes + + + Durée (secondes) + + + Identifiants + + + Id d'enregistrement MusicBrainz + + + Id de piste MusicBrainz + + + Œuvre + + + Titre de l'œuvre + + + Id MusicBrainz de l'œuvre + + + Ambiances + + + ISRCs + + + Do majeur + + + Do# majeur + + + Ré majeur + + + Ré# majeur + + + Mi majeur + + + Fa majeur + + + Fa# majeur + + + Sol majeur + + + Sol# majeur + + + La majeur + + + La# majeur + + + Si majeur + + + Do mineur + + + Do# mineur + + + Ré mineur + + + Ré# mineur + + + Mi mineur + + + Fa mineur + + + Fa# mineur + + + Sol mineur + + + Sol# mineur + + + La mineur + + + La# mineur + + + Si mineur + + + Le chemin du fichier de la piste. + + + Le titre de la piste. + + + Le titre original de la piste, lorsqu'il diffère du titre actuel. + + + La position de la piste sur son disque. + + + Le numéro du disque auquel appartient la piste. + + + L'écriture utilisée par la langue de la piste. + + + La tonalité de la piste. + + + Le tempo de la piste en battements par minute. + + + Les genres de la piste. + + + Les étiquettes de la piste. + + + La durée de la piste en secondes. + + + L'identifiant MusicBrainz de l'enregistrement. + + + L'identifiant MusicBrainz de la piste. + + + Le titre de l'œuvre dont la piste est un enregistrement. + + + L'identifiant MusicBrainz de l'œuvre. + + + Les ambiances de la piste. + + + Les codes ISRC de la piste. + + + Description + + + Un court résumé ou une description de la piste. + + + Désambiguïsation + + + Un commentaire qui distingue la piste des autres ayant le même titre. + + + Enregistrement vidéo + + + Indique si l'enregistrement de la piste est un enregistrement vidéo. + + + Informations sur la sortie + + + Date de sortie originale + + + La date à laquelle la piste est sortie à l'origine. + + + Année de sortie originale + + + L'année à laquelle la piste est sortie à l'origine. + + + Date de ressortie + + + La date à laquelle la piste est ressortie. + + + Année de ressortie + + + L'année à laquelle la piste est ressortie. + + + Pays de sortie + + + Le pays de sortie de la piste. + + + Version de sortie + + + La version de la sortie, comme l'originale. + + + Langue + + + Langue originale + + + Propriétés audio + + + Fréquence d'échantillonnage (Hz) + + + La fréquence d'échantillonnage de l'audio de la piste en Hz. + + + Canaux + + + Le nombre de canaux audio de la piste. + + + Profondeur de bits + + + La profondeur de bits de l'audio de la piste. + + + Codec audio + + + Le codec audio utilisé par la piste. + + + Débit binaire (kbps) + + + Le débit binaire de l'audio de la piste en kbps. + + + AcoustID + + + L'identifiant d'empreinte AcoustID du fichier audio de la piste. + + + ReplayGain + + + Gain de la piste (dB) + + + Le gain de la piste ReplayGain de la piste en décibels. + + + Crête de la piste + + + La crête de la piste ReplayGain de la piste. + + + Gain de l'album (dB) + + + Le gain de l'album ReplayGain de la piste en décibels. + + + Crête de l'album + + + La crête de l'album ReplayGain de la piste. + + + Type d'oeuvre + + + Le type MusicBrainz de l'oeuvre, comme Song. + + + ISWC de l'oeuvre + + + Les codes ISWC de l'œuvre. + + + Langues de l'oeuvre + + + Les langues de l'oeuvre. + + + Code + + + Name + + + Nom natif + + + Ajouter une langue + + + Le code à deux lettres de la langue de la piste. + + + Le nom de la langue de la piste. + + + Le nom natif de la langue de la piste. + + + Code de langue + + + Nom de la langue + + + Nom natif + + + Contributeurs + + + Id du contributeur + + + Rôle + + + Ajouter un contributeur + + + Les personnes ayant contribué à l'artiste. + + + Évaluations + + + Évaluation + + + Évaluation maximale + + + Source + + + Nombre de votes + + + Ajouter une évaluation + + + Les notes de l'artiste provenant de différentes sources. + + + Supprimer + + + Autre + + + Auteur + + + Traducteur + + + Illustrateur + + + Éditeur + + + Narrateur + + + Acteur + + + Réalisateur + + + Scénariste + + + Compositeur + + + Parolier + + + Arrangeur + + + Chef d'orchestre + + + Producteur + + + Producteur exécutif + + + Ingénieur du son + + + Mixeur + + + Remixeur + + + Maison de disques + + + Chant + + + Chœurs + + + Guitare + + + Guitare basse + + + Batterie + + + Percussions + + + Claviers + + + Piano + + + Synthétiseur + + + Cordes + + + Bois + + + Cuivres + + + Chœur + + + Orchestrateur + + + Interprète + + + Utilisateur + + + MusicBrainz + + + Discogs + + + Last.fm + + + Andorre + + + Émirats arabes unis + + + Afghanistan + + + Antigua-et-Barbuda + + + Albanie + + + Arménie + + + Antilles néerlandaises + + + Angola + + + Argentine + + + Autriche + + + Australie + + + Azerbaïdjan + + + Bosnie-Herzégovine + + + Barbade + + + Bangladesh + + + Belgique + + + Burkina Faso + + + Bulgarie + + + Bahreïn + + + Burundi + + + Bénin + + + Brunei + + + Bolivie + + + Brésil + + + Bahamas + + + Bhoutan + + + Botswana + + + Biélorussie + + + Belize + + + Canada + + + Congo-Kinshasa + + + République centrafricaine + + + Congo-Brazzaville + + + Suisse + + + Côte d'Ivoire + + + Chili + + + Cameroun + + + Chine + + + Colombie + + + Costa Rica + + + Cuba + + + Cap-Vert + + + Chypre + + + Tchéquie + + + Allemagne + + + Djibouti + + + Danemark + + + Dominique + + + République dominicaine + + + Algérie + + + Équateur + + + Estonie + + + Égypte + + + Érythrée + + + Espagne + + + Éthiopie + + + Finlande + + + Fidji + + + Micronésie + + + France + + + Gabon + + + Royaume-Uni + + + Grenade + + + Géorgie + + + Ghana + + + Gambie + + + Guinée + + + Guinée équatoriale + + + Grèce + + + Guatemala + + + Guinée-Bissau + + + Guyana + + + Honduras + + + Croatie + + + Haïti + + + Hongrie + + + Indonésie + + + Irlande + + + Israël + + + Inde + + + Irak + + + Iran + + + Islande + + + Italie + + + Jamaïque + + + Jordanie + + + Japon + + + Kenya + + + Kirghizstan + + + Cambodge + + + Kiribati + + + Comores + + + Saint-Christophe-et-Niévès + + + Corée du Nord + + + Corée du Sud + + + Koweït + + + Kazakhstan + + + Laos + + + Liban + + + Sainte-Lucie + + + Liechtenstein + + + Sri Lanka + + + Liberia + + + Lesotho + + + Lituanie + + + Luxembourg + + + Lettonie + + + Libye + + + Maroc + + + Monaco + + + Moldavie + + + Monténégro + + + Madagascar + + + Îles Marshall + + + Macédoine du Nord + + + Mali + + + Myanmar (Birmanie) + + + Mongolie + + + Mauritanie + + + Malte + + + Maurice + + + Maldives + + + Malawi + + + Mexique + + + Malaisie + + + Mozambique + + + Namibie + + + Niger + + + Nigeria + + + Nicaragua + + + Pays-Bas + + + Norvège + + + Népal + + + Nauru + + + Nouvelle-Zélande + + + Oman + + + Panama + + + Pérou + + + Papouasie-Nouvelle-Guinée + + + Philippines + + + Pakistan + + + Pologne + + + Territoires palestiniens + + + Portugal + + + Palaos + + + Paraguay + + + Qatar + + + Roumanie + + + Serbie + + + Russie + + + Rwanda + + + Arabie saoudite + + + Îles Salomon + + + Seychelles + + + Soudan + + + Suède + + + Singapour + + + Slovénie + + + Slovaquie + + + Sierra Leone + + + Saint-Marin + + + Sénégal + + + Somalie + + + Suriname + + + Soudan du Sud + + + Sao Tomé-et-Principe + + + Salvador + + + Syrie + + + Eswatini + + + Tchad + + + Togo + + + Thaïlande + + + Tadjikistan + + + Timor oriental + + + Turkménistan + + + Tunisie + + + Tonga + + + Turquie + + + Trinité-et-Tobago + + + Tuvalu + + + Taïwan + + + Tanzanie + + + Ukraine + + + Ouganda + + + États-Unis + + + Uruguay + + + Ouzbékistan + + + État de la Cité du Vatican + + + Saint-Vincent-et-les Grenadines + + + Venezuela + + + Viêt Nam + + + Vanuatu + + + Samoa + + + Europe + + + Monde + + + Yémen + + + Afrique du Sud + + + Zambie + + + Zimbabwe + + + Genre + + + Ajouter un genre + + + Étiquette + + + Ajouter une étiquette + + + Ambiance + + + Ajouter une ambiance + + + ISRC + + + Ajouter un ISRC + + + ISWC + + + Ajouter un ISWC + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.it-IT.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.it-IT.resx new file mode 100644 index 00000000..b3163394 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.it-IT.resx @@ -0,0 +1,1182 @@ + + + + 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 + + + Torna all'album + + + Modifica traccia + + + Salva + + + La traccia è stata salvata. + + + Non è stato possibile salvare l'elemento. + + + Elimina traccia + + + La traccia è stata eliminata. + + + Sei sicuro di voler eliminare questo elemento? + + + Non è stato possibile eliminare l'elemento. + + + Informazioni generali + + + Percorso + + + Titolo + + + Titolo originale + + + Numero traccia + + + Numero disco + + + Scrittura + + + Tonalità + + + BPM + + + Generi + + + Etichette + + + Durata (secondi) + + + Identificatori + + + Id della registrazione MusicBrainz + + + Id della traccia MusicBrainz + + + Opera + + + Titolo dell'opera + + + Id MusicBrainz dell'opera + + + Umori + + + ISRCs + + + Do maggiore + + + Do# maggiore + + + Re maggiore + + + Re# maggiore + + + Mi maggiore + + + Fa maggiore + + + Fa# maggiore + + + Sol maggiore + + + Sol# maggiore + + + La maggiore + + + La# maggiore + + + Si maggiore + + + Do minore + + + Do# minore + + + Re minore + + + Re# minore + + + Mi minore + + + Fa minore + + + Fa# minore + + + Sol minore + + + Sol# minore + + + La minore + + + La# minore + + + Si minore + + + Il percorso del file della traccia. + + + Il titolo della traccia. + + + Il titolo originale della traccia, quando differisce da quello attuale. + + + La posizione della traccia sul suo disco. + + + Il numero del disco a cui appartiene la traccia. + + + La scrittura usata dalla lingua della traccia. + + + La tonalità della traccia. + + + Il tempo della traccia in battiti al minuto. + + + I generi della traccia. + + + I tag della traccia. + + + La durata della traccia in secondi. + + + L'identificatore MusicBrainz della registrazione. + + + L'identificatore MusicBrainz della traccia. + + + Il titolo dell'opera di cui la traccia è una registrazione. + + + L'identificatore MusicBrainz dell'opera. + + + Gli stati d'animo della traccia. + + + I codici ISRC della traccia. + + + Descrizione + + + Un breve riassunto o una descrizione del brano. + + + Disambiguazione + + + Un commento che distingue il brano da altri con lo stesso titolo. + + + Registrazione video + + + Indica se la registrazione del brano è una registrazione video. + + + Informazioni sulla pubblicazione + + + Data di pubblicazione originale + + + La data in cui il brano è stato originariamente pubblicato. + + + Anno di pubblicazione originale + + + L'anno in cui il brano è stato originariamente pubblicato. + + + Data di ripubblicazione + + + La data in cui il brano è stato pubblicato di nuovo. + + + Anno di ripubblicazione + + + L'anno in cui il brano è stato pubblicato di nuovo. + + + Paese di pubblicazione + + + Il paese di pubblicazione del brano. + + + Versione di pubblicazione + + + La versione della pubblicazione, come quella originale. + + + Lingua + + + Lingua originale + + + Proprietà audio + + + Frequenza di campionamento (Hz) + + + La frequenza di campionamento dell'audio del brano in Hz. + + + Canali + + + Il numero di canali audio del brano. + + + Profondità di bit + + + La profondità di bit dell'audio del brano. + + + Codec audio + + + Il codec audio utilizzato dal brano. + + + Bitrate (kbps) + + + Il bitrate dell'audio del brano in kbps. + + + AcoustID + + + L'identificatore di impronta AcoustID del file audio del brano. + + + ReplayGain + + + Guadagno del brano (dB) + + + Il guadagno del brano ReplayGain del brano in decibel. + + + Picco del brano + + + Il picco del brano ReplayGain del brano. + + + Guadagno dell'album (dB) + + + Il guadagno dell'album ReplayGain del brano in decibel. + + + Picco dell'album + + + Il picco dell'album ReplayGain del brano. + + + Tipo di opera + + + Il tipo MusicBrainz dell'opera, come Song. + + + ISWC dell'opera + + + I codici ISWC dell'opera. + + + Lingue dell'opera + + + Le lingue dell'opera. + + + Code + + + Name + + + Nome nativo + + + Aggiungi lingua + + + Il codice di due lettere della lingua del brano. + + + Il nome della lingua del brano. + + + Il nome nativo della lingua del brano. + + + Codice lingua + + + Nome della lingua + + + Nome nativo + + + Collaboratori + + + Id collaboratore + + + Ruolo + + + Aggiungi collaboratore + + + Le persone che hanno contribuito all'artista. + + + Valutazioni + + + Valutazione + + + Valutazione massima + + + Fonte + + + Numero di voti + + + Aggiungi valutazione + + + Le valutazioni dell'artista da diverse fonti. + + + Rimuovi + + + Altro + + + Autore + + + Traduttore + + + Illustratore + + + Editore + + + Narratore + + + Attore + + + Regista + + + Sceneggiatore + + + Compositore + + + Paroliere + + + Arrangiatore + + + Direttore d'orchestra + + + Produttore + + + Produttore esecutivo + + + Tecnico del suono + + + Mixer + + + Remixer + + + Etichetta discografica + + + Voce + + + Voci di supporto + + + Chitarra + + + Basso + + + Batteria + + + Percussioni + + + Tastiere + + + Pianoforte + + + Sintetizzatore + + + Archi + + + Legni + + + Ottoni + + + Coro + + + Orchestratore + + + Esecutore + + + Utente + + + MusicBrainz + + + Discogs + + + Last.fm + + + Andorra + + + Emirati Arabi Uniti + + + Afghanistan + + + Antigua e Barbuda + + + Albania + + + Armenia + + + Antille Olandesi + + + Angola + + + Argentina + + + Austria + + + Australia + + + Azerbaigian + + + Bosnia ed Erzegovina + + + Barbados + + + Bangladesh + + + Belgio + + + Burkina Faso + + + Bulgaria + + + Bahrein + + + Burundi + + + Benin + + + Brunei + + + Bolivia + + + Brasile + + + Bahamas + + + Bhutan + + + Botswana + + + Bielorussia + + + Belize + + + Canada + + + Congo - Kinshasa + + + Repubblica Centrafricana + + + Congo - Brazzaville + + + Svizzera + + + Costa d'Avorio + + + Cile + + + Camerun + + + Cina + + + Colombia + + + Costa Rica + + + Cuba + + + Capo Verde + + + Cipro + + + Cechia + + + Germania + + + Gibuti + + + Danimarca + + + Dominica + + + Repubblica Dominicana + + + Algeria + + + Ecuador + + + Estonia + + + Egitto + + + Eritrea + + + Spagna + + + Etiopia + + + Finlandia + + + Figi + + + Micronesia + + + Francia + + + Gabon + + + Regno Unito + + + Grenada + + + Georgia + + + Ghana + + + Gambia + + + Guinea + + + Guinea Equatoriale + + + Grecia + + + Guatemala + + + Guinea-Bissau + + + Guyana + + + Honduras + + + Croazia + + + Haiti + + + Ungheria + + + Indonesia + + + Irlanda + + + Israele + + + India + + + Iraq + + + Iran + + + Islanda + + + Italia + + + Giamaica + + + Giordania + + + Giappone + + + Kenya + + + Kirghizistan + + + Cambogia + + + Kiribati + + + Comore + + + Saint Kitts e Nevis + + + Corea del Nord + + + Corea del Sud + + + Kuwait + + + Kazakistan + + + Laos + + + Libano + + + Saint Lucia + + + Liechtenstein + + + Sri Lanka + + + Liberia + + + Lesotho + + + Lituania + + + Lussemburgo + + + Lettonia + + + Libia + + + Marocco + + + Monaco + + + Moldavia + + + Montenegro + + + Madagascar + + + Isole Marshall + + + Macedonia del Nord + + + Mali + + + Myanmar (Birmania) + + + Mongolia + + + Mauritania + + + Malta + + + Mauritius + + + Maldive + + + Malawi + + + Messico + + + Malaysia + + + Mozambico + + + Namibia + + + Niger + + + Nigeria + + + Nicaragua + + + Paesi Bassi + + + Norvegia + + + Nepal + + + Nauru + + + Nuova Zelanda + + + Oman + + + Panama + + + Perù + + + Papua Nuova Guinea + + + Filippine + + + Pakistan + + + Polonia + + + Territori palestinesi + + + Portogallo + + + Palau + + + Paraguay + + + Qatar + + + Romania + + + Serbia + + + Russia + + + Ruanda + + + Arabia Saudita + + + Isole Salomone + + + Seychelles + + + Sudan + + + Svezia + + + Singapore + + + Slovenia + + + Slovacchia + + + Sierra Leone + + + San Marino + + + Senegal + + + Somalia + + + Suriname + + + Sudan del Sud + + + São Tomé e Príncipe + + + El Salvador + + + Siria + + + Eswatini + + + Ciad + + + Togo + + + Thailandia + + + Tagikistan + + + Timor Est + + + Turkmenistan + + + Tunisia + + + Tonga + + + Turchia + + + Trinidad e Tobago + + + Tuvalu + + + Taiwan + + + Tanzania + + + Ucraina + + + Uganda + + + Stati Uniti + + + Uruguay + + + Uzbekistan + + + Città del Vaticano + + + Saint Vincent e Grenadine + + + Venezuela + + + Vietnam + + + Vanuatu + + + Samoa + + + Europa + + + Mondiale + + + Yemen + + + Sudafrica + + + Zambia + + + Zimbabwe + + + Genere + + + Aggiungi genere + + + Etichetta + + + Aggiungi etichetta + + + Umore + + + Aggiungi umore + + + ISRC + + + Aggiungi ISRC + + + ISWC + + + Aggiungi ISWC + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ja-JP.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ja-JP.resx new file mode 100644 index 00000000..9a91da4d --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ja-JP.resx @@ -0,0 +1,1182 @@ + + + + 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 + + + アルバムに戻る + + + トラックを編集 + + + 保存 + + + トラックを保存しました。 + + + 項目を保存できませんでした。 + + + トラックを削除 + + + トラックを削除しました。 + + + この項目を削除してもよろしいですか? + + + 項目を削除できませんでした。 + + + 一般情報 + + + パス + + + タイトル + + + 原題 + + + トラック番号 + + + ディスク番号 + + + 文字体系 + + + キー + + + BPM + + + ジャンル + + + タグ + + + 長さ(秒) + + + 識別子 + + + MusicBrainz レコーディング Id + + + MusicBrainz トラック Id + + + 作品 + + + 作品タイトル + + + 作品 MusicBrainz Id + + + ムード + + + ISRCs + + + ハ長調 + + + 嬰ハ長調 + + + ニ長調 + + + 嬰ニ長調 + + + ホ長調 + + + ヘ長調 + + + 嬰ヘ長調 + + + ト長調 + + + 嬰ト長調 + + + イ長調 + + + 嬰イ長調 + + + ロ長調 + + + ハ短調 + + + 嬰ハ短調 + + + ニ短調 + + + 嬰ニ短調 + + + ホ短調 + + + ヘ短調 + + + 嬰ヘ短調 + + + ト短調 + + + 嬰ト短調 + + + イ短調 + + + 嬰イ短調 + + + ロ短調 + + + トラックのファイルパス。 + + + トラックのタイトル。 + + + 現在のタイトルと異なる場合のトラックの原題。 + + + ディスク上のトラックの位置。 + + + トラックが属するディスク番号。 + + + トラックの言語で使用される文字体系。 + + + トラックの調。 + + + 1分あたりの拍数で表したトラックのテンポ。 + + + トラックのジャンル。 + + + トラックのタグ。 + + + 秒単位のトラックの長さ。 + + + 録音のMusicBrainz識別子。 + + + トラックのMusicBrainz識別子。 + + + トラックが録音である作品のタイトル。 + + + 作品のMusicBrainz識別子。 + + + トラックのムード。 + + + トラックのISRC。 + + + 説明 + + + トラックの簡単な概要または説明。 + + + 曖昧さ回避 + + + 同じタイトルの他のトラックと区別するためのコメント。 + + + 映像録音 + + + トラックの録音が映像録音かどうか。 + + + リリース情報 + + + 初回リリース日 + + + トラックが最初にリリースされた日付。 + + + 初回リリース年 + + + トラックが最初にリリースされた年。 + + + 再リリース日 + + + トラックが再リリースされた日付。 + + + 再リリース年 + + + トラックが再リリースされた年。 + + + リリース国 + + + トラックのリリース国。 + + + リリースバージョン + + + リリースのバージョン (元のものなど)。 + + + 言語 + + + 原語 + + + オーディオプロパティ + + + サンプルレート (Hz) + + + トラックの音声のサンプルレート (Hz)。 + + + チャンネル + + + トラックのオーディオチャンネル数。 + + + ビット深度 + + + トラックの音声のビット深度。 + + + オーディオコーデック + + + トラックで使用されているオーディオコーデック。 + + + ビットレート (kbps) + + + トラックの音声のビットレート (kbps)。 + + + AcoustID + + + トラックの音声ファイルの AcoustID フィンガープリント識別子。 + + + ReplayGain + + + トラックゲイン (dB) + + + トラックの ReplayGain トラックゲイン (デシベル)。 + + + トラックピーク + + + トラックの ReplayGain トラックピーク。 + + + アルバムゲイン (dB) + + + トラックの ReplayGain アルバムゲイン (デシベル)。 + + + アルバムピーク + + + トラックの ReplayGain アルバムピーク。 + + + 作品タイプ + + + 作品の MusicBrainz タイプ (楽曲など)。 + + + 作品の ISWC + + + 作品のISWC。 + + + 作品の言語 + + + 作品の言語。 + + + コード + + + 名前 + + + ネイティブ名 + + + 言語を追加 + + + トラックの言語の 2 文字コード。 + + + トラックの言語の名前。 + + + トラックの言語のネイティブ名。 + + + 言語コード + + + 言語名 + + + 現地語名 + + + 貢献者 + + + 貢献者 Id + + + 役割 + + + 貢献者を追加 + + + アーティストに貢献した人々。 + + + 評価 + + + 評価 + + + 最大評価 + + + 出典 + + + 投票数 + + + 評価を追加 + + + さまざまな情報源によるアーティストの評価。 + + + 削除 + + + その他 + + + 著者 + + + 翻訳者 + + + イラストレーター + + + 出版社 + + + ナレーター + + + 俳優 + + + 監督 + + + 脚本家 + + + 作曲者 + + + 作詞者 + + + 編曲者 + + + 指揮者 + + + プロデューサー + + + エグゼクティブプロデューサー + + + エンジニア + + + ミキサー + + + リミキサー + + + レコードレーベル + + + ボーカル + + + バッキングボーカル + + + ギター + + + ベースギター + + + ドラム + + + パーカッション + + + キーボード + + + ピアノ + + + シンセサイザー + + + 弦楽器 + + + 木管楽器 + + + 金管楽器 + + + 合唱 + + + 管弦楽編曲者 + + + 演奏者 + + + ユーザー + + + MusicBrainz + + + Discogs + + + Last.fm + + + アンドラ + + + アラブ首長国連邦 + + + アフガニスタン + + + アンティグア・バーブーダ + + + アルバニア + + + アルメニア + + + オランダ領アンティル + + + アンゴラ + + + アルゼンチン + + + オーストリア + + + オーストラリア + + + アゼルバイジャン + + + ボスニア・ヘルツェゴビナ + + + バルバドス + + + バングラデシュ + + + ベルギー + + + ブルキナファソ + + + ブルガリア + + + バーレーン + + + ブルンジ + + + ベナン + + + ブルネイ + + + ボリビア + + + ブラジル + + + バハマ + + + ブータン + + + ボツワナ + + + ベラルーシ + + + ベリーズ + + + カナダ + + + コンゴ民主共和国 + + + 中央アフリカ共和国 + + + コンゴ共和国 + + + スイス + + + コートジボワール + + + チリ + + + カメルーン + + + 中国 + + + コロンビア + + + コスタリカ + + + キューバ + + + カーボベルデ + + + キプロス + + + チェコ + + + ドイツ + + + ジブチ + + + デンマーク + + + ドミニカ国 + + + ドミニカ共和国 + + + アルジェリア + + + エクアドル + + + エストニア + + + エジプト + + + エリトリア + + + スペイン + + + エチオピア + + + フィンランド + + + フィジー + + + ミクロネシア + + + フランス + + + ガボン + + + イギリス + + + グレナダ + + + ジョージア + + + ガーナ + + + ガンビア + + + ギニア + + + 赤道ギニア + + + ギリシャ + + + グアテマラ + + + ギニアビサウ + + + ガイアナ + + + ホンジュラス + + + クロアチア + + + ハイチ + + + ハンガリー + + + インドネシア + + + アイルランド + + + イスラエル + + + インド + + + イラク + + + イラン + + + アイスランド + + + イタリア + + + ジャマイカ + + + ヨルダン + + + 日本 + + + ケニア + + + キルギス + + + カンボジア + + + キリバス + + + コモロ + + + セントクリストファー・ネービス + + + 北朝鮮 + + + 韓国 + + + クウェート + + + カザフスタン + + + ラオス + + + レバノン + + + セントルシア + + + リヒテンシュタイン + + + スリランカ + + + リベリア + + + レソト + + + リトアニア + + + ルクセンブルク + + + ラトビア + + + リビア + + + モロッコ + + + モナコ + + + モルドバ + + + モンテネグロ + + + マダガスカル + + + マーシャル諸島 + + + 北マケドニア + + + マリ + + + ミャンマー + + + モンゴル + + + モーリタニア + + + マルタ + + + モーリシャス + + + モルディブ + + + マラウイ + + + メキシコ + + + マレーシア + + + モザンビーク + + + ナミビア + + + ニジェール + + + ナイジェリア + + + ニカラグア + + + オランダ + + + ノルウェー + + + ネパール + + + ナウル + + + ニュージーランド + + + オマーン + + + パナマ + + + ペルー + + + パプアニューギニア + + + フィリピン + + + パキスタン + + + ポーランド + + + パレスチナ + + + ポルトガル + + + パラオ + + + パラグアイ + + + カタール + + + ルーマニア + + + セルビア + + + ロシア + + + ルワンダ + + + サウジアラビア + + + ソロモン諸島 + + + セーシェル + + + スーダン + + + スウェーデン + + + シンガポール + + + スロベニア + + + スロバキア + + + シエラレオネ + + + サンマリノ + + + セネガル + + + ソマリア + + + スリナム + + + 南スーダン + + + サントメ・プリンシペ + + + エルサルバドル + + + シリア + + + エスワティニ + + + チャド + + + トーゴ + + + タイ + + + タジキスタン + + + 東ティモール + + + トルクメニスタン + + + チュニジア + + + トンガ + + + トルコ + + + トリニダード・トバゴ + + + ツバル + + + 台湾 + + + タンザニア + + + ウクライナ + + + ウガンダ + + + アメリカ合衆国 + + + ウルグアイ + + + ウズベキスタン + + + バチカン市国 + + + セントビンセント・グレナディーン + + + ベネズエラ + + + ベトナム + + + バヌアツ + + + サモア + + + ヨーロッパ + + + 全世界 + + + イエメン + + + 南アフリカ + + + ザンビア + + + ジンバブエ + + + ジャンル + + + ジャンルを追加 + + + タグ + + + タグを追加 + + + 気分 + + + 気分を追加 + + + ISRC + + + ISRC を追加 + + + ISWC + + + ISWC を追加 + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.resx new file mode 100644 index 00000000..252da4a1 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.resx @@ -0,0 +1,1182 @@ + + + + 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 + + + Back to album + + + Edit track + + + Save + + + The track was saved. + + + The item could not be saved. + + + Delete track + + + The track was deleted. + + + Are you sure you want to delete this item? + + + The item could not be deleted. + + + General information + + + Path + + + Title + + + Original title + + + Track number + + + Disc number + + + Script + + + Key + + + BPM + + + Genres + + + Tags + + + Duration (seconds) + + + Identifiers + + + MusicBrainz recording Id + + + MusicBrainz track Id + + + Work + + + Work title + + + Work MusicBrainz Id + + + Moods + + + ISRCs + + + C major + + + C# major + + + D major + + + D# major + + + E major + + + F major + + + F# major + + + G major + + + G# major + + + A major + + + A# major + + + B major + + + C minor + + + C# minor + + + D minor + + + D# minor + + + E minor + + + F minor + + + F# minor + + + G minor + + + G# minor + + + A minor + + + A# minor + + + B minor + + + The file system path of the track. + + + The title of the track. + + + The original title of the track, when it differs from the current one. + + + The position of the track on its disc. + + + The number of the disc the track belongs to. + + + The script used by the language of the track. + + + The musical key of the track. + + + The tempo of the track in beats per minute. + + + The genres of the track. + + + The tags of the track. + + + The duration of the track in seconds. + + + The MusicBrainz identifier of the recording. + + + The MusicBrainz identifier of the track. + + + The title of the work the track is a recording of. + + + The MusicBrainz identifier of the work. + + + The moods of the track. + + + The ISRCs of the track. + + + Description + + + A short summary or description of the track. + + + Disambiguation + + + A comment that distinguishes the track from others with the same title. + + + Video recording + + + Whether the recording of the track is a video recording. + + + Release information + + + Original release date + + + The date when the track was originally released. + + + Original release year + + + The year when the track was originally released. + + + Re-release date + + + The date when the track was released again. + + + Re-release year + + + The year when the track was released again. + + + Release country + + + The country of release of the track. + + + Release version + + + The version of the release, like the original one. + + + Language + + + Original language + + + Audio properties + + + Sample rate (Hz) + + + The sample rate of the audio of the track in Hz. + + + Channels + + + The number of audio channels of the track. + + + Bit depth + + + The bit depth of the audio of the track. + + + Audio codec + + + The audio codec used by the track. + + + Bitrate (kbps) + + + The bitrate of the audio of the track in kbps. + + + AcoustID + + + The AcoustID fingerprint identifier of the audio file of the track. + + + ReplayGain + + + Track gain (dB) + + + The ReplayGain track gain of the track in decibels. + + + Track peak + + + The ReplayGain track peak of the track. + + + Album gain (dB) + + + The ReplayGain album gain of the track in decibels. + + + Album peak + + + The ReplayGain album peak of the track. + + + Work type + + + The MusicBrainz type of the work, like Song. + + + Work ISWCs + + + The ISWCs of the work. + + + Work languages + + + The languages of the work. + + + Code + + + Name + + + Native name + + + Add language + + + The two letter code of the language of the track. + + + The name of the language of the track. + + + The native name of the language of the track. + + + Language code + + + Language name + + + Native name + + + Contributors + + + Contributor Id + + + Role + + + Add contributor + + + The people that contributed to the artist. + + + Ratings + + + Rating + + + Maximum rating + + + Source + + + Vote count + + + Add rating + + + The ratings of the artist from different sources. + + + Remove + + + Other + + + Author + + + Translator + + + Illustrator + + + Publisher + + + Narrator + + + Actor + + + Director + + + Screenwriter + + + Composer + + + Lyricist + + + Arranger + + + Conductor + + + Producer + + + Executive Producer + + + Engineer + + + Mixer + + + Remixer + + + Record Label + + + Vocals + + + Backing Vocals + + + Guitar + + + Bass Guitar + + + Drums + + + Percussion + + + Keyboards + + + Piano + + + Synthesizer + + + Strings + + + Woodwinds + + + Brass + + + Choir + + + Orchestrator + + + Performer + + + User + + + MusicBrainz + + + Discogs + + + Last.fm + + + Andorra + + + United Arab Emirates + + + Afghanistan + + + Antigua & Barbuda + + + Albania + + + Armenia + + + Netherlands Antilles + + + Angola + + + Argentina + + + Austria + + + Australia + + + Azerbaijan + + + Bosnia & Herzegovina + + + Barbados + + + Bangladesh + + + Belgium + + + Burkina Faso + + + Bulgaria + + + Bahrain + + + Burundi + + + Benin + + + Brunei + + + Bolivia + + + Brazil + + + Bahamas + + + Bhutan + + + Botswana + + + Belarus + + + Belize + + + Canada + + + Congo - Kinshasa + + + Central African Republic + + + Congo - Brazzaville + + + Switzerland + + + Côte d’Ivoire + + + Chile + + + Cameroon + + + China + + + Colombia + + + Costa Rica + + + Cuba + + + Cape Verde + + + Cyprus + + + Czechia + + + Germany + + + Djibouti + + + Denmark + + + Dominica + + + Dominican Republic + + + Algeria + + + Ecuador + + + Estonia + + + Egypt + + + Eritrea + + + Spain + + + Ethiopia + + + Finland + + + Fiji + + + Micronesia + + + France + + + Gabon + + + United Kingdom + + + Grenada + + + Georgia + + + Ghana + + + Gambia + + + Guinea + + + Equatorial Guinea + + + Greece + + + Guatemala + + + Guinea-Bissau + + + Guyana + + + Honduras + + + Croatia + + + Haiti + + + Hungary + + + Indonesia + + + Ireland + + + Israel + + + India + + + Iraq + + + Iran + + + Iceland + + + Italy + + + Jamaica + + + Jordan + + + Japan + + + Kenya + + + Kyrgyzstan + + + Cambodia + + + Kiribati + + + Comoros + + + St. Kitts & Nevis + + + North Korea + + + South Korea + + + Kuwait + + + Kazakhstan + + + Laos + + + Lebanon + + + St. Lucia + + + Liechtenstein + + + Sri Lanka + + + Liberia + + + Lesotho + + + Lithuania + + + Luxembourg + + + Latvia + + + Libya + + + Morocco + + + Monaco + + + Moldova + + + Montenegro + + + Madagascar + + + Marshall Islands + + + North Macedonia + + + Mali + + + Myanmar (Burma) + + + Mongolia + + + Mauritania + + + Malta + + + Mauritius + + + Maldives + + + Malawi + + + Mexico + + + Malaysia + + + Mozambique + + + Namibia + + + Niger + + + Nigeria + + + Nicaragua + + + Netherlands + + + Norway + + + Nepal + + + Nauru + + + New Zealand + + + Oman + + + Panama + + + Peru + + + Papua New Guinea + + + Philippines + + + Pakistan + + + Poland + + + Palestinian Territories + + + Portugal + + + Palau + + + Paraguay + + + Qatar + + + Romania + + + Serbia + + + Russia + + + Rwanda + + + Saudi Arabia + + + Solomon Islands + + + Seychelles + + + Sudan + + + Sweden + + + Singapore + + + Slovenia + + + Slovakia + + + Sierra Leone + + + San Marino + + + Senegal + + + Somalia + + + Suriname + + + South Sudan + + + São Tomé & Príncipe + + + El Salvador + + + Syria + + + Eswatini + + + Chad + + + Togo + + + Thailand + + + Tajikistan + + + Timor-Leste + + + Turkmenistan + + + Tunisia + + + Tonga + + + Türkiye + + + Trinidad & Tobago + + + Tuvalu + + + Taiwan + + + Tanzania + + + Ukraine + + + Uganda + + + United States + + + Uruguay + + + Uzbekistan + + + Vatican City + + + St. Vincent & Grenadines + + + Venezuela + + + Vietnam + + + Vanuatu + + + Samoa + + + Europe + + + Worldwide + + + Yemen + + + South Africa + + + Zambia + + + Zimbabwe + + + Genre + + + Add genre + + + Tag + + + Add tag + + + Mood + + + Add mood + + + ISRC + + + Add ISRC + + + ISWC + + + Add ISWC + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ro-RO.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ro-RO.resx new file mode 100644 index 00000000..58f0296d --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.ro-RO.resx @@ -0,0 +1,1182 @@ + + + + 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 + + + Înapoi la album + + + Editează piesa + + + Salvează + + + Piesa a fost salvată. + + + Elementul nu a putut fi salvat. + + + Șterge piesa + + + Piesa a fost ștearsă. + + + Sigur doriți să ștergeți acest element? + + + Elementul nu a putut fi șters. + + + Informații generale + + + Cale + + + Titlu + + + Titlu original + + + Număr piesă + + + Număr disc + + + Scriere + + + Tonalitate + + + BPM + + + Genuri + + + Etichete + + + Durată (secunde) + + + Identificatori + + + Id înregistrare MusicBrainz + + + Id piesă MusicBrainz + + + Operă + + + Titlul operei + + + Id MusicBrainz al operei + + + Stări + + + ISRCs + + + Do major + + + Do# major + + + Re major + + + Re# major + + + Mi major + + + Fa major + + + Fa# major + + + Sol major + + + Sol# major + + + La major + + + La# major + + + Si major + + + Do minor + + + Do# minor + + + Re minor + + + Re# minor + + + Mi minor + + + Fa minor + + + Fa# minor + + + Sol minor + + + Sol# minor + + + La minor + + + La# minor + + + Si minor + + + Calea pe disc a piesei. + + + Titlul piesei. + + + Titlul original al piesei, când diferă de cel actual. + + + Poziția piesei pe discul său. + + + Numărul discului căruia îi aparține piesa. + + + Scrierea folosită de limba piesei. + + + Tonalitatea piesei. + + + Tempo-ul piesei în bătăi pe minut. + + + Genurile piesei. + + + Etichetele piesei. + + + Durata piesei în secunde. + + + Identificatorul MusicBrainz al înregistrării. + + + Identificatorul MusicBrainz al piesei. + + + Titlul operei din care piesa este o înregistrare. + + + Identificatorul MusicBrainz al operei. + + + Stările piesei. + + + Codurile ISRC ale piesei. + + + Descriere + + + Un scurt rezumat sau o descriere a piesei. + + + Dezambiguizare + + + Un comentariu care distinge piesa de alte piese cu același titlu. + + + Înregistrare video + + + Dacă înregistrarea piesei este o înregistrare video. + + + Informații despre lansare + + + Data lansării originale + + + Data la care piesa a fost lansată original. + + + Anul lansării originale + + + Anul în care piesa a fost lansată original. + + + Data relansării + + + Data la care piesa a fost relansată. + + + Anul relansării + + + Anul în care piesa a fost relansată. + + + Țara de lansare + + + Țara de lansare a piesei. + + + Versiunea lansării + + + Versiunea lansării, precum cea originală. + + + Limba + + + Limba originală + + + Proprietăți audio + + + Rata de eșantionare (Hz) + + + Rata de eșantionare a audio-ului piesei în Hz. + + + Canale + + + Numărul de canale audio ale piesei. + + + Adâncimea de biți + + + Adâncimea de biți a audio-ului piesei. + + + Codec audio + + + Codec audio folosit de piesă. + + + Bitrate (kbps) + + + Bitrate-ul audio-ului piesei în kbps. + + + AcoustID + + + Identificatorul amprentei AcoustID al fișierului audio al piesei. + + + ReplayGain + + + Câștigul piesei (dB) + + + Câștigul ReplayGain al piesei în decibeli. + + + Vârful piesei + + + Vârful ReplayGain al piesei. + + + Câștigul albumului (dB) + + + Câștigul ReplayGain al albumului în decibeli. + + + Vârful albumului + + + Vârful ReplayGain al albumului. + + + Tipul operei + + + Tipul MusicBrainz al operei, precum Song. + + + ISWC-urile operei + + + Codurile ISWC ale lucrării. + + + Limbile operei + + + Limbile operei. + + + Code + + + Name + + + Nume nativ + + + Adaugă limbă + + + Codul de două litere al limbii piesei. + + + Numele limbii piesei. + + + Numele nativ al limbii piesei. + + + Codul limbii + + + Denumirea limbii + + + Denumire nativă + + + Contribuitori + + + Id contribuitor + + + Rol + + + Adaugă contributor + + + Persoanele care au contribuit la artist. + + + Ratinguri + + + Rating + + + Rating maxim + + + Sursă + + + Număr de voturi + + + Adaugă rating + + + Evaluările artistului din surse diferite. + + + Elimină + + + Altele + + + Autor + + + Traducător + + + Ilustrator + + + Editor + + + Narator + + + Actor + + + Regizor + + + Scenarist + + + Compozitor + + + Textier + + + Aranjor + + + Dirijor + + + Producător + + + Producător executiv + + + Inginer de sunet + + + Mixer + + + Remixer + + + Casă de discuri + + + Voce + + + Voci de acompaniament + + + Chitară + + + Chitară bas + + + Tobe + + + Percuție + + + Claviaturi + + + Pian + + + Sintetizator + + + Instrumente cu corzi + + + Instrumente de suflat din lemn + + + Instrumente de suflat din alamă + + + Cor + + + Orchestrator + + + Interpret + + + Utilizator + + + MusicBrainz + + + Discogs + + + Last.fm + + + Andorra + + + Emiratele Arabe Unite + + + Afganistan + + + Antigua și Barbuda + + + Albania + + + Armenia + + + Antilele Neerlandeze + + + Angola + + + Argentina + + + Austria + + + Australia + + + Azerbaidjan + + + Bosnia și Herțegovina + + + Barbados + + + Bangladesh + + + Belgia + + + Burkina Faso + + + Bulgaria + + + Bahrain + + + Burundi + + + Benin + + + Brunei + + + Bolivia + + + Brazilia + + + Bahamas + + + Bhutan + + + Botswana + + + Belarus + + + Belize + + + Canada + + + Congo - Kinshasa + + + Republica Centrafricană + + + Congo - Brazzaville + + + Elveția + + + Coasta de Fildeș + + + Chile + + + Camerun + + + China + + + Columbia + + + Costa Rica + + + Cuba + + + Capul Verde + + + Cipru + + + Cehia + + + Germania + + + Djibouti + + + Danemarca + + + Dominica + + + Republica Dominicană + + + Algeria + + + Ecuador + + + Estonia + + + Egipt + + + Eritreea + + + Spania + + + Etiopia + + + Finlanda + + + Fiji + + + Micronezia + + + Franța + + + Gabon + + + Regatul Unit + + + Grenada + + + Georgia + + + Ghana + + + Gambia + + + Guineea + + + Guineea Ecuatorială + + + Grecia + + + Guatemala + + + Guineea-Bissau + + + Guyana + + + Honduras + + + Croația + + + Haiti + + + Ungaria + + + Indonezia + + + Irlanda + + + Israel + + + India + + + Irak + + + Iran + + + Islanda + + + Italia + + + Jamaica + + + Iordania + + + Japonia + + + Kenya + + + Kârgâzstan + + + Cambodgia + + + Kiribati + + + Comore + + + Saint Kitts și Nevis + + + Coreea de Nord + + + Coreea de Sud + + + Kuweit + + + Kazahstan + + + Laos + + + Liban + + + Sfânta Lucia + + + Liechtenstein + + + Sri Lanka + + + Liberia + + + Lesotho + + + Lituania + + + Luxemburg + + + Letonia + + + Libia + + + Maroc + + + Monaco + + + Moldova + + + Muntenegru + + + Madagascar + + + Insulele Marshall + + + Macedonia de Nord + + + Mali + + + Myanmar (Birmania) + + + Mongolia + + + Mauritania + + + Malta + + + Mauritius + + + Maldive + + + Malawi + + + Mexic + + + Malaysia + + + Mozambic + + + Namibia + + + Niger + + + Nigeria + + + Nicaragua + + + Țările de Jos + + + Norvegia + + + Nepal + + + Nauru + + + Noua Zeelandă + + + Oman + + + Panama + + + Peru + + + Papua Noua Guinee + + + Filipine + + + Pakistan + + + Polonia + + + Teritoriile Palestiniene + + + Portugalia + + + Palau + + + Paraguay + + + Qatar + + + România + + + Serbia + + + Rusia + + + Rwanda + + + Arabia Saudită + + + Insulele Solomon + + + Seychelles + + + Sudan + + + Suedia + + + Singapore + + + Slovenia + + + Slovacia + + + Sierra Leone + + + San Marino + + + Senegal + + + Somalia + + + Suriname + + + Sudanul de Sud + + + São Tomé și Príncipe + + + El Salvador + + + Siria + + + Eswatini + + + Ciad + + + Togo + + + Thailanda + + + Tadjikistan + + + Timor-Leste + + + Turkmenistan + + + Tunisia + + + Tonga + + + Turcia + + + Trinidad și Tobago + + + Tuvalu + + + Taiwan + + + Tanzania + + + Ucraina + + + Uganda + + + Statele Unite + + + Uruguay + + + Uzbekistan + + + Vatican + + + Saint Vincent și Grenadine + + + Venezuela + + + Vietnam + + + Vanuatu + + + Samoa + + + Europa + + + La nivel mondial + + + Yemen + + + Africa de Sud + + + Zambia + + + Zimbabwe + + + Gen + + + Adaugă gen + + + Etichetă + + + Adaugă etichetă + + + Stare de spirit + + + Adaugă stare de spirit + + + ISRC + + + Adaugă ISRC + + + ISWC + + + Adaugă ISWC + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.uk-UA.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.uk-UA.resx new file mode 100644 index 00000000..e18711ea --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.uk-UA.resx @@ -0,0 +1,1182 @@ + + + + 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 + + + Назад до альбому + + + Редагувати трек + + + Зберегти + + + Трек збережено. + + + Не вдалося зберегти елемент. + + + Видалити трек + + + Трек видалено. + + + Ви впевнені, що хочете видалити цей елемент? + + + Не вдалося видалити елемент. + + + Загальна інформація + + + Шлях + + + Назва + + + Оригінальна назва + + + Номер треку + + + Номер диска + + + Письмо + + + Тональність + + + BPM + + + Жанри + + + Теги + + + Тривалість (секунди) + + + Ідентифікатори + + + Ідентифікатор запису MusicBrainz + + + Ідентифікатор треку MusicBrainz + + + Твір + + + Назва твору + + + Ідентифікатор MusicBrainz твору + + + Настрої + + + ISRCs + + + До мажор + + + До# мажор + + + Ре мажор + + + Ре# мажор + + + Мі мажор + + + Фа мажор + + + Фа# мажор + + + Соль мажор + + + Соль# мажор + + + Ля мажор + + + Ля# мажор + + + Сі мажор + + + До мінор + + + До# мінор + + + Ре мінор + + + Ре# мінор + + + Мі мінор + + + Фа мінор + + + Фа# мінор + + + Соль мінор + + + Соль# мінор + + + Ля мінор + + + Ля# мінор + + + Сі мінор + + + Шлях до файлу треку у файловій системі. + + + Назва треку. + + + Оригінальна назва треку, якщо вона відрізняється від поточної. + + + Позиція треку на диску. + + + Номер диска, до якого належить трек. + + + Система письма, яку використовує мова треку. + + + Музична тональність треку. + + + Темп треку в ударах на хвилину. + + + Жанри треку. + + + Теги треку. + + + Тривалість треку в секундах. + + + Ідентифікатор запису у MusicBrainz. + + + Ідентифікатор треку у MusicBrainz. + + + Назва твору, записом якого є трек. + + + Ідентифікатор твору у MusicBrainz. + + + Настрої треку. + + + Коди ISRC треку. + + + Опис + + + Короткий підсумок або опис треку. + + + Уточнення + + + Коментар, що відрізняє трек від інших із такою самою назвою. + + + Відеозапис + + + Чи є запис треку відеозаписом. + + + Інформація про випуск + + + Дата оригінального випуску + + + Дата, коли трек було вперше випущено. + + + Рік оригінального випуску + + + Рік, коли трек було вперше випущено. + + + Дата повторного випуску + + + Дата, коли трек було випущено знову. + + + Рік повторного випуску + + + Рік, коли трек було випущено знову. + + + Країна випуску + + + Країна випуску треку. + + + Версія випуску + + + Версія випуску, наприклад оригінальна. + + + Мова + + + Оригінальна мова + + + Аудіовластивості + + + Частота дискретизації (Hz) + + + Частота дискретизації аудіо треку в Hz. + + + Канали + + + Кількість аудіоканалів треку. + + + Глибина бітів + + + Глибина бітів аудіо треку. + + + Аудіокодек + + + Аудіокодек, використаний у треку. + + + Бітрейт (kbps) + + + Бітрейт аудіо треку в kbps. + + + AcoustID + + + Ідентифікатор відбитка AcoustID аудіофайлу треку. + + + ReplayGain + + + Підсилення треку (dB) + + + Підсилення треку ReplayGain у децибелах. + + + Пік треку + + + Пік треку ReplayGain. + + + Підсилення альбому (dB) + + + Підсилення альбому ReplayGain у децибелах. + + + Пік альбому + + + Пік альбому ReplayGain. + + + Тип твору + + + Тип твору в MusicBrainz, наприклад Song. + + + ISWC твору + + + Коди ISWC твору. + + + Мови твору + + + Мови твору. + + + Code + + + Name + + + Рідна назва + + + Додати мову + + + Дволітерний код мови треку. + + + Назва мови треку. + + + Рідна назва мови треку. + + + Код мови + + + Назва мови + + + Власна назва + + + Учасники + + + Ідентифікатор учасника + + + Роль + + + Додати учасника + + + Люди, які зробили внесок у виконавця. + + + Оцінки + + + Оцінка + + + Максимальна оцінка + + + Джерело + + + Кількість голосів + + + Додати оцінку + + + Оцінки виконавця з різних джерел. + + + Видалити + + + Інше + + + Автор + + + Перекладач + + + Ілюстратор + + + Видавець + + + Оповідач + + + Актор + + + Режисер + + + Сценарист + + + Композитор + + + Автор текстів + + + Аранжувальник + + + Диригент + + + Продюсер + + + Виконавчий продюсер + + + Інженер + + + Мікшер + + + Реміксер + + + Лейбл звукозапису + + + Вокал + + + Бек-вокал + + + Гітара + + + Бас-гітара + + + Барабани + + + Перкусія + + + Клавішні + + + Піаніно + + + Синтезатор + + + Струнні + + + Дерев'яні духові + + + Мідні духові + + + Хор + + + Оркестратор + + + Виконавець + + + Користувач + + + MusicBrainz + + + Discogs + + + Last.fm + + + Андорра + + + Об'єднані Арабські Емірати + + + Афганістан + + + Антигуа і Барбуда + + + Албанія + + + Вірменія + + + Нідерландські Антильські острови + + + Ангола + + + Аргентина + + + Австрія + + + Австралія + + + Азербайджан + + + Боснія і Герцеговина + + + Барбадос + + + Бангладеш + + + Бельгія + + + Буркіна-Фасо + + + Болгарія + + + Бахрейн + + + Бурунді + + + Бенін + + + Бруней + + + Болівія + + + Бразилія + + + Багамські острови + + + Бутан + + + Ботсвана + + + Білорусь + + + Беліз + + + Канада + + + Конго - Кіншаса + + + Центральноафриканська Республіка + + + Конго - Браззавіль + + + Швейцарія + + + Кот-д'Івуар + + + Чилі + + + Камерун + + + Китай + + + Колумбія + + + Коста-Рика + + + Куба + + + Кабо-Верде + + + Кіпр + + + Чехія + + + Німеччина + + + Джибуті + + + Данія + + + Домініка + + + Домініканська Республіка + + + Алжир + + + Еквадор + + + Естонія + + + Єгипет + + + Еритрея + + + Іспанія + + + Ефіопія + + + Фінляндія + + + Фіджі + + + Мікронезія + + + Франція + + + Габон + + + Велика Британія + + + Гренада + + + Грузія + + + Гана + + + Гамбія + + + Гвінея + + + Екваторіальна Гвінея + + + Греція + + + Гватемала + + + Гвінея-Бісау + + + Гаяна + + + Гондурас + + + Хорватія + + + Гаїті + + + Угорщина + + + Індонезія + + + Ірландія + + + Ізраїль + + + Індія + + + Ірак + + + Іран + + + Ісландія + + + Італія + + + Ямайка + + + Йорданія + + + Японія + + + Кенія + + + Киргизстан + + + Камбоджа + + + Кірибаті + + + Коморські острови + + + Сент-Кітс і Невіс + + + Північна Корея + + + Південна Корея + + + Кувейт + + + Казахстан + + + Лаос + + + Ліван + + + Сент-Люсія + + + Ліхтенштейн + + + Шрі-Ланка + + + Ліберія + + + Лесото + + + Литва + + + Люксембург + + + Латвія + + + Лівія + + + Марокко + + + Монако + + + Молдова + + + Чорногорія + + + Мадагаскар + + + Маршаллові Острови + + + Північна Македонія + + + Малі + + + М'янма (Бірма) + + + Монголія + + + Мавританія + + + Мальта + + + Маврикій + + + Мальдіви + + + Малаві + + + Мексика + + + Малайзія + + + Мозамбік + + + Намібія + + + Нігер + + + Нігерія + + + Нікарагуа + + + Нідерланди + + + Норвегія + + + Непал + + + Науру + + + Нова Зеландія + + + Оман + + + Панама + + + Перу + + + Папуа-Нова Гвінея + + + Філіппіни + + + Пакистан + + + Польща + + + Палестинські території + + + Португалія + + + Палау + + + Парагвай + + + Катар + + + Румунія + + + Сербія + + + Росія + + + Руанда + + + Саудівська Аравія + + + Соломонові Острови + + + Сейшельські Острови + + + Судан + + + Швеція + + + Сінгапур + + + Словенія + + + Словаччина + + + Сьєрра-Леоне + + + Сан-Марино + + + Сенегал + + + Сомалі + + + Суринам + + + Південний Судан + + + Сан-Томе і Принсіпі + + + Сальвадор + + + Сирія + + + Есватіні + + + Чад + + + Того + + + Таїланд + + + Таджикистан + + + Тимор-Лешті + + + Туркменістан + + + Туніс + + + Тонга + + + Туреччина + + + Тринідад і Тобаго + + + Тувалу + + + Тайвань + + + Танзанія + + + Україна + + + Уганда + + + Сполучені Штати Америки + + + Уругвай + + + Узбекистан + + + Ватикан + + + Сент-Вінсент і Гренадини + + + Венесуела + + + В'єтнам + + + Вануату + + + Самоа + + + Європа + + + Увесь світ + + + Ємен + + + Південно-Африканська Республіка + + + Замбія + + + Зімбабве + + + Жанр + + + Додати жанр + + + Тег + + + Додати тег + + + Настрій + + + Додати настрій + + + ISRC + + + Додати ISRC + + + ISWC + + + Додати ISWC + + diff --git a/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.zh-CN.resx b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.zh-CN.resx new file mode 100644 index 00000000..ba893c16 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Resources/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.zh-CN.resx @@ -0,0 +1,1182 @@ + + + + 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 + + + 返回专辑 + + + 编辑曲目 + + + 保存 + + + 曲目已保存。 + + + 无法保存该项目。 + + + 删除曲目 + + + 曲目已删除。 + + + 确定要删除此项目吗? + + + 无法删除该项目。 + + + 常规信息 + + + 路径 + + + 标题 + + + 原标题 + + + 曲目编号 + + + 光盘编号 + + + 文字 + + + 调 + + + BPM + + + 体裁 + + + 标签 + + + 时长(秒) + + + 标识符 + + + MusicBrainz 录音 Id + + + MusicBrainz 曲目 Id + + + 作品 + + + 作品标题 + + + 作品 MusicBrainz Id + + + 情绪 + + + ISRCs + + + C 大调 + + + C# 大调 + + + D 大调 + + + D# 大调 + + + E 大调 + + + F 大调 + + + F# 大调 + + + G 大调 + + + G# 大调 + + + A 大调 + + + A# 大调 + + + B 大调 + + + C 小调 + + + C# 小调 + + + D 小调 + + + D# 小调 + + + E 小调 + + + F 小调 + + + F# 小调 + + + G 小调 + + + G# 小调 + + + A 小调 + + + A# 小调 + + + B 小调 + + + 音轨的文件路径。 + + + 音轨的标题。 + + + 与当前标题不同时的音轨原始标题。 + + + 音轨在其唱片上的位置。 + + + 音轨所属的唱片编号。 + + + 音轨语言使用的文字。 + + + 音轨的调。 + + + 音轨的速度,以每分钟节拍数表示。 + + + 音轨的流派。 + + + 音轨的标签。 + + + 音轨的时长(秒)。 + + + 录音的MusicBrainz标识符。 + + + 音轨的MusicBrainz标识符。 + + + 音轨所录制作品的标题。 + + + 作品的MusicBrainz标识符。 + + + 音轨的情绪。 + + + 音轨的 ISRC。 + + + 描述 + + + 曲目的简短摘要或描述。 + + + 消歧义 + + + 用于将曲目与其他同名曲目区分开的注释。 + + + 视频录制 + + + 曲目的录音是否为视频录制。 + + + 发行信息 + + + 原始发行日期 + + + 曲目最初发行的日期。 + + + 原始发行年份 + + + 曲目最初发行的年份。 + + + 重新发行日期 + + + 曲目再次发行的日期。 + + + 重新发行年份 + + + 曲目再次发行的年份。 + + + 发行国家 + + + 曲目的发行国家。 + + + 发行版本 + + + 发行的版本,例如原始版本。 + + + 语言 + + + 原始语言 + + + 音频属性 + + + 采样率 (Hz) + + + 曲目音频的采样率,单位为 Hz。 + + + 声道 + + + 曲目的音频声道数。 + + + 位深度 + + + 曲目音频的位深度。 + + + 音频编解码器 + + + 曲目使用的音频编解码器。 + + + 比特率 (kbps) + + + 曲目音频的比特率,单位为 kbps。 + + + AcoustID + + + 曲目音频文件的 AcoustID 指纹标识符。 + + + ReplayGain + + + 曲目增益 (dB) + + + 曲目的 ReplayGain 曲目增益,单位为分贝。 + + + 曲目峰值 + + + 曲目的 ReplayGain 曲目峰值。 + + + 专辑增益 (dB) + + + 曲目的 ReplayGain 专辑增益,单位为分贝。 + + + 专辑峰值 + + + 曲目的 ReplayGain 专辑峰值。 + + + 作品类型 + + + 作品的 MusicBrainz 类型,例如 Song。 + + + 作品 ISWC + + + 作品的 ISWC。 + + + 作品语言 + + + 作品的语言。 + + + 代码 + + + 名称 + + + 本地名称 + + + 添加语言 + + + 曲目语言的双字母代码。 + + + 曲目语言的名称。 + + + 曲目语言的本地名称。 + + + 语言代码 + + + 语言名称 + + + 本地语名称 + + + 贡献者 + + + 贡献者 Id + + + 角色 + + + 添加贡献者 + + + 为艺术家做出贡献的人员。 + + + 评分 + + + 评分 + + + 最高评分 + + + 来源 + + + 票数 + + + 添加评分 + + + 来自不同来源的艺术家评分。 + + + 删除 + + + 其他 + + + 作者 + + + 译者 + + + 插画师 + + + 出版商 + + + 旁白 + + + 演员 + + + 导演 + + + 编剧 + + + 作曲 + + + 作词 + + + 编曲 + + + 指挥 + + + 制作人 + + + 执行制作人 + + + 工程师 + + + 混音师 + + + 重混师 + + + 唱片公司 + + + 人声 + + + 和声 + + + 吉他 + + + 贝斯 + + + 鼓 + + + 打击乐 + + + 键盘 + + + 钢琴 + + + 合成器 + + + 弦乐 + + + 木管乐 + + + 铜管乐 + + + 合唱 + + + 配器 + + + 表演者 + + + 用户 + + + MusicBrainz + + + Discogs + + + Last.fm + + + 安道尔 + + + 阿拉伯联合酋长国 + + + 阿富汗 + + + 安提瓜和巴布达 + + + 阿尔巴尼亚 + + + 亚美尼亚 + + + 荷属安的列斯 + + + 安哥拉 + + + 阿根廷 + + + 奥地利 + + + 澳大利亚 + + + 阿塞拜疆 + + + 波斯尼亚和黑塞哥维那 + + + 巴巴多斯 + + + 孟加拉国 + + + 比利时 + + + 布基纳法索 + + + 保加利亚 + + + 巴林 + + + 布隆迪 + + + 贝宁 + + + 文莱 + + + 玻利维亚 + + + 巴西 + + + 巴哈马 + + + 不丹 + + + 博茨瓦纳 + + + 白俄罗斯 + + + 伯利兹 + + + 加拿大 + + + 刚果(金沙萨) + + + 中非共和国 + + + 刚果(布拉柴维尔) + + + 瑞士 + + + 科特迪瓦 + + + 智利 + + + 喀麦隆 + + + 中国 + + + 哥伦比亚 + + + 哥斯达黎加 + + + 古巴 + + + 佛得角 + + + 塞浦路斯 + + + 捷克 + + + 德国 + + + 吉布提 + + + 丹麦 + + + 多米尼克 + + + 多米尼加共和国 + + + 阿尔及利亚 + + + 厄瓜多尔 + + + 爱沙尼亚 + + + 埃及 + + + 厄立特里亚 + + + 西班牙 + + + 埃塞俄比亚 + + + 芬兰 + + + 斐济 + + + 密克罗尼西亚 + + + 法国 + + + 加蓬 + + + 英国 + + + 格林纳达 + + + 格鲁吉亚 + + + 加纳 + + + 冈比亚 + + + 几内亚 + + + 赤道几内亚 + + + 希腊 + + + 危地马拉 + + + 几内亚比绍 + + + 圭亚那 + + + 洪都拉斯 + + + 克罗地亚 + + + 海地 + + + 匈牙利 + + + 印度尼西亚 + + + 爱尔兰 + + + 以色列 + + + 印度 + + + 伊拉克 + + + 伊朗 + + + 冰岛 + + + 意大利 + + + 牙买加 + + + 约旦 + + + 日本 + + + 肯尼亚 + + + 吉尔吉斯斯坦 + + + 柬埔寨 + + + 基里巴斯 + + + 科摩罗 + + + 圣基茨和尼维斯 + + + 朝鲜 + + + 韩国 + + + 科威特 + + + 哈萨克斯坦 + + + 老挝 + + + 黎巴嫩 + + + 圣卢西亚 + + + 列支敦士登 + + + 斯里兰卡 + + + 利比里亚 + + + 莱索托 + + + 立陶宛 + + + 卢森堡 + + + 拉脱维亚 + + + 利比亚 + + + 摩洛哥 + + + 摩纳哥 + + + 摩尔多瓦 + + + 黑山 + + + 马达加斯加 + + + 马绍尔群岛 + + + 北马其顿 + + + 马里 + + + 缅甸 + + + 蒙古 + + + 毛里塔尼亚 + + + 马耳他 + + + 毛里求斯 + + + 马尔代夫 + + + 马拉维 + + + 墨西哥 + + + 马来西亚 + + + 莫桑比克 + + + 纳米比亚 + + + 尼日尔 + + + 尼日利亚 + + + 尼加拉瓜 + + + 荷兰 + + + 挪威 + + + 尼泊尔 + + + 瑙鲁 + + + 新西兰 + + + 阿曼 + + + 巴拿马 + + + 秘鲁 + + + 巴布亚新几内亚 + + + 菲律宾 + + + 巴基斯坦 + + + 波兰 + + + 巴勒斯坦领土 + + + 葡萄牙 + + + 帕劳 + + + 巴拉圭 + + + 卡塔尔 + + + 罗马尼亚 + + + 塞尔维亚 + + + 俄罗斯 + + + 卢旺达 + + + 沙特阿拉伯 + + + 所罗门群岛 + + + 塞舌尔 + + + 苏丹 + + + 瑞典 + + + 新加坡 + + + 斯洛文尼亚 + + + 斯洛伐克 + + + 塞拉利昂 + + + 圣马力诺 + + + 塞内加尔 + + + 索马里 + + + 苏里南 + + + 南苏丹 + + + 圣多美和普林西比 + + + 萨尔瓦多 + + + 叙利亚 + + + 斯威士兰 + + + 乍得 + + + 多哥 + + + 泰国 + + + 塔吉克斯坦 + + + 东帝汶 + + + 土库曼斯坦 + + + 突尼斯 + + + 汤加 + + + 土耳其 + + + 特立尼达和多巴哥 + + + 图瓦卢 + + + 台湾 + + + 坦桑尼亚 + + + 乌克兰 + + + 乌干达 + + + 美国 + + + 乌拉圭 + + + 乌兹别克斯坦 + + + 梵蒂冈 + + + 圣文森特和格林纳丁斯 + + + 委内瑞拉 + + + 越南 + + + 瓦努阿图 + + + 萨摩亚 + + + 欧洲 + + + 全球 + + + 也门 + + + 南非 + + + 赞比亚 + + + 津巴布韦 + + + 流派 + + + 添加流派 + + + 标签 + + + 添加标签 + + + 情绪 + + + 添加情绪 + + + ISRC + + + 添加 ISRC + + + ISWC + + + 添加 ISWC + + 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 new file mode 100644 index 00000000..731f9935 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Albums/Item.cshtml @@ -0,0 +1,1120 @@ +@* + FALLBACK MUSIC ALBUM DETAILS / EDITING VIEW - READ BEFORE EDITING + + This view is the application fallback of the music album details and editing page, rendered only when the + active theme does not provide its own template for the page. On a healthy site the page is presented by + the theme files, which hook into the class names and element ids that this view uses as a contract. + + The tracks of the album are NOT edited inline: they are listed as cards that navigate to their own pages, + and the update request never changes the tracks. + + To change the behavior of the page, edit this script (and the theme template, when present). To restyle + the page, edit the theme files. This fallback keeps every feature working without styling, so that a + broken theme is obvious to the user while the page still functions. + + /library/audio-library/music-library/artists/{artistId}/albums/{albumId}?libraryId=... +*@ + +@using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary +@using Lumina.Presentation.Web.Common.Enums.AudioLibrary +@using Lumina.Presentation.Web.Common.Enums.Common +@using Lumina.Presentation.Web.Common.Enums.MediaContributors +@using Lumina.Presentation.Web.Common.Services +@using Microsoft.AspNetCore.Mvc.Localization +@using System +@using System.Globalization +@using System.Linq + +@{ + // 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 artistId = Model.ArtistId.ToString(); + var albumId = Model.Id.ToString(); + var libraryId = Model.LibraryId.ToString(); + var metadata = Model.Metadata; + var releaseInfo = metadata?.ReleaseInfo; + var language = metadata?.Language; + var originalLanguage = metadata?.OriginalLanguage; + var genres = metadata?.Genres ?? []; + var tags = metadata?.Tags ?? []; + var releaseTypes = metadata?.ReleaseTypes ?? []; + var contributors = Model.Contributors ?? []; + var ratings = Model.Ratings ?? []; + // Resolves the localized label of a release country, shown as "DE (Germany)", keyed by its ISO code. + Func releaseCountryLabel = countryCode => + { + if (string.IsNullOrEmpty(countryCode)) + return "-"; + string localizedName = _localizer[$"Country.{countryCode}"].Value; + if (localizedName == $"Country.{countryCode}") + return countryCode; + return $"{countryCode} ({localizedName})"; + }; + var currentReleaseCountry = releaseInfo?.ReleaseCountry?.ToString() ?? string.Empty; + // The localized options of the release types, contributor roles and rating sources, serialized for the dynamic rows of the client script. + var releaseTypeOptionsJson = System.Text.Json.JsonSerializer.Serialize( + Enum.GetNames().Select(type => new { value = type, label = _localizer[type].Value }), + new System.Text.Json.JsonSerializerOptions { PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase }); + var contributorRoleOptionsJson = System.Text.Json.JsonSerializer.Serialize( + Enum.GetNames().Select(role => new { value = role, label = _localizer[role].Value }), + new System.Text.Json.JsonSerializerOptions { PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase }); + var ratingSourceOptionsJson = System.Text.Json.JsonSerializer.Serialize( + Enum.GetNames().Select(source => new { value = source, label = _localizer[source].Value }), + new System.Text.Json.JsonSerializerOptions { PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase }); + // The stored artwork of the album, each with the localized label of its type, serialized for the client carousel script. + var artworkItems = (Model.Artwork ?? []) + .Where(artwork => !string.IsNullOrWhiteSpace(artwork.Path)) + .Select(artwork => new + { + path = artwork.Path, + label = artwork.Ordinal > 0 + ? $"{_localizer[artwork.Type.ToString()].Value} {artwork.Ordinal}" + : _localizer[artwork.Type.ToString()].Value + }) + .ToList(); + var artworkItemsJson = System.Text.Json.JsonSerializer.Serialize(artworkItems); +} + +@inject IViewLocalizer _localizer +@inject IUrlService _urlService + +@model MusicAlbumDto + +@Html.AntiForgeryToken() + +
+
+
+
+
+ +
+
+

@_localizer["EditAlbum"]

+
+
+ +
+ @_localizer[ + +
+ + +
+
+ @(Model.CoverPath ?? _localizer["NoCover"].Value) +
+
+ +
+ +

@_localizer["Tracks"]

+
+ + + + + + + +
+ + @_localizer["TracksDescription"] +
+ +

@_localizer["GeneralInformation"]

+ +
+
*:
+
+ @_localizer["AlbumTitleDescription"] +
+ +
+
:
+
+ @_localizer["AlbumOriginalTitleDescription"] +
+ +
+
:
+
+ @_localizer["AlbumDescriptionDescription"] +
+ +
+
:
+
+ @_localizer["AlbumDisambiguationDescription"] +
+ +
+
:
+
+ @_localizer["AlbumScriptDescription"] +
+ +
+
:
+
+
+
+ + +
+
-
+ @foreach (string status in Enum.GetNames()) + { +
@_localizer[status].Value
+ } +
+
+
+ @_localizer["AlbumReleaseStatusDescription"] +
+ +
+
:
+
+ @_localizer["AlbumTotalDiscsDescription"] +
+ +
+
:
+
+ @_localizer["AlbumTotalTracksDescription"] +
+ +
+
:
+
+ @_localizer["AlbumReleaseTitleDescription"] +
+ +
+
:
+
+
+
+ + +
+
-
+ @foreach (string format in Enum.GetNames()) + { +
@_localizer[format].Value
+ } +
+
+
+ @_localizer["AlbumMediaFormatDescription"] +
+ +
+
:
+
+
+
+ + +
+
-
+ @foreach (string packaging in Enum.GetNames()) + { +
@_localizer[packaging].Value
+ } +
+
+
+ @_localizer["AlbumPackagingDescription"] +
+ + +

@_localizer["Contributors"]

+
+ + + + + + + + + + @{ int contributorIndex = 0; } + @foreach (var contributor in contributors) + { + + + + + + contributorIndex++; + } + +
@_localizer["ContributorId"]@_localizer["ContributorRole"]
+
+
+ + +
+
-
+ @foreach (string role in Enum.GetNames()) + { +
@_localizer[role].Value
+ } +
+
+
@_localizer[
+ + @_localizer["ContributorsDescription"] +
+ + +

@_localizer["Ratings"]

+
+ + + + + + + + + + + + @{ int ratingIndex = 0; } + @foreach (var rating in ratings) + { + + + + + + + + ratingIndex++; + } + +
@_localizer["RatingValue"]@_localizer["RatingMaxValue"]@_localizer["RatingSource"]@_localizer["RatingVoteCount"]
+
+
+ + +
+
-
+ @foreach (string source in Enum.GetNames()) + { +
@_localizer[source].Value
+ } +
+
+
@_localizer[
+ + @_localizer["RatingsDescription"] +
+ + +

@_localizer["AlbumGenres"]

+
+ + + + + + + + + @foreach (var genre in genres) + { + + + + + } + +
@_localizer["Genre"]
@_localizer[
+ + @_localizer["AlbumGenresDescription"] +
+ +

@_localizer["AlbumTags"]

+
+ + + + + + + + + @foreach (var tag in tags) + { + + + + + } + +
@_localizer["Tag"]
@_localizer[
+ + @_localizer["AlbumTagsDescription"] +
+ +

@_localizer["AlbumReleaseTypes"]

+
+ + + + + + + + + @{ int releaseTypeIndex = 0; } + @foreach (var releaseType in releaseTypes) + { + + + + + releaseTypeIndex++; + } + +
@_localizer["ReleaseType"]
+
+
+ + +
+
-
+ @foreach (string releaseTypeOption in Enum.GetNames()) + { +
@_localizer[releaseTypeOption].Value
+ } +
+
+
@_localizer[
+ + @_localizer["AlbumReleaseTypesDescription"] +
+ + +

@_localizer["AlbumReleaseInformation"]

+ +
+
:
+
+ @_localizer["AlbumOriginalReleaseDateDescription"] +
+ +
+
:
+
+ @_localizer["AlbumOriginalReleaseYearDescription"] +
+ +
+
:
+
+ @_localizer["AlbumReReleaseDateDescription"] +
+ +
+
:
+
+ @_localizer["AlbumReReleaseYearDescription"] +
+ +
+
:
+
+
+
+ + +
+
-
+ @foreach (string country in Enum.GetNames()) + { +
@releaseCountryLabel(country)
+ } +
+
+
+ @_localizer["AlbumReleaseCountryDescription"] +
+ +
+
:
+
+ @_localizer["AlbumReleaseVersionDescription"] +
+ + +

@_localizer["AlbumLanguage"]

+ +
+
:
+
+ @_localizer["LanguageCodeDescription"] +
+ +
+
:
+
+ @_localizer["LanguageNameDescription"] +
+ +
+
:
+
+ @_localizer["NativeNameDescription"] +
+ +

@_localizer["AlbumOriginalLanguage"]

+ +
+
:
+
+ @_localizer["LanguageCodeDescription"] +
+ +
+
:
+
+ @_localizer["LanguageNameDescription"] +
+ +
+
:
+
+ @_localizer["NativeNameDescription"] +
+ + +

@_localizer["AlbumCatalogNumbers"]

+
+ + + + + + + + + @foreach (string catalogNumber in Model.CatalogNumbers ?? []) + { + + + + + } + +
@_localizer["CatalogNumber"]
@_localizer[
+ + @_localizer["AlbumCatalogNumbersDescription"] +
+ + +

@_localizer["Identifiers"]

+ +
+
:
+
+ @_localizer["AlbumBarcodeDescription"] +
+ +
+
:
+
+ @_localizer["AlbumLabelDescription"] +
+ +
+
:
+
+ @_localizer["AlbumAsinDescription"] +
+ +
+
:
+
+ @_localizer["AlbumMusicBrainzReleaseIdDescription"] +
+ +
+
:
+
+ @_localizer["AlbumMusicBrainzReleaseGroupIdDescription"] +
+ +
+
:
+
+ @_localizer["AlbumMusicBrainzReleaseArtistIdDescription"] +
+ +
+ + +
+
+
+
+
+ +@section Scripts { + + +} 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 new file mode 100644 index 00000000..968984d8 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Artists/Index.cshtml @@ -0,0 +1,486 @@ +@* + FALLBACK MUSIC ARTISTS BROWSING VIEW - READ BEFORE EDITING + + This view is the application fallback of the music artists browsing page, rendered only when the theme template + of the page cannot be loaded. On a healthy site the page comes from the theme's + library/audio-library/music-library/artists/index template. It keeps the DOM contract and the client script the + theme template mirrors, so that navigation, searching and the card actions menu keep working even without the theme. + + 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. + +/library/audio-library/music-library/artists?libraryId=... +*@ + +@using Lumina.Presentation.Web.Common.DTO.Libraries +@using Lumina.Presentation.Web.Common.Services +@using Microsoft.AspNetCore.Mvc.Localization + +@{ + // 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(); +} + +@inject IViewLocalizer _localizer +@inject IUrlService _urlService + +@model LibraryDto + +@Html.AntiForgeryToken() + +
+ +
+ +
+
+ +
+

@(Model.Title ?? string.Empty)

+
+
+ + + + + + + +
+
+ +
+ + + +
+ +
+
+ + +
+
+
+ +@section Scripts { + + +} 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 new file mode 100644 index 00000000..10142b94 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Artists/Item.cshtml @@ -0,0 +1,1325 @@ +@* + FALLBACK MUSIC ARTIST DETAILS / EDITING VIEW - READ BEFORE EDITING + + This view is the application fallback of the music artist details and editing page, rendered only when the + active theme does not provide its own template for the page. On a healthy site the page is presented + by the theme files, which hook into the class names and element ids that this view uses as a contract, + exactly like the media library editing page. + + The albums of the artist are NOT edited inline: they are listed as cards that navigate to their own pages, + and the update request only round-trips the albums unchanged, so that updating the artist never drops them. + + To change the behavior of the page, edit this script (and the theme template, when present). To restyle + the page, edit the theme files. This fallback keeps every feature working without styling, so that a + broken theme is obvious to the user while the page still functions. + + /library/audio-library/music-library/artists/{artistId}?libraryId=... +*@ + +@using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary +@using Lumina.Presentation.Web.Common.Enums.AudioLibrary +@using Lumina.Presentation.Web.Common.Enums.Common +@using Lumina.Presentation.Web.Common.Enums.MediaContributors +@using Lumina.Presentation.Web.Common.Services +@using Microsoft.AspNetCore.Mvc.Localization +@using System +@using System.Globalization +@using System.Linq + +@{ + // 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 artistId = Model.Id.ToString(); + var libraryId = Model.LibraryId.ToString(); + var metadata = Model.Metadata; + var aliases = metadata?.Aliases ?? []; + var contributors = Model.Contributors ?? []; + var ratings = Model.Ratings ?? []; + var genres = metadata?.Genres ?? []; + var tags = metadata?.Tags ?? []; + var area = metadata?.Area; + var beginArea = metadata?.BeginArea; + var endArea = metadata?.EndArea; + // Resolves the localized label of a release country, shown as "DE (Germany)", keyed by its ISO code. + Func releaseCountryLabel = countryCode => + { + if (string.IsNullOrEmpty(countryCode)) + return "-"; + string localizedName = _localizer[$"Country.{countryCode}"].Value; + if (localizedName == $"Country.{countryCode}") + return countryCode; + return $"{countryCode} ({localizedName})"; + }; + // The baseline of the albums of the artist, mapped to the update request shape, so that the update round-trips them unchanged. + var albumsBaseline = (Model.Albums ?? []).Select(album => new + { + AlbumId = album.Id, + Metadata = album.Metadata, + MediaFormat = album.MediaFormat, + Packaging = album.Packaging, + Barcode = album.Barcode, + CatalogNumbers = album.CatalogNumbers, + Label = album.Label, + ASIN = album.ASIN, + MusicBrainzReleaseId = album.MusicBrainzReleaseId, + MusicBrainzReleaseGroupId = album.MusicBrainzReleaseGroupId, + MusicBrainzReleaseArtistId = album.MusicBrainzReleaseArtistId, + Contributors = album.Contributors, + Ratings = album.Ratings, + Tracks = (album.Tracks ?? []).Select(track => new + { + TrackId = track.Id, + Path = track.Path, + Metadata = track.Metadata, + TrackNumber = track.TrackNumber, + DiscNumber = track.DiscNumber, + Script = track.Script, + Key = track.Key, + Bpm = track.Bpm, + Work = track.Work, + MusicBrainzRecordingId = track.MusicBrainzRecordingId, + MusicBrainzTrackId = track.MusicBrainzTrackId, + Moods = track.Moods, + Isrcs = track.Isrcs, + Contributors = track.Contributors, + Ratings = track.Ratings + }) + }); + var albumsBaselineJson = System.Text.Json.JsonSerializer.Serialize(albumsBaseline, new System.Text.Json.JsonSerializerOptions { Converters = { new System.Text.Json.Serialization.JsonStringEnumConverter() } }); + // The localized options of the contributor roles and rating sources, serialized for the dynamic rows of the client script. + var contributorRoleOptionsJson = System.Text.Json.JsonSerializer.Serialize( + Enum.GetNames().Select(role => new { value = role, label = _localizer[role].Value }), + new System.Text.Json.JsonSerializerOptions { PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase }); + var ratingSourceOptionsJson = System.Text.Json.JsonSerializer.Serialize( + Enum.GetNames().Select(source => new { value = source, label = _localizer[source].Value }), + new System.Text.Json.JsonSerializerOptions { PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase }); +} + +@inject IViewLocalizer _localizer +@inject IUrlService _urlService + +@model MusicArtistDto + +@Html.AntiForgeryToken() + +
+ +
+
+
+
+ +
+
+

@_localizer["EditArtist"]

+
+
+ +
+ @_localizer[ +
+ + +
+
+ @(Model.CoverPath ?? _localizer["NoCover"].Value) +
+
+ +
+ +

@_localizer["Releases"]

+ +
+
+ +
+
+ + +

@_localizer["GeneralInformation"]

+ +
+
*:
+
+ @_localizer["NameDescription"] +
+ +
+
:
+
+ @_localizer["SortNameDescription"] +
+ +
+
:
+
+ @_localizer["DisambiguationDescription"] +
+ +
+
:
+
+
+
+ + +
+
-
+ @foreach (string type in Enum.GetNames()) + { +
@_localizer[type].Value
+ } +
+
+
+ @_localizer["TypeDescription"] +
+ +
+
:
+
+
+
+ + +
+
-
+ @foreach (string gender in Enum.GetNames()) + { +
@_localizer[gender].Value
+ } +
+
+
+ @_localizer["GenderDescription"] +
+ +
+
:
+
+ @_localizer["CountryDescription"] +
+ +
+
:
+
+ @_localizer["WebsiteDescription"] +
+ +
+
:
+
+ @_localizer["MusicBrainzArtistIdDescription"] +
+ +
+
:
+
+ @_localizer["LifeSpanBeginDescription"] +
+ +
+
:
+
+ @_localizer["LifeSpanEndDescription"] +
+ +
+
:
+
+ +
+ @_localizer["IsEndedDescription"] +
+ + +

@_localizer["Contributors"]

+ +
+ + + + + + + + + + @{ int contributorIndex = 0; } + @foreach (var contributor in contributors) + { + + + + + + contributorIndex++; + } + +
@_localizer["ContributorId"]@_localizer["ContributorRole"]
+
+
+ + +
+
-
+ @foreach (string role in Enum.GetNames()) + { +
@_localizer[role].Value
+ } +
+
+
@_localizer[
+ + @_localizer["ContributorsDescription"] +
+ + +

@_localizer["Ratings"]

+ +
+ + + + + + + + + + + + @{ int ratingIndex = 0; } + @foreach (var rating in ratings) + { + + + + + + + + ratingIndex++; + } + +
@_localizer["RatingValue"]@_localizer["RatingMaxValue"]@_localizer["RatingSource"]@_localizer["RatingVoteCount"]
+
+
+ + +
+
-
+ @foreach (string source in Enum.GetNames()) + { +
@_localizer[source].Value
+ } +
+
+
@_localizer[
+ + @_localizer["RatingsDescription"] +
+ + +

@_localizer["Genres"]

+ +
+ + + + + + + + + @foreach (var genre in genres) + { + + + + + } + +
@_localizer["Genre"]
@_localizer[
+ + @_localizer["GenresDescription"] +
+ + +

@_localizer["Tags"]

+ +
+ + + + + + + + + @foreach (var tag in tags) + { + + + + + } + +
@_localizer["Tag"]
@_localizer[
+ + @_localizer["TagsDescription"] +
+ + +

@_localizer["Aliases"]

+ +
+ + + + + + + + + + + + + + + + @foreach (var alias in aliases) + { + + + + + + + + + + + + } + +
@_localizer["AliasName"]@_localizer["AliasSortName"]@_localizer["AliasType"]@_localizer["AliasLocale"]@_localizer["AliasIsPrimary"]@_localizer["AliasBeginDate"]@_localizer["AliasEndDate"]@_localizer["AliasIsEnded"]
@_localizer[
+ + @_localizer["AliasesDescription"] +
+ + +

@_localizer["Areas"]

+ +

@_localizer["Area"]

+ +
+
:
+
+ @_localizer["AreaNameDescription"] +
+ +
+
:
+
+ @_localizer["AreaSortNameDescription"] +
+ +
+
:
+
+ @_localizer["AreaDisambiguationDescription"] +
+ +
+
:
+
+ @_localizer["AreaTypeDescription"] +
+ +
+
:
+
+ @_localizer["Iso3166CodeDescription"] +
+ +
+
:
+
+ @_localizer["MusicBrainzAreaIdDescription"] +
+ + +

@_localizer["BeginArea"]

+ +
+
:
+
+ @_localizer["AreaNameDescription"] +
+ +
+
:
+
+ @_localizer["AreaSortNameDescription"] +
+ +
+
:
+
+ @_localizer["AreaDisambiguationDescription"] +
+ +
+
:
+
+ @_localizer["AreaTypeDescription"] +
+ +
+
:
+
+ @_localizer["Iso3166CodeDescription"] +
+ +
+
:
+
+ @_localizer["MusicBrainzAreaIdDescription"] +
+ + +

@_localizer["EndArea"]

+ +
+
:
+
+ @_localizer["AreaNameDescription"] +
+ +
+
:
+
+ @_localizer["AreaSortNameDescription"] +
+ +
+
:
+
+ @_localizer["AreaDisambiguationDescription"] +
+ +
+
:
+
+ @_localizer["AreaTypeDescription"] +
+ +
+
:
+
+ @_localizer["Iso3166CodeDescription"] +
+ +
+
:
+
+ @_localizer["MusicBrainzAreaIdDescription"] +
+ + +

@_localizer["Ipis"]

+ +
+ + + + + + + + + @foreach (string ipi in Model.Ipis ?? []) + { + + + + + } + +
@_localizer["Ipi"]
@_localizer[
+ + @_localizer["IpisDescription"] +
+ + +

@_localizer["Isnis"]

+ +
+ + + + + + + + + @foreach (string isni in Model.Isnis ?? []) + { + + + + + } + +
@_localizer["Isni"]
@_localizer[
+ + @_localizer["IsnisDescription"] +
+ +
+ + +
+
+
+
+
+ +@section Scripts { + + +} diff --git a/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.cshtml b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.cshtml new file mode 100644 index 00000000..133310d4 --- /dev/null +++ b/src/Lumina.Presentation.Web/Core/Views/Library/AudioLibrary/MusicLibrary/Tracks/Item.cshtml @@ -0,0 +1,1059 @@ +@* + FALLBACK MUSIC TRACK DETAILS / EDITING VIEW - READ BEFORE EDITING + + This view is the application fallback of the music track details and editing page, rendered only when the + active theme does not provide its own template for the page. On a healthy site the page is presented by + the theme files, which hook into the class names and element ids that this view uses as a contract, and + which template the same fields rather than change which fields are offered. + + The view exposes every field a track stores, so that editing a track never drops any of its stored data. + The audio properties, the release information, the language and original language, the work, the + contributors, the ratings, the moods and the ISRCs are all editable, and they are all round-tripped on save. + + To change the behavior of the page, edit this script (and the theme template, when present). To restyle + the page, edit the theme files. This fallback keeps every feature working without styling, so that a + broken theme is obvious to the user while the page still functions. + + /library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}?libraryId=... +*@ + +@using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary +@using Lumina.Presentation.Web.Common.DTO.Common +@using Lumina.Presentation.Web.Common.Enums.AudioLibrary +@using Lumina.Presentation.Web.Common.Enums.Common +@using Lumina.Presentation.Web.Common.Enums.MediaContributors +@using Lumina.Presentation.Web.Common.Services +@using Microsoft.AspNetCore.Mvc.Localization +@using System +@using System.Globalization +@using System.Linq + +@{ + // 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 trackId = Model.Id.ToString(); + var libraryId = Model.LibraryId.ToString(); + // The cover shown on the left is the cover of the album the track belongs to, passed in by the endpoint. + var albumCoverPath = ViewData["AlbumCoverPath"]?.ToString() ?? string.Empty; + // The track DTO does not carry the Id of its artist, so it is taken from the route that rendered the view. + var artistId = Context.Request.RouteValues["artistId"]?.ToString() ?? string.Empty; + var metadata = Model.Metadata; + var work = Model.Work; + var releaseInfo = metadata?.ReleaseInfo; + var language = metadata?.Language; + var originalLanguage = metadata?.OriginalLanguage; + var workLanguages = work?.Languages ?? []; + var genres = metadata?.Genres ?? []; + var tags = metadata?.Tags ?? []; + var moods = Model.Moods ?? []; + var isrcs = Model.Isrcs ?? []; + var contributors = Model.Contributors ?? []; + var ratings = Model.Ratings ?? []; + // Resolves the localized label of a release country, shown as "DE (Germany)", keyed by its ISO code. + Func releaseCountryLabel = countryCode => + { + if (string.IsNullOrEmpty(countryCode)) + return "-"; + string localizedName = _localizer[$"Country.{countryCode}"].Value; + if (localizedName == $"Country.{countryCode}") + return countryCode; + return $"{countryCode} ({localizedName})"; + }; + var currentReleaseCountry = releaseInfo?.ReleaseCountry?.ToString() ?? string.Empty; + // The localized options of the contributor roles and rating sources, serialized for the dynamic rows of the client script. + var contributorRoleOptionsJson = System.Text.Json.JsonSerializer.Serialize( + Enum.GetNames().Select(role => new { value = role, label = _localizer[role].Value }), + new System.Text.Json.JsonSerializerOptions { PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase }); + var ratingSourceOptionsJson = System.Text.Json.JsonSerializer.Serialize( + Enum.GetNames().Select(source => new { value = source, label = _localizer[source].Value }), + new System.Text.Json.JsonSerializerOptions { PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase }); +} + +@inject IViewLocalizer _localizer +@inject IUrlService _urlService + +@model MusicTrackDto + +@Html.AntiForgeryToken() + +
+
+
+
+
+ +
+
+

@_localizer["EditTrack"]

+
+
+ +
+ @(metadata?.Title ?? string.Empty) +
+ +
+ +

@_localizer["GeneralInformation"]

+ +
+
:
+
+ @_localizer["TrackPathDescription"] +
+ +
+
:
+
+ @_localizer["TrackTitleDescription"] +
+ +
+
:
+
+ @_localizer["TrackOriginalTitleDescription"] +
+ +
+
:
+
+ @_localizer["TrackDescriptionDescription"] +
+ +
+
:
+
+ @_localizer["TrackDisambiguationDescription"] +
+ +
+
:
+
+ @_localizer["TrackNumberDescription"] +
+ +
+
:
+
+ @_localizer["DiscNumberDescription"] +
+ +
+
:
+
+ @_localizer["ScriptDescription"] +
+ +
+
:
+
+
+
+ + +
+
-
+ @foreach (string key in Enum.GetNames()) + { +
@_localizer[key].Value
+ } +
+
+
+ @_localizer["KeyDescription"] +
+ +
+
:
+
+ @_localizer["BpmDescription"] +
+ +
+
:
+
+ +
+ @_localizer["TrackIsVideoDescription"] +
+ +
+
:
+
+ @_localizer["DurationDescription"] +
+ +

@_localizer["Contributors"]

+
+ + + + + + + + + + @{ int contributorIndex = 0; } + @foreach (var contributor in contributors) + { + + + + + + contributorIndex++; + } + +
@_localizer["ContributorId"]@_localizer["ContributorRole"]
+
+
+ + +
+
-
+ @foreach (string role in Enum.GetNames()) + { +
@_localizer[role].Value
+ } +
+
+
@_localizer[
+ + @_localizer["ContributorsDescription"] +
+ + +

@_localizer["Ratings"]

+
+ + + + + + + + + + + + @{ int ratingIndex = 0; } + @foreach (var rating in ratings) + { + + + + + + + + ratingIndex++; + } + +
@_localizer["RatingValue"]@_localizer["RatingMaxValue"]@_localizer["RatingSource"]@_localizer["RatingVoteCount"]
+
+
+ + +
+
-
+ @foreach (string source in Enum.GetNames()) + { +
@_localizer[source].Value
+ } +
+
+
@_localizer[
+ + @_localizer["RatingsDescription"] +
+ + +

@_localizer["Genres"]

+
+ + + + + + + + + @foreach (var genre in genres) + { + + + + + } + +
@_localizer["Genre"]
@_localizer[
+ + @_localizer["GenresDescription"] +
+ +

@_localizer["Tags"]

+
+ + + + + + + + + @foreach (var tag in tags) + { + + + + + } + +
@_localizer["Tag"]
@_localizer[
+ + @_localizer["TagsDescription"] +
+ + +

@_localizer["Moods"]

+
+ + + + + + + + + @foreach (var mood in moods) + { + + + + + } + +
@_localizer["Mood"]
@_localizer[
+ + @_localizer["MoodsDescription"] +
+ +

@_localizer["TrackReleaseInformation"]

+ +
+
:
+
+ @_localizer["TrackOriginalReleaseDateDescription"] +
+ +
+
:
+
+ @_localizer["TrackOriginalReleaseYearDescription"] +
+ +
+
:
+
+ @_localizer["TrackReReleaseDateDescription"] +
+ +
+
:
+
+ @_localizer["TrackReReleaseYearDescription"] +
+ +
+
:
+
+
+
+ + +
+
-
+ @foreach (string country in Enum.GetNames()) + { +
@releaseCountryLabel(country)
+ } +
+
+
+ @_localizer["TrackReleaseCountryDescription"] +
+ +
+
:
+
+ @_localizer["TrackReleaseVersionDescription"] +
+ + +

@_localizer["TrackLanguage"]

+ +
+
:
+
+ @_localizer["LanguageCodeDescription"] +
+ +
+
:
+
+ @_localizer["LanguageNameDescription"] +
+ +
+
:
+
+ @_localizer["NativeNameDescription"] +
+ +

@_localizer["TrackOriginalLanguage"]

+ +
+
:
+
+ @_localizer["LanguageCodeDescription"] +
+ +
+
:
+
+ @_localizer["LanguageNameDescription"] +
+ +
+
:
+
+ @_localizer["NativeNameDescription"] +
+ + +

@_localizer["Work"]

+ +
+
:
+
+ @_localizer["WorkTitleDescription"] +
+ +
+
:
+
+ @_localizer["WorkMusicBrainzIdDescription"] +
+ +
+
:
+
+ @_localizer["TrackWorkTypeDescription"] +
+ +

@_localizer["TrackWorkIswcs"]

+
+ + + + + + + + + @foreach (string workIswc in work?.Iswcs ?? []) + { + + + + + } + +
@_localizer["WorkIswc"]
@_localizer[
+ + @_localizer["TrackWorkIswcsDescription"] +
+ +

@_localizer["TrackWorkLanguages"]

+
+ + + + + + + + + + + @foreach (var workLanguage in workLanguages) + { + + + + + + + } + +
@_localizer["WorkLanguageCode"]@_localizer["WorkLanguageName"]@_localizer["WorkLanguageNativeName"]
@_localizer[
+ + @_localizer["TrackWorkLanguagesDescription"] +
+ + +

@_localizer["Isrcs"]

+
+ + + + + + + + + @foreach (var isrc in isrcs) + { + + + + + } + +
@_localizer["Isrc"]
@_localizer[
+ + @_localizer["IsrcsDescription"] +
+ + +

@_localizer["Identifiers"]

+ +
+
:
+
+ @_localizer["MusicBrainzRecordingIdDescription"] +
+ +
+
:
+
+ @_localizer["MusicBrainzTrackIdDescription"] +
+ + +

@_localizer["TrackAudioProperties"]

+ +
+
:
+
+ @_localizer["TrackSampleRateDescription"] +
+ +
+
:
+
+ @_localizer["TrackChannelsDescription"] +
+ +
+
:
+
+ @_localizer["TrackBitDepthDescription"] +
+ +
+
:
+
+ @_localizer["TrackAudioCodecDescription"] +
+ +
+
:
+
+ @_localizer["TrackBitrateDescription"] +
+ +
+
:
+
+ @_localizer["TrackAcoustIdDescription"] +
+ +

@_localizer["TrackReplayGain"]

+ +
+
:
+
+ @_localizer["TrackReplayGainTrackGainDescription"] +
+ +
+
:
+
+ @_localizer["TrackReplayGainTrackPeakDescription"] +
+ +
+
:
+
+ @_localizer["TrackReplayGainAlbumGainDescription"] +
+ +
+
:
+
+ @_localizer["TrackReplayGainAlbumPeakDescription"] +
+ +
+ + +
+
+
+
+
+ +@section Scripts { + + +} diff --git a/src/Lumina.Presentation.Web/wwwroot/css/site.css b/src/Lumina.Presentation.Web/wwwroot/css/site.css index 57c84741..a0b95d58 100644 --- a/src/Lumina.Presentation.Web/wwwroot/css/site.css +++ b/src/Lumina.Presentation.Web/wwwroot/css/site.css @@ -1188,3 +1188,65 @@ body { .reader-content p { margin: 0 0 1em; } + +/* Music album track list. */ +.tracks-table { + table-layout: fixed; +} + + .tracks-table .track-number-column { + width: 44px; + } + + .tracks-table .track-duration-column { + width: 64px; + } + +.track-name-link { + text-decoration: none; + color: #E6E6E6; +} + +.track-name-link:visited { + color: #9AA7B0; +} + +.track-name-link:hover { + color: #FFFFFF; +} + +/* Music album artwork carousel. */ +.artwork-carousel { + display: flex; + flex-direction: row; + gap: 6px; + width: 100%; + max-width: 300px; + overflow-x: auto; + padding-bottom: 4px; +} + +.artwork-carousel-item { + flex: 0 0 auto; + width: 56px; + height: 56px; + padding: 0; + border: 1px solid #555555; + background-color: #00000033; + cursor: pointer; +} + +.artwork-carousel-item img { + width: 100%; + height: 100%; + object-fit: cover; + display: block; +} + +.artwork-carousel-item.selected { + border-color: #6DCBFE; +} + +.artwork-carousel-item:hover { + border-color: #FFFFFF; +} diff --git a/src/Lumina.Presentation.Web/wwwroot/images/ui/music-placeholder.svg b/src/Lumina.Presentation.Web/wwwroot/images/ui/music-placeholder.svg new file mode 100644 index 00000000..648bf363 --- /dev/null +++ b/src/Lumina.Presentation.Web/wwwroot/images/ui/music-placeholder.svg @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/AudioRatingDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/AudioRatingDtoFixture.cs new file mode 100644 index 00000000..5c067d7b --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/AudioRatingDtoFixture.cs @@ -0,0 +1,60 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary; + +/// +/// Fixture class for the class. +/// +[ExcludeFromCodeCoverage] +public class AudioRatingDtoFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The numeric value of the rating. + /// Optional. The maximum possible rating value. + /// Optional. The number of votes the rating is based on. + /// Optional. The source of the audio rating. + /// Whether the value should be included, or forced to . + /// Whether the maximum value should be included, or forced to . + /// Whether the vote count should be included, or forced to . + /// Whether the source should be included, or forced to . + /// A configured instance. + public AudioRatingDto Create( + decimal? value = null, + decimal? maxValue = null, + int? voteCount = null, + AudioRatingSource? source = null, + bool includeValue = true, + bool includeMaxValue = true, + bool includeVoteCount = true, + bool includeSource = true) + { + return new AudioRatingDto + { + Value = includeValue ? (value ?? _faker.Random.Decimal(1, 5)) : null, + MaxValue = includeMaxValue ? (maxValue ?? 5) : null, + VoteCount = includeVoteCount ? (voteCount ?? _faker.Random.Number(1, 1000)) : null, + Source = includeSource ? (source ?? _faker.PickRandom()) : null + }; + } + + /// + /// 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/IsrcDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/IsrcDtoFixture.cs new file mode 100644 index 00000000..c1a88b18 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/IsrcDtoFixture.cs @@ -0,0 +1,44 @@ +#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 IsrcDtoFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The value of the ISRC. + /// Whether the value should be included, or forced to . + /// A configured instance. + public IsrcDto Create( + string? value = null, + bool includeValue = true) + { + return new IsrcDto + { + Value = includeValue ? (value ?? $"US{_faker.Random.String2(3, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")}{_faker.Random.Number(10000, 99999)}") : null + }; + } + + /// + /// 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/MusicAlbumDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumDtoFixture.cs new file mode 100644 index 00000000..16e437c2 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumDtoFixture.cs @@ -0,0 +1,144 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; +using Lumina.Presentation.Web.Fixtures.Common.DTO.MediaContributors; +using System; +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 MusicAlbumDtoFixture +{ + private readonly Faker _faker = new(); + private readonly MusicAlbumMetadataDtoFixture _musicAlbumMetadataDtoFixture = new(); + private readonly MediaArtworkDtoFixture _mediaArtworkDtoFixture = new(); + private readonly MusicTrackDtoFixture _musicTrackDtoFixture = new(); + private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new(); + private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The Id of the album. + /// Optional. The Id of the artist the album belongs to. + /// Optional. The Id of the media library this album belongs to. + /// Optional. The path of the image representing the album. + /// Optional. The stored artwork of the album. + /// Optional. The album metadata of the album. + /// Optional. The physical or digital medium of the album. + /// Optional. The outermost physical packaging of the album. + /// Optional. The barcode of the album. + /// Optional. The catalog numbers of the album. + /// Optional. The name of the label that issued the album. + /// Optional. The ASIN of the album. + /// Optional. The MusicBrainz identifier of the release. + /// Optional. The MusicBrainz identifier of the release group. + /// Optional. The MusicBrainz identifier of the release artist. + /// Optional. The date and time when the album was created. + /// Optional. The date and time when the album was updated. + /// Optional. The references to the media contributors that performed on the album. + /// Optional. The ratings of the album. + /// Optional. The tracks of the album. + /// Whether the cover path should be included, or forced to . + /// Whether the artwork should be included, or forced to . + /// Whether the metadata should be included, or forced to . + /// Whether the media format should be included, or forced to . + /// Whether the packaging should be included, or forced to . + /// Whether the barcode should be included, or forced to . + /// Whether the catalog numbers should be included, or forced to . + /// Whether the label should be included, or forced to . + /// Whether the ASIN should be included, or forced to . + /// Whether the MusicBrainz release Id should be included, or forced to . + /// Whether the MusicBrainz release group Id should be included, or forced to . + /// Whether the MusicBrainz release artist Id should be included, or forced to . + /// Whether the update date should be included, or forced to . + /// Whether the contributors should be included, or forced to . + /// Whether the ratings should be included, or forced to . + /// Whether the tracks should be included, or forced to . + /// A configured instance. + public MusicAlbumDto Create( + Guid? id = null, + Guid? artistId = null, + Guid? libraryId = null, + string? coverPath = null, + List? artwork = null, + MusicAlbumMetadataDto? metadata = null, + MusicMediaFormat? mediaFormat = null, + MusicReleasePackaging? packaging = null, + string? barcode = null, + List? catalogNumbers = null, + string? label = null, + string? asin = null, + Guid? musicBrainzReleaseId = null, + Guid? musicBrainzReleaseGroupId = null, + Guid? musicBrainzReleaseArtistId = null, + DateTime? createdOnUtc = null, + DateTime? updatedOnUtc = null, + List? contributors = null, + List? ratings = null, + List? tracks = null, + bool includeCoverPath = true, + bool includeArtwork = true, + bool includeMetadata = true, + bool includeMediaFormat = true, + bool includePackaging = true, + bool includeBarcode = true, + bool includeCatalogNumbers = true, + bool includeLabel = true, + bool includeAsin = true, + bool includeMusicBrainzReleaseId = true, + bool includeMusicBrainzReleaseGroupId = true, + bool includeMusicBrainzReleaseArtistId = true, + bool includeUpdatedOnUtc = true, + bool includeContributors = true, + bool includeRatings = true, + bool includeTracks = true) + { + return new MusicAlbumDto + { + Id = id ?? _faker.Random.Guid(), + ArtistId = artistId ?? _faker.Random.Guid(), + LibraryId = libraryId ?? _faker.Random.Guid(), + CoverPath = includeCoverPath ? (coverPath ?? _faker.System.FilePath()) : null, + Artwork = includeArtwork ? (artwork ?? [.. _mediaArtworkDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Metadata = includeMetadata ? (metadata ?? _musicAlbumMetadataDtoFixture.Create()) : null, + MediaFormat = includeMediaFormat ? (mediaFormat ?? _faker.PickRandom()) : null, + Packaging = includePackaging ? (packaging ?? _faker.PickRandom()) : null, + Barcode = includeBarcode ? (barcode ?? _faker.Random.String2(13, "0123456789")) : null, + CatalogNumbers = includeCatalogNumbers ? (catalogNumbers ?? [.. Enumerable.Range(0, _faker.Random.Number(1, 3)).Select(_ => _faker.Random.String2(10))]) : null, + Label = includeLabel ? (label ?? _faker.Company.CompanyName()) : null, + ASIN = includeAsin ? (asin ?? _faker.Random.String2(10)) : null, + MusicBrainzReleaseId = includeMusicBrainzReleaseId ? (musicBrainzReleaseId ?? _faker.Random.Guid()) : null, + MusicBrainzReleaseGroupId = includeMusicBrainzReleaseGroupId ? (musicBrainzReleaseGroupId ?? _faker.Random.Guid()) : null, + MusicBrainzReleaseArtistId = includeMusicBrainzReleaseArtistId ? (musicBrainzReleaseArtistId ?? _faker.Random.Guid()) : null, + CreatedOnUtc = createdOnUtc ?? _faker.Date.Past(), + UpdatedOnUtc = includeUpdatedOnUtc ? (updatedOnUtc ?? _faker.Date.Recent()) : null, + Contributors = includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Ratings = includeRatings ? (ratings ?? [.. _audioRatingDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Tracks = includeTracks ? (tracks ?? [.. _musicTrackDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null + }; + } + + /// + /// 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/MusicAlbumLiteDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumLiteDtoFixture.cs new file mode 100644 index 00000000..ae034435 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumLiteDtoFixture.cs @@ -0,0 +1,65 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using System; +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 MusicAlbumLiteDtoFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The Id of the album. + /// Optional. The title of the album. + /// Optional. The number of tracks of the release. + /// Optional. The path of the image representing the album. + /// Optional. The release year of the album. + /// Optional. The set of types of the release. + /// Whether the cover path should be included, or forced to . + /// Whether the release year should be included, or forced to . + /// Whether the release types should be included, or forced to . + /// A configured instance. + public MusicAlbumLiteDto Create( + Guid? id = null, + string? title = null, + int? totalTracks = null, + string? coverPath = null, + int? releaseYear = null, + List? releaseTypes = null, + bool includeCoverPath = true, + bool includeReleaseYear = true, + bool includeReleaseTypes = true) + { + return new MusicAlbumLiteDto + { + Id = id ?? _faker.Random.Guid(), + Title = title ?? _faker.Lorem.Sentence(3), + TotalTracks = totalTracks ?? _faker.Random.Number(1, 30), + CoverPath = includeCoverPath ? (coverPath ?? _faker.System.FilePath()) : null, + ReleaseYear = includeReleaseYear ? (releaseYear ?? Random.Shared.Next(1900, 2026)) : null, + ReleaseTypes = includeReleaseTypes ? (releaseTypes ?? [.. Enumerable.Range(0, _faker.Random.Number(1, 3)).Select(_ => _faker.PickRandom())]) : null + }; + } + + /// + /// 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/MusicAlbumMetadataDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumMetadataDtoFixture.cs new file mode 100644 index 00000000..eed39f4e --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicAlbumMetadataDtoFixture.cs @@ -0,0 +1,121 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; +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 MusicAlbumMetadataDtoFixture +{ + private readonly Faker _faker = new(); + private readonly ReleaseInfoDtoFixture _releaseInfoDtoFixture = new(); + private readonly LanguageInfoDtoFixture _languageInfoDtoFixture = new(); + private readonly TagDtoFixture _tagDtoFixture = new(); + private readonly GenreDtoFixture _genreDtoFixture = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The title of the album. + /// Optional. The original title of the album. + /// Optional. A brief description of the album. + /// Optional. The disambiguation comment of the album. + /// Optional. The release information of the album. + /// Optional. The language of the album. + /// Optional. The original language of the album. + /// Optional. The tags that describe or categorize the album. + /// Optional. The genres associated with the album. + /// Optional. The script used by the language of the release of the album. + /// Optional. The set of types of the release. + /// Optional. The status of the release. + /// Optional. The number of discs of the release. + /// Optional. The number of tracks of the release. + /// Optional. The title of the specific release the album files match. + /// Whether the title should be included, or forced to . + /// Whether the original title should be included, or forced to . + /// Whether the description should be included, or forced to . + /// Whether the disambiguation should be included, or forced to . + /// Whether the release information should be included, or forced to . + /// Whether the language should be included, or forced to . + /// Whether the original language should be included, or forced to . + /// Whether the tags should be included, or forced to . + /// Whether the genres should be included, or forced to . + /// Whether the script should be included, or forced to . + /// Whether the release types should be included, or forced to . + /// Whether the release status should be included, or forced to . + /// Whether the total number of discs should be included, or forced to . + /// Whether the total number of tracks should be included, or forced to . + /// Whether the release title should be included, or forced to . + /// A configured instance. + public MusicAlbumMetadataDto Create( + string? title = null, + string? originalTitle = null, + string? description = null, + string? disambiguation = null, + ReleaseInfoDto? releaseInfo = null, + LanguageInfoDto? language = null, + LanguageInfoDto? originalLanguage = null, + List? tags = null, + List? genres = null, + string? script = null, + List? releaseTypes = null, + MusicReleaseStatus? releaseStatus = null, + int? totalDiscs = null, + int? totalTracks = null, + string? releaseTitle = null, + bool includeTitle = true, + bool includeOriginalTitle = true, + bool includeDescription = true, + bool includeDisambiguation = true, + bool includeReleaseInfo = true, + bool includeLanguage = true, + bool includeOriginalLanguage = true, + bool includeTags = true, + bool includeGenres = true, + bool includeScript = true, + bool includeReleaseTypes = true, + bool includeReleaseStatus = true, + bool includeTotalDiscs = true, + bool includeTotalTracks = true, + bool includeReleaseTitle = true) + { + return new MusicAlbumMetadataDto + { + Title = includeTitle ? (title ?? _faker.Lorem.Sentence(3)) : null, + OriginalTitle = includeOriginalTitle ? (originalTitle ?? _faker.Lorem.Sentence(3)) : null, + Description = includeDescription ? (description ?? _faker.Lorem.Paragraph()) : null, + Disambiguation = includeDisambiguation ? (disambiguation ?? _faker.Lorem.Word()) : null, + ReleaseInfo = includeReleaseInfo ? (releaseInfo ?? _releaseInfoDtoFixture.Create()) : null, + Language = includeLanguage ? (language ?? _languageInfoDtoFixture.Create()) : null, + OriginalLanguage = includeOriginalLanguage ? (originalLanguage ?? _languageInfoDtoFixture.Create()) : null, + Tags = includeTags ? (tags ?? [.. _tagDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Genres = includeGenres ? (genres ?? [.. _genreDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Script = includeScript ? (script ?? _faker.Lorem.Word()) : null, + ReleaseTypes = includeReleaseTypes ? (releaseTypes ?? [.. Enumerable.Range(0, _faker.Random.Number(1, 3)).Select(_ => _faker.PickRandom())]) : null, + ReleaseStatus = includeReleaseStatus ? (releaseStatus ?? _faker.PickRandom()) : null, + TotalDiscs = includeTotalDiscs ? (totalDiscs ?? _faker.Random.Number(1, 4)) : null, + TotalTracks = includeTotalTracks ? (totalTracks ?? _faker.Random.Number(1, 30)) : null, + ReleaseTitle = includeReleaseTitle ? (releaseTitle ?? _faker.Lorem.Sentence(3)) : null + }; + } + + /// + /// 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/MusicAreaDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicAreaDtoFixture.cs new file mode 100644 index 00000000..bfef5e0c --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicAreaDtoFixture.cs @@ -0,0 +1,70 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using System; +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 MusicAreaDtoFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The MusicBrainz identifier of the area. + /// Optional. The name of the area. + /// Optional. The sort name of the area. + /// Optional. The disambiguation comment of the area. + /// Optional. The MusicBrainz type of the area. + /// Optional. The ISO 3166 code of the area. + /// Whether the MusicBrainz area Id should be included, or forced to . + /// Whether the name should be included, or forced to . + /// Whether the sort name should be included, or forced to . + /// Whether the disambiguation should be included, or forced to . + /// Whether the type should be included, or forced to . + /// Whether the ISO 3166 code should be included, or forced to . + /// A configured instance. + public MusicAreaDto Create( + Guid? musicBrainzAreaId = null, + string? name = null, + string? sortName = null, + string? disambiguation = null, + string? type = null, + string? iso3166Code = null, + bool includeMusicBrainzAreaId = true, + bool includeName = true, + bool includeSortName = true, + bool includeDisambiguation = true, + bool includeType = true, + bool includeIso3166Code = true) + { + return new MusicAreaDto + { + MusicBrainzAreaId = includeMusicBrainzAreaId ? (musicBrainzAreaId ?? _faker.Random.Guid()) : null, + Name = includeName ? (name ?? _faker.Address.Country()) : null, + SortName = includeSortName ? (sortName ?? _faker.Address.Country()) : null, + Disambiguation = includeDisambiguation ? (disambiguation ?? _faker.Lorem.Word()) : null, + Type = includeType ? (type ?? _faker.Lorem.Word()) : null, + Iso3166Code = includeIso3166Code ? (iso3166Code ?? _faker.Address.CountryCode()) : null + }; + } + + /// + /// 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/MusicArtistAliasDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistAliasDtoFixture.cs new file mode 100644 index 00000000..5242f765 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistAliasDtoFixture.cs @@ -0,0 +1,79 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using System; +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 MusicArtistAliasDtoFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The name of the alias. + /// Optional. The sort name of the alias. + /// Optional. The type of the alias. + /// Optional. The locale the alias is used in. + /// Optional. Whether this is the primary alias of the artist. + /// Optional. The date the alias began being used. + /// Optional. The date the alias stopped being used. + /// Optional. Whether the alias is no longer used. + /// Whether the name should be included, or forced to . + /// Whether the sort name should be included, or forced to . + /// Whether the type should be included, or forced to . + /// Whether the locale should be included, or forced to . + /// Whether the begin date should be included, or forced to . + /// Whether the end date should be included, or forced to . + /// A configured instance. + public MusicArtistAliasDto Create( + string? name = null, + string? sortName = null, + string? type = null, + string? locale = null, + bool isPrimary = false, + DateOnly? beginDate = null, + DateOnly? endDate = null, + bool isEnded = false, + bool includeName = true, + bool includeSortName = true, + bool includeType = true, + bool includeLocale = true, + bool includeBeginDate = true, + bool includeEndDate = true) + { + DateOnly resolvedBeginDate = beginDate ?? DateOnly.FromDateTime(_faker.Date.Past()); + DateOnly resolvedEndDate = endDate ?? DateOnly.FromDateTime(_faker.Date.Future()); + + return new MusicArtistAliasDto + { + Name = includeName ? (name ?? _faker.Name.FullName()) : null, + SortName = includeSortName ? (sortName ?? _faker.Name.LastName()) : null, + Type = includeType ? (type ?? _faker.Lorem.Word()) : null, + Locale = includeLocale ? (locale ?? _faker.Random.String2(2, "abcdefghijklmnopqrstuvwxyz")) : null, + IsPrimary = isPrimary, + BeginDate = includeBeginDate ? resolvedBeginDate : null, + EndDate = includeEndDate ? resolvedEndDate : null, + IsEnded = isEnded + }; + } + + /// + /// 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/MusicArtistDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistDtoFixture.cs new file mode 100644 index 00000000..304e577c --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistDtoFixture.cs @@ -0,0 +1,107 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.MediaContributors; +using System; +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 MusicArtistDtoFixture +{ + private readonly Faker _faker = new(); + private readonly MusicArtistMetadataDtoFixture _musicArtistMetadataDtoFixture = new(); + private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new(); + private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new(); + private readonly MusicAlbumDtoFixture _musicAlbumDtoFixture = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The Id of the artist. + /// Optional. The Id of the media library this artist belongs to. + /// Optional. The path of the image representing the artist. + /// Optional. The metadata of the artist. + /// Optional. The website of the artist. + /// Optional. The MusicBrainz identifier of the artist. + /// Optional. The IPI codes of the artist. + /// Optional. The ISNI codes of the artist. + /// Optional. The date and time when the artist was created. + /// Optional. The date and time when the artist was updated. + /// Optional. The references to the media contributors that make up the artist. + /// Optional. The ratings of the artist. + /// Optional. The albums of the artist. + /// Whether the cover path should be included, or forced to . + /// Whether the metadata should be included, or forced to . + /// Whether the website should be included, or forced to . + /// Whether the MusicBrainz artist Id should be included, or forced to . + /// Whether the IPI codes should be included, or forced to . + /// Whether the ISNI codes should be included, or forced to . + /// Whether the update date should be included, or forced to . + /// Whether the contributors should be included, or forced to . + /// Whether the ratings should be included, or forced to . + /// Whether the albums should be included, or forced to . + /// A configured instance. + public MusicArtistDto Create( + Guid? id = null, + Guid? libraryId = null, + string? coverPath = null, + MusicArtistMetadataDto? metadata = null, + string? website = null, + Guid? musicBrainzArtistId = null, + List? ipis = null, + List? isnis = null, + DateTime? createdOnUtc = null, + DateTime? updatedOnUtc = null, + List? contributors = null, + List? ratings = null, + List? albums = null, + bool includeCoverPath = true, + bool includeMetadata = true, + bool includeWebsite = true, + bool includeMusicBrainzArtistId = true, + bool includeIpis = true, + bool includeIsnis = true, + bool includeUpdatedOnUtc = true, + bool includeContributors = true, + bool includeRatings = true, + bool includeAlbums = true) + { + return new MusicArtistDto + { + Id = id ?? _faker.Random.Guid(), + LibraryId = libraryId ?? _faker.Random.Guid(), + CoverPath = includeCoverPath ? (coverPath ?? _faker.System.FilePath()) : null, + Metadata = includeMetadata ? (metadata ?? _musicArtistMetadataDtoFixture.Create()) : null, + Website = includeWebsite ? (website ?? _faker.Internet.Url()) : null, + MusicBrainzArtistId = includeMusicBrainzArtistId ? (musicBrainzArtistId ?? _faker.Random.Guid()) : null, + Ipis = includeIpis ? (ipis ?? [.. Enumerable.Range(0, _faker.Random.Number(1, 3)).Select(_ => _faker.Random.String2(10, "0123456789"))]) : null, + Isnis = includeIsnis ? (isnis ?? [.. Enumerable.Range(0, _faker.Random.Number(1, 3)).Select(_ => _faker.Random.String2(16, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"))]) : null, + CreatedOnUtc = createdOnUtc ?? _faker.Date.Past(), + UpdatedOnUtc = includeUpdatedOnUtc ? (updatedOnUtc ?? _faker.Date.Recent()) : null, + Contributors = includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Ratings = includeRatings ? (ratings ?? [.. _audioRatingDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Albums = includeAlbums ? (albums ?? [.. _musicAlbumDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null + }; + } + + /// + /// 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/MusicArtistLiteDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistLiteDtoFixture.cs new file mode 100644 index 00000000..37efe704 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistLiteDtoFixture.cs @@ -0,0 +1,51 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using System; +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 MusicArtistLiteDtoFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The Id of the artist. + /// Optional. The name of the artist. + /// Optional. The path of the image representing the artist. + /// Whether the cover path should be included, or forced to . + /// A configured instance. + public MusicArtistLiteDto Create( + Guid? id = null, + string? name = null, + string? coverPath = null, + bool includeCoverPath = true) + { + return new MusicArtistLiteDto + { + Id = id ?? _faker.Random.Guid(), + Name = name ?? _faker.Name.FullName(), + CoverPath = includeCoverPath ? (coverPath ?? _faker.System.FilePath()) : null + }; + } + + /// + /// 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/MusicArtistMetadataDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistMetadataDtoFixture.cs new file mode 100644 index 00000000..69e9b404 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicArtistMetadataDtoFixture.cs @@ -0,0 +1,120 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; +using System; +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 MusicArtistMetadataDtoFixture +{ + private readonly Faker _faker = new(); + private readonly MusicAreaDtoFixture _musicAreaDtoFixture = new(); + private readonly MusicArtistAliasDtoFixture _musicArtistAliasDtoFixture = new(); + private readonly TagDtoFixture _tagDtoFixture = new(); + private readonly GenreDtoFixture _genreDtoFixture = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The name of the artist. + /// Optional. The sort name of the artist. + /// Optional. The disambiguation comment of the artist. + /// Optional. The type of the artist. + /// Optional. The gender of the artist. + /// Optional. The ISO 3166-1 alpha-2 code of the country the artist is associated with. + /// Optional. The area the artist is primarily identified with. + /// Optional. The area the artist began in. + /// Optional. The area the artist ended in. + /// Optional. The date the artist started existing. + /// Optional. The date the artist stopped existing. + /// Optional. Whether the artist no longer exists. + /// Optional. The genres associated with the artist. + /// Optional. The tags that describe or categorize the artist. + /// Optional. The alternative names of the artist. + /// Whether the name should be included, or forced to . + /// Whether the sort name should be included, or forced to . + /// Whether the disambiguation should be included, or forced to . + /// Whether the type should be included, or forced to . + /// Whether the gender should be included, or forced to . + /// Whether the country should be included, or forced to . + /// Whether the area should be included, or forced to . + /// Whether the begin area should be included, or forced to . + /// Whether the end area should be included, or forced to . + /// Whether the life span begin date should be included, or forced to . + /// Whether the life span end date should be included, or forced to . + /// Whether the genres should be included, or forced to . + /// Whether the tags should be included, or forced to . + /// Whether the aliases should be included, or forced to . + /// A configured instance. + public MusicArtistMetadataDto Create( + string? name = null, + string? sortName = null, + string? disambiguation = null, + MusicArtistType? type = null, + MusicArtistGender? gender = null, + string? country = null, + MusicAreaDto? area = null, + MusicAreaDto? beginArea = null, + MusicAreaDto? endArea = null, + DateOnly? lifeSpanBegin = null, + DateOnly? lifeSpanEnd = null, + bool isEnded = false, + List? genres = null, + List? tags = null, + List? aliases = null, + bool includeName = true, + bool includeSortName = true, + bool includeDisambiguation = true, + bool includeType = true, + bool includeGender = true, + bool includeCountry = true, + bool includeArea = true, + bool includeBeginArea = true, + bool includeEndArea = true, + bool includeLifeSpanBegin = true, + bool includeLifeSpanEnd = true, + bool includeGenres = true, + bool includeTags = true, + bool includeAliases = true) + { + return new MusicArtistMetadataDto + { + Name = includeName ? (name ?? _faker.Name.FullName()) : null, + SortName = includeSortName ? (sortName ?? _faker.Name.LastName()) : null, + Disambiguation = includeDisambiguation ? (disambiguation ?? _faker.Lorem.Word()) : null, + Type = includeType ? (type ?? _faker.PickRandom()) : null, + Gender = includeGender ? (gender ?? _faker.PickRandom()) : null, + Country = includeCountry ? (country ?? _faker.Address.CountryCode()) : null, + Area = includeArea ? (area ?? _musicAreaDtoFixture.Create()) : null, + BeginArea = includeBeginArea ? (beginArea ?? _musicAreaDtoFixture.Create()) : null, + EndArea = includeEndArea ? (endArea ?? _musicAreaDtoFixture.Create()) : null, + LifeSpanBegin = includeLifeSpanBegin ? (lifeSpanBegin ?? DateOnly.FromDateTime(_faker.Date.Past())) : null, + LifeSpanEnd = includeLifeSpanEnd ? (lifeSpanEnd ?? DateOnly.FromDateTime(_faker.Date.Past())) : null, + IsEnded = isEnded, + Genres = includeGenres ? (genres ?? [.. _genreDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Tags = includeTags ? (tags ?? [.. _tagDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Aliases = includeAliases ? (aliases ?? [.. _musicArtistAliasDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null + }; + } + + /// + /// 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/MusicTrackDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackDtoFixture.cs new file mode 100644 index 00000000..899652d8 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackDtoFixture.cs @@ -0,0 +1,136 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; +using Lumina.Presentation.Web.Fixtures.Common.DTO.MediaContributors; +using System; +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 MusicTrackDtoFixture +{ + private readonly Faker _faker = new(); + private readonly MusicTrackMetadataDtoFixture _musicTrackMetadataDtoFixture = new(); + private readonly MusicWorkDtoFixture _musicWorkDtoFixture = new(); + private readonly MoodDtoFixture _moodDtoFixture = new(); + private readonly IsrcDtoFixture _isrcDtoFixture = new(); + private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new(); + private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The Id of the track. + /// Optional. The Id of the album the track belongs to. + /// Optional. The Id of the media library this track belongs to. + /// Optional. The file system path of the track. + /// Optional. The audio metadata of the track. + /// Optional. The number of the track on its disc. + /// Optional. The number of the disc the track belongs to. + /// Optional. The script used by the language of the track. + /// Optional. The musical key of the track. + /// Optional. The tempo of the track in beats per minute. + /// Optional. The work the track is a recording of. + /// Optional. The MusicBrainz identifier of the recording. + /// Optional. The MusicBrainz identifier of the track. + /// Optional. The date and time when the track was created. + /// Optional. The date and time when the track was updated. + /// Optional. The moods of the track. + /// Optional. The ISRC codes of the track. + /// Optional. The references to the media contributors that performed on the track. + /// Optional. The ratings of the track. + /// Whether the metadata should be included, or forced to . + /// Whether the disc number should be included, or forced to . + /// Whether the script should be included, or forced to . + /// Whether the musical key should be included, or forced to . + /// Whether the tempo should be included, or forced to . + /// Whether the work should be included, or forced to . + /// Whether the MusicBrainz recording Id should be included, or forced to . + /// Whether the MusicBrainz track Id should be included, or forced to . + /// Whether the update date should be included, or forced to . + /// Whether the moods should be included, or forced to . + /// Whether the ISRC codes should be included, or forced to . + /// Whether the contributors should be included, or forced to . + /// Whether the ratings should be included, or forced to . + /// A configured instance. + public MusicTrackDto Create( + Guid? id = null, + Guid? albumId = null, + Guid? libraryId = null, + string? path = null, + MusicTrackMetadataDto? metadata = null, + int? trackNumber = null, + int? discNumber = null, + string? script = null, + MusicKey? key = null, + int? bpm = null, + MusicWorkDto? work = null, + Guid? musicBrainzRecordingId = null, + Guid? musicBrainzTrackId = null, + DateTime? createdOnUtc = null, + DateTime? updatedOnUtc = null, + List? moods = null, + List? isrcs = null, + List? contributors = null, + List? ratings = null, + bool includeMetadata = true, + bool includeDiscNumber = true, + bool includeScript = true, + bool includeKey = true, + bool includeBpm = true, + bool includeWork = true, + bool includeMusicBrainzRecordingId = true, + bool includeMusicBrainzTrackId = true, + bool includeUpdatedOnUtc = true, + bool includeMoods = true, + bool includeIsrcs = true, + bool includeContributors = true, + bool includeRatings = true) + { + return new MusicTrackDto + { + Id = id ?? _faker.Random.Guid(), + AlbumId = albumId ?? _faker.Random.Guid(), + LibraryId = libraryId ?? _faker.Random.Guid(), + Path = path ?? _faker.System.FilePath(), + Metadata = includeMetadata ? (metadata ?? _musicTrackMetadataDtoFixture.Create()) : null, + TrackNumber = trackNumber ?? _faker.Random.Number(1, 30), + DiscNumber = includeDiscNumber ? (discNumber ?? _faker.Random.Number(1, 3)) : null, + Script = includeScript ? (script ?? _faker.Lorem.Word()) : null, + Key = includeKey ? (key ?? _faker.PickRandom()) : null, + Bpm = includeBpm ? (bpm ?? _faker.Random.Number(60, 200)) : null, + Work = includeWork ? (work ?? _musicWorkDtoFixture.Create()) : null, + MusicBrainzRecordingId = includeMusicBrainzRecordingId ? (musicBrainzRecordingId ?? _faker.Random.Guid()) : null, + MusicBrainzTrackId = includeMusicBrainzTrackId ? (musicBrainzTrackId ?? _faker.Random.Guid()) : null, + CreatedOnUtc = createdOnUtc ?? _faker.Date.Past(), + UpdatedOnUtc = includeUpdatedOnUtc ? (updatedOnUtc ?? _faker.Date.Recent()) : null, + Moods = includeMoods ? (moods ?? [.. _moodDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Isrcs = includeIsrcs ? (isrcs ?? [.. _isrcDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Contributors = includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Ratings = includeRatings ? (ratings ?? [.. _audioRatingDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null + }; + } + + /// + /// 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/MusicTrackLiteDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackLiteDtoFixture.cs new file mode 100644 index 00000000..102db5f3 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackLiteDtoFixture.cs @@ -0,0 +1,57 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using System; +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 MusicTrackLiteDtoFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The Id of the track. + /// Optional. The title of the track. + /// Optional. The number of the track on its disc. + /// Optional. The number of the disc the track belongs to. + /// Optional. The duration of the track in seconds. + /// Whether the disc number should be included, or forced to . + /// A configured instance. + public MusicTrackLiteDto Create( + Guid? id = null, + string? title = null, + int? trackNumber = null, + int? discNumber = null, + int? durationInSeconds = null, + bool includeDiscNumber = true) + { + return new MusicTrackLiteDto + { + Id = id ?? _faker.Random.Guid(), + Title = title ?? _faker.Lorem.Sentence(3), + TrackNumber = trackNumber ?? _faker.Random.Number(1, 30), + DiscNumber = includeDiscNumber ? (discNumber ?? _faker.Random.Number(1, 3)) : null, + DurationInSeconds = durationInSeconds ?? _faker.Random.Number(30, 600) + }; + } + + /// + /// 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/MusicTrackMetadataDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackMetadataDtoFixture.cs new file mode 100644 index 00000000..cf5227b9 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicTrackMetadataDtoFixture.cs @@ -0,0 +1,148 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; +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 MusicTrackMetadataDtoFixture +{ + private readonly Faker _faker = new(); + private readonly ReleaseInfoDtoFixture _releaseInfoDtoFixture = new(); + private readonly LanguageInfoDtoFixture _languageInfoDtoFixture = new(); + private readonly TagDtoFixture _tagDtoFixture = new(); + private readonly GenreDtoFixture _genreDtoFixture = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The title of the track. + /// Optional. The original title of the track. + /// Optional. A brief description of the track. + /// Optional. The disambiguation comment of the track. + /// Optional. The release information of the track. + /// Optional. The language of the track. + /// Optional. The original language of the track. + /// Optional. The tags that describe or categorize the track. + /// Optional. The genres associated with the track. + /// Optional. Whether the recording of the track is a video recording. + /// Optional. The duration of the audio of the track in seconds. + /// Optional. The sample rate of the audio of the track in Hz. + /// Optional. The number of audio channels of the track. + /// Optional. The bit depth of the audio of the track. + /// Optional. The audio codec used by the track. + /// Optional. The bitrate of the audio of the track in kbps. + /// Optional. The AcoustID fingerprint identifier of the audio file of the track. + /// Optional. The ReplayGain track gain of the track in decibels. + /// Optional. The ReplayGain track peak of the track. + /// Optional. The ReplayGain album gain of the track in decibels. + /// Optional. The ReplayGain album peak of the track. + /// Whether the title should be included, or forced to . + /// Whether the original title should be included, or forced to . + /// Whether the description should be included, or forced to . + /// Whether the disambiguation should be included, or forced to . + /// Whether the release information should be included, or forced to . + /// Whether the language should be included, or forced to . + /// Whether the original language should be included, or forced to . + /// Whether the tags should be included, or forced to . + /// Whether the genres should be included, or forced to . + /// Whether the duration should be included, or forced to . + /// Whether the sample rate should be included, or forced to . + /// Whether the channels should be included, or forced to . + /// Whether the bit depth should be included, or forced to . + /// Whether the audio codec should be included, or forced to . + /// Whether the bitrate should be included, or forced to . + /// Whether the AcoustID should be included, or forced to . + /// Whether the ReplayGain track gain should be included, or forced to . + /// Whether the ReplayGain track peak should be included, or forced to . + /// Whether the ReplayGain album gain should be included, or forced to . + /// Whether the ReplayGain album peak should be included, or forced to . + /// A configured instance. + public MusicTrackMetadataDto Create( + string? title = null, + string? originalTitle = null, + string? description = null, + string? disambiguation = null, + ReleaseInfoDto? releaseInfo = null, + LanguageInfoDto? language = null, + LanguageInfoDto? originalLanguage = null, + List? tags = null, + List? genres = null, + bool isVideo = false, + int? durationInSeconds = null, + int? sampleRate = null, + int? channels = null, + int? bitDepth = null, + string? audioCodec = null, + int? bitrate = null, + string? acoustId = null, + decimal? replayGainTrackGain = null, + decimal? replayGainTrackPeak = null, + decimal? replayGainAlbumGain = null, + decimal? replayGainAlbumPeak = null, + bool includeTitle = true, + bool includeOriginalTitle = true, + bool includeDescription = true, + bool includeDisambiguation = true, + bool includeReleaseInfo = true, + bool includeLanguage = true, + bool includeOriginalLanguage = true, + bool includeTags = true, + bool includeGenres = true, + bool includeDurationInSeconds = true, + bool includeSampleRate = true, + bool includeChannels = true, + bool includeBitDepth = true, + bool includeAudioCodec = true, + bool includeBitrate = true, + bool includeAcoustId = true, + bool includeReplayGainTrackGain = true, + bool includeReplayGainTrackPeak = true, + bool includeReplayGainAlbumGain = true, + bool includeReplayGainAlbumPeak = true) + { + return new MusicTrackMetadataDto + { + Title = includeTitle ? (title ?? _faker.Lorem.Sentence(3)) : null, + OriginalTitle = includeOriginalTitle ? (originalTitle ?? _faker.Lorem.Sentence(3)) : null, + Description = includeDescription ? (description ?? _faker.Lorem.Paragraph()) : null, + Disambiguation = includeDisambiguation ? (disambiguation ?? _faker.Lorem.Word()) : null, + ReleaseInfo = includeReleaseInfo ? (releaseInfo ?? _releaseInfoDtoFixture.Create()) : null, + Language = includeLanguage ? (language ?? _languageInfoDtoFixture.Create()) : null, + OriginalLanguage = includeOriginalLanguage ? (originalLanguage ?? _languageInfoDtoFixture.Create()) : null, + Tags = includeTags ? (tags ?? [.. _tagDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Genres = includeGenres ? (genres ?? [.. _genreDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + IsVideo = isVideo, + DurationInSeconds = includeDurationInSeconds ? (durationInSeconds ?? _faker.Random.Number(30, 600)) : null, + SampleRate = includeSampleRate ? (sampleRate ?? _faker.Random.Number(22050, 192000)) : null, + Channels = includeChannels ? (channels ?? _faker.Random.Number(1, 8)) : null, + BitDepth = includeBitDepth ? (bitDepth ?? _faker.Random.Number(8, 32)) : null, + AudioCodec = includeAudioCodec ? (audioCodec ?? _faker.Lorem.Word()) : null, + Bitrate = includeBitrate ? (bitrate ?? _faker.Random.Number(64, 1411)) : null, + AcoustId = includeAcoustId ? (acoustId ?? _faker.Random.String2(32, "0123456789abcdef")) : null, + ReplayGainTrackGain = includeReplayGainTrackGain ? (replayGainTrackGain ?? _faker.Random.Decimal(-20m, 0m)) : null, + ReplayGainTrackPeak = includeReplayGainTrackPeak ? (replayGainTrackPeak ?? _faker.Random.Decimal(0m, 1m)) : null, + ReplayGainAlbumGain = includeReplayGainAlbumGain ? (replayGainAlbumGain ?? _faker.Random.Decimal(-20m, 0m)) : null, + ReplayGainAlbumPeak = includeReplayGainAlbumPeak ? (replayGainAlbumPeak ?? _faker.Random.Decimal(0m, 1m)) : null + }; + } + + /// + /// 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/MusicWorkDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicWorkDtoFixture.cs new file mode 100644 index 00000000..e9ac977b --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/MusicWorkDtoFixture.cs @@ -0,0 +1,68 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; +using System; +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 MusicWorkDtoFixture +{ + private readonly Faker _faker = new(); + private readonly LanguageInfoDtoFixture _languageInfoDtoFixture = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The MusicBrainz identifier of the work. + /// Optional. The title of the work. + /// Optional. The MusicBrainz type of the work. + /// Optional. The languages of the work. + /// Optional. The ISWC codes of the work. + /// Whether the MusicBrainz work Id should be included, or forced to . + /// Whether the title should be included, or forced to . + /// Whether the type should be included, or forced to . + /// Whether the languages should be included, or forced to . + /// Whether the ISWC codes should be included, or forced to . + /// A configured instance. + public MusicWorkDto Create( + Guid? musicBrainzWorkId = null, + string? title = null, + string? type = null, + List? languages = null, + List? iswcs = null, + bool includeMusicBrainzWorkId = true, + bool includeTitle = true, + bool includeType = true, + bool includeLanguages = true, + bool includeIswcs = true) + { + return new MusicWorkDto + { + MusicBrainzWorkId = includeMusicBrainzWorkId ? (musicBrainzWorkId ?? _faker.Random.Guid()) : null, + Title = includeTitle ? (title ?? _faker.Lorem.Sentence(3)) : null, + Type = includeType ? (type ?? _faker.Lorem.Word()) : null, + Languages = includeLanguages ? (languages ?? [.. _languageInfoDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Iswcs = includeIswcs ? (iswcs ?? [.. Enumerable.Range(0, _faker.Random.Number(1, 3)).Select(_ => $"T{_faker.Random.Number(100000000, 999999999)}")]) : null + }; + } + + /// + /// 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/PaginatedMusicAlbumLiteDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDtoFixture.cs new file mode 100644 index 00000000..a3d75dc1 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicAlbumLiteDtoFixture.cs @@ -0,0 +1,55 @@ +#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 new file mode 100644 index 00000000..dea5fd9e --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicArtistLiteDtoFixture.cs @@ -0,0 +1,55 @@ +#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 new file mode 100644 index 00000000..c034f61c --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/PaginatedMusicTrackLiteDtoFixture.cs @@ -0,0 +1,55 @@ +#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/AudioLibrary/MusicLibrary/UpdateMusicCoverDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/UpdateMusicCoverDtoFixture.cs new file mode 100644 index 00000000..d1a1ba81 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/AudioLibrary/MusicLibrary/UpdateMusicCoverDtoFixture.cs @@ -0,0 +1,44 @@ +#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 UpdateMusicCoverDtoFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The relative path of the stored cover image. + /// Whether the cover path should be included, or forced to . + /// A configured instance. + public UpdateMusicCoverDto Create( + string? coverPath = null, + bool includeCoverPath = true) + { + return new UpdateMusicCoverDto + { + CoverPath = includeCoverPath ? (coverPath ?? _faker.System.FilePath()) : null + }; + } + + /// + /// 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/Common/MediaArtworkDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Common/MediaArtworkDtoFixture.cs new file mode 100644 index 00000000..1dfbdb91 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Common/MediaArtworkDtoFixture.cs @@ -0,0 +1,49 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.Enums.MediaLibrary; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.DTO.Common; + +/// +/// Fixture class for the class. +/// +[ExcludeFromCodeCoverage] +public class MediaArtworkDtoFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The type of the artwork. + /// Optional. The ordinal of the artwork within its type. + /// Optional. The relative path of the stored artwork file. + /// A configured instance. + public MediaArtworkDto Create( + ArtworkType? type = null, + int? ordinal = null, + string? path = null) + { + return new MediaArtworkDto + { + Type = type ?? _faker.PickRandom(), + Ordinal = ordinal ?? _faker.Random.Int(1, 10), + Path = path ?? _faker.System.FilePath() + }; + } + + /// + /// 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/Common/MoodDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Common/MoodDtoFixture.cs new file mode 100644 index 00000000..11f69492 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Common/MoodDtoFixture.cs @@ -0,0 +1,44 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +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.Common; + +/// +/// Fixture class for the class. +/// +[ExcludeFromCodeCoverage] +public class MoodDtoFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The name of the mood. + /// Whether the name should be included, or forced to . + /// A configured instance. + public MoodDto Create( + string? name = null, + bool includeName = true) + { + return new MoodDto + { + Name = includeName ? (name ?? _faker.Lorem.Word()) : null + }; + } + + /// + /// 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/MediaContributors/MediaContributorReferenceDtoFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/MediaContributors/MediaContributorReferenceDtoFixture.cs new file mode 100644 index 00000000..d130ec3b --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/MediaContributors/MediaContributorReferenceDtoFixture.cs @@ -0,0 +1,49 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.MediaContributors; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.DTO.MediaContributors; + +/// +/// Fixture class for the class. +/// +[ExcludeFromCodeCoverage] +public class MediaContributorReferenceDtoFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The unique identifier of the media contributor. + /// Optional. The role the contributor played. + /// Whether the role should be included, or forced to . + /// A configured instance. + public MediaContributorReferenceDto Create( + Guid? contributorId = null, + MediaContributorRole? role = null, + bool includeRole = true) + { + return new MediaContributorReferenceDto + { + ContributorId = contributorId ?? _faker.Random.Guid(), + Role = includeRole ? (role ?? _faker.PickRandom()) : null + }; + } + + /// + /// 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/Requests/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbumsLiteRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbumsLiteRequestFixture.cs new file mode 100644 index 00000000..ff47c388 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbumsLiteRequestFixture.cs @@ -0,0 +1,48 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class GetArtistAlbumsLiteRequestFixture +{ + /// + /// Creates a new instance with randomized test data. + /// + /// Optional Id of the artist whose albums are retrieved. + /// Optional Id of the media library the artist belongs to. + /// Optional page of results to retrieve. + /// Optional maximum number of albums to retrieve per page. + /// A configured instance. + public GetArtistAlbumsLiteRequest Create( + string? artistId = null, + Guid? libraryId = null, + int? currentPage = null, + int? perPage = null) + { + return new GetArtistAlbumsLiteRequest( + ArtistId: artistId ?? Guid.NewGuid().ToString(), + LibraryId: libraryId ?? Guid.NewGuid(), + CurrentPage: currentPage, + PerPage: perPage + ); + } + + /// + /// 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/Requests/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbumViewRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbumViewRequestFixture.cs new file mode 100644 index 00000000..afa7bfcd --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbumViewRequestFixture.cs @@ -0,0 +1,44 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class GetMusicAlbumViewRequestFixture +{ + /// + /// Creates a new instance. + /// + /// Optional unique identifier of the artist the album belongs to. + /// Optional unique identifier of the album to retrieve. + /// Optional unique identifier of the media library the album belongs to. + /// A configured instance. + public GetMusicAlbumViewRequest Create( + string? artistId = null, + string? albumId = null, + Guid? libraryId = null) + { + return new GetMusicAlbumViewRequest( + artistId ?? Guid.NewGuid().ToString(), + albumId ?? Guid.NewGuid().ToString(), + libraryId ?? Guid.NewGuid()); + } + + /// + /// Creates a list of instances. + /// + /// 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/Requests/Library/AudioLibrary/MusicLibrary/Albums/UpdateMusicAlbumRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/UpdateMusicAlbumRequestFixture.cs new file mode 100644 index 00000000..b096d524 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Albums/UpdateMusicAlbumRequestFixture.cs @@ -0,0 +1,109 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.MediaContributors; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class UpdateMusicAlbumRequestFixture +{ + private readonly Faker _faker = new(); + private readonly MusicAlbumMetadataDtoFixture _musicAlbumMetadataDtoFixture = new(); + private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new(); + private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The album metadata of the album. + /// Optional. The physical or digital medium of the album. + /// Optional. The outermost physical packaging of the album. + /// Optional. The barcode of the album. + /// Optional. The catalog numbers of the album. + /// Optional. The name of the label that issued the album. + /// Optional. The ASIN of the album. + /// Optional. The MusicBrainz identifier of the release. + /// Optional. The MusicBrainz identifier of the release group. + /// Optional. The MusicBrainz identifier of the release artist. + /// Optional. The references to the media contributors that performed on the album. + /// Optional. The ratings of the album. + /// Whether the metadata should be included, or forced to . + /// Whether the media format should be included, or forced to . + /// Whether the packaging should be included, or forced to . + /// Whether the barcode should be included, or forced to . + /// Whether the catalog numbers should be included, or forced to . + /// Whether the label should be included, or forced to . + /// Whether the ASIN should be included, or forced to . + /// Whether the MusicBrainz release Id should be included, or forced to . + /// Whether the MusicBrainz release group Id should be included, or forced to . + /// Whether the MusicBrainz release artist Id should be included, or forced to . + /// Whether the contributors should be included, or forced to . + /// Whether the ratings should be included, or forced to . + /// A configured instance. + public UpdateMusicAlbumRequest Create( + MusicAlbumMetadataDto? metadata = null, + MusicMediaFormat? mediaFormat = null, + MusicReleasePackaging? packaging = null, + string? barcode = null, + List? catalogNumbers = null, + string? label = null, + string? asin = null, + Guid? musicBrainzReleaseId = null, + Guid? musicBrainzReleaseGroupId = null, + Guid? musicBrainzReleaseArtistId = null, + List? contributors = null, + List? ratings = null, + bool includeMetadata = true, + bool includeMediaFormat = true, + bool includePackaging = true, + bool includeBarcode = true, + bool includeCatalogNumbers = true, + bool includeLabel = true, + bool includeAsin = true, + bool includeMusicBrainzReleaseId = true, + bool includeMusicBrainzReleaseGroupId = true, + bool includeMusicBrainzReleaseArtistId = true, + bool includeContributors = true, + bool includeRatings = true) + { + return new UpdateMusicAlbumRequest( + Metadata: includeMetadata ? (metadata ?? _musicAlbumMetadataDtoFixture.Create()) : null, + MediaFormat: includeMediaFormat ? (mediaFormat ?? _faker.PickRandom()) : null, + Packaging: includePackaging ? (packaging ?? _faker.PickRandom()) : null, + Barcode: includeBarcode ? (barcode ?? _faker.Random.String2(13, "0123456789")) : null, + CatalogNumbers: includeCatalogNumbers ? (catalogNumbers ?? [.. Enumerable.Range(0, _faker.Random.Number(1, 3)).Select(_ => _faker.Random.String2(10))]) : null, + Label: includeLabel ? (label ?? _faker.Company.CompanyName()) : null, + ASIN: includeAsin ? (asin ?? _faker.Random.String2(10)) : null, + MusicBrainzReleaseId: includeMusicBrainzReleaseId ? (musicBrainzReleaseId ?? _faker.Random.Guid()) : null, + MusicBrainzReleaseGroupId: includeMusicBrainzReleaseGroupId ? (musicBrainzReleaseGroupId ?? _faker.Random.Guid()) : null, + MusicBrainzReleaseArtistId: includeMusicBrainzReleaseArtistId ? (musicBrainzReleaseArtistId ?? _faker.Random.Guid()) : null, + Contributors: includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Ratings: includeRatings ? (ratings ?? [.. _audioRatingDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null + ); + } + + /// + /// 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/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistViewRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistViewRequestFixture.cs new file mode 100644 index 00000000..36680ecf --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistViewRequestFixture.cs @@ -0,0 +1,41 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class GetMusicArtistViewRequestFixture +{ + /// + /// Creates a new instance. + /// + /// Optional unique identifier of the artist to retrieve. + /// Optional unique identifier of the media library the artist belongs to. + /// A configured instance. + public GetMusicArtistViewRequest Create( + string? artistId = null, + Guid? libraryId = null) + { + return new GetMusicArtistViewRequest( + artistId ?? Guid.NewGuid().ToString(), + libraryId ?? Guid.NewGuid()); + } + + /// + /// Creates a list of instances. + /// + /// 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/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistsLiteRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistsLiteRequestFixture.cs new file mode 100644 index 00000000..1667e201 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistsLiteRequestFixture.cs @@ -0,0 +1,76 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.Enums.Common; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class GetMusicArtistsLiteRequestFixture +{ + private readonly Faker _faker = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional Id of the media library whose artists are retrieved. + /// Optional page of results to retrieve. + /// Optional maximum number of artists to retrieve per page. + /// Optional search term used to filter the artists by name. + /// Optional alpha key used to filter the results by the first character of their name. + /// Optional whether the leading prefix of a name is ignored when computing the alpha key. + /// Optional name of the field by which to sort the results. + /// Optional direction in which to sort the results. + /// Whether the current page should be included, or forced to . + /// Whether the per page count should be included, or forced to . + /// Whether the search term should be included, or forced to . + /// Whether the alpha key should be included, or forced to . + /// Whether the sort field should be included, or forced to . + /// Whether the sort order should be included, or forced to . + /// A configured instance. + public GetMusicArtistsLiteRequest Create( + Guid? libraryId = null, + int? currentPage = null, + int? perPage = null, + string? searchTerm = null, + string? filterAlphaKey = null, + bool shouldIgnoreThePrefixForAlphaPicker = false, + string? sortBy = null, + SortOrder? sortOrder = null, + bool includeCurrentPage = true, + bool includePerPage = true, + bool includeSearchTerm = true, + bool includeFilterAlphaKey = true, + bool includeSortBy = true, + bool includeSortOrder = true) + { + return new GetMusicArtistsLiteRequest( + LibraryId: libraryId ?? _faker.Random.Guid(), + CurrentPage: includeCurrentPage ? (currentPage ?? _faker.Random.Int(1, 100)) : null, + PerPage: includePerPage ? (perPage ?? _faker.Random.Int(1, 100)) : null, + SearchTerm: includeSearchTerm ? (searchTerm ?? _faker.Lorem.Word()) : null, + FilterAlphaKey: includeFilterAlphaKey ? (filterAlphaKey ?? _faker.Random.String2(1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")) : null, + ShouldIgnoreThePrefixForAlphaPicker: shouldIgnoreThePrefixForAlphaPicker, + SortBy: includeSortBy ? (sortBy ?? _faker.Lorem.Word()) : null, + SortOrder: includeSortOrder ? (sortOrder ?? _faker.PickRandom()) : null + ); + } + + /// + /// 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/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistsViewRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistsViewRequestFixture.cs new file mode 100644 index 00000000..3a024c9a --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtistsViewRequestFixture.cs @@ -0,0 +1,39 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class GetMusicArtistsViewRequestFixture +{ + /// + /// Creates a new instance. + /// + /// Optional unique identifier of the media library whose artists are browsed. + /// A configured instance. + public GetMusicArtistsViewRequest Create( + Guid? libraryId = null) + { + return new GetMusicArtistsViewRequest( + LibraryId: libraryId + ); + } + + /// + /// Creates multiple instances. + /// + /// 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/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistAlbumRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistAlbumRequestFixture.cs new file mode 100644 index 00000000..cbe41aa7 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistAlbumRequestFixture.cs @@ -0,0 +1,120 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.MediaContributors; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class UpdateMusicArtistAlbumRequestFixture +{ + private readonly Faker _faker = new(); + private readonly MusicAlbumMetadataDtoFixture _musicAlbumMetadataDtoFixture = new(); + private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new(); + private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new(); + private readonly UpdateMusicArtistTrackRequestFixture _updateMusicArtistTrackRequestFixture = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The Id of the album, when the album already exists. + /// Optional. The album metadata of the album. + /// Optional. The physical or digital medium of the album. + /// Optional. The outermost physical packaging of the album. + /// Optional. The barcode of the album. + /// Optional. The catalog numbers of the album. + /// Optional. The name of the label that issued the album. + /// Optional. The ASIN of the album. + /// Optional. The MusicBrainz identifier of the release. + /// Optional. The MusicBrainz identifier of the release group. + /// Optional. The MusicBrainz identifier of the release artist. + /// Optional. The references to the media contributors that performed on the album. + /// Optional. The ratings of the album. + /// Optional. The tracks of the album. + /// Whether the album Id should be included, or forced to . + /// Whether the metadata should be included, or forced to . + /// Whether the media format should be included, or forced to . + /// Whether the packaging should be included, or forced to . + /// Whether the barcode should be included, or forced to . + /// Whether the catalog numbers should be included, or forced to . + /// Whether the label should be included, or forced to . + /// Whether the ASIN should be included, or forced to . + /// Whether the MusicBrainz release Id should be included, or forced to . + /// Whether the MusicBrainz release group Id should be included, or forced to . + /// Whether the MusicBrainz release artist Id should be included, or forced to . + /// Whether the contributors should be included, or forced to . + /// Whether the ratings should be included, or forced to . + /// Whether the tracks should be included, or forced to . + /// A configured instance. + public UpdateMusicArtistAlbumRequest Create( + Guid? albumId = null, + MusicAlbumMetadataDto? metadata = null, + MusicMediaFormat? mediaFormat = null, + MusicReleasePackaging? packaging = null, + string? barcode = null, + List? catalogNumbers = null, + string? label = null, + string? asin = null, + Guid? musicBrainzReleaseId = null, + Guid? musicBrainzReleaseGroupId = null, + Guid? musicBrainzReleaseArtistId = null, + List? contributors = null, + List? ratings = null, + List? tracks = null, + bool includeAlbumId = true, + bool includeMetadata = true, + bool includeMediaFormat = true, + bool includePackaging = true, + bool includeBarcode = true, + bool includeCatalogNumbers = true, + bool includeLabel = true, + bool includeAsin = true, + bool includeMusicBrainzReleaseId = true, + bool includeMusicBrainzReleaseGroupId = true, + bool includeMusicBrainzReleaseArtistId = true, + bool includeContributors = true, + bool includeRatings = true, + bool includeTracks = true) + { + return new UpdateMusicArtistAlbumRequest( + AlbumId: includeAlbumId ? (albumId ?? _faker.Random.Guid()) : null, + Metadata: includeMetadata ? (metadata ?? _musicAlbumMetadataDtoFixture.Create()) : null, + MediaFormat: includeMediaFormat ? (mediaFormat ?? _faker.PickRandom()) : null, + Packaging: includePackaging ? (packaging ?? _faker.PickRandom()) : null, + Barcode: includeBarcode ? (barcode ?? _faker.Random.String2(13, "0123456789")) : null, + CatalogNumbers: includeCatalogNumbers ? (catalogNumbers ?? [.. Enumerable.Range(0, _faker.Random.Number(1, 3)).Select(_ => _faker.Random.String2(10))]) : null, + Label: includeLabel ? (label ?? _faker.Company.CompanyName()) : null, + ASIN: includeAsin ? (asin ?? _faker.Random.String2(10)) : null, + MusicBrainzReleaseId: includeMusicBrainzReleaseId ? (musicBrainzReleaseId ?? _faker.Random.Guid()) : null, + MusicBrainzReleaseGroupId: includeMusicBrainzReleaseGroupId ? (musicBrainzReleaseGroupId ?? _faker.Random.Guid()) : null, + MusicBrainzReleaseArtistId: includeMusicBrainzReleaseArtistId ? (musicBrainzReleaseArtistId ?? _faker.Random.Guid()) : null, + Contributors: includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Ratings: includeRatings ? (ratings ?? [.. _audioRatingDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Tracks: includeTracks ? (tracks ?? [.. _updateMusicArtistTrackRequestFixture.CreateMany(_faker.Random.Number(1, 3))]) : null + ); + } + + /// + /// 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/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistRequestFixture.cs new file mode 100644 index 00000000..3000e5a7 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistRequestFixture.cs @@ -0,0 +1,89 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.MediaContributors; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class UpdateMusicArtistRequestFixture +{ + private readonly Faker _faker = new(); + private readonly MusicArtistMetadataDtoFixture _musicArtistMetadataDtoFixture = new(); + private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new(); + private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new(); + private readonly UpdateMusicArtistAlbumRequestFixture _updateMusicArtistAlbumRequestFixture = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The metadata of the artist. + /// Optional. The website of the artist. + /// Optional. The MusicBrainz identifier of the artist. + /// Optional. The IPI codes of the artist. + /// Optional. The ISNI codes of the artist. + /// Optional. The references to the media contributors that make up the artist. + /// Optional. The ratings of the artist. + /// Optional. The albums of the artist, each with its own list of tracks. + /// Whether the metadata should be included, or forced to . + /// Whether the website should be included, or forced to . + /// Whether the MusicBrainz artist Id should be included, or forced to . + /// Whether the IPI codes should be included, or forced to . + /// Whether the ISNI codes should be included, or forced to . + /// Whether the contributors should be included, or forced to . + /// Whether the ratings should be included, or forced to . + /// Whether the albums should be included, or forced to . + /// A configured instance. + public UpdateMusicArtistRequest Create( + MusicArtistMetadataDto? metadata = null, + string? website = null, + Guid? musicBrainzArtistId = null, + List? ipis = null, + List? isnis = null, + List? contributors = null, + List? ratings = null, + List? albums = null, + bool includeMetadata = true, + bool includeWebsite = true, + bool includeMusicBrainzArtistId = true, + bool includeIpis = true, + bool includeIsnis = true, + bool includeContributors = true, + bool includeRatings = true, + bool includeAlbums = true) + { + return new UpdateMusicArtistRequest( + Metadata: includeMetadata ? (metadata ?? _musicArtistMetadataDtoFixture.Create()) : null, + Website: includeWebsite ? (website ?? _faker.Internet.Url()) : null, + MusicBrainzArtistId: includeMusicBrainzArtistId ? (musicBrainzArtistId ?? _faker.Random.Guid()) : null, + Ipis: includeIpis ? (ipis ?? [.. Enumerable.Range(0, _faker.Random.Number(1, 3)).Select(_ => _faker.Random.String2(10, "0123456789"))]) : null, + Isnis: includeIsnis ? (isnis ?? [.. Enumerable.Range(0, _faker.Random.Number(1, 3)).Select(_ => _faker.Random.String2(16, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"))]) : null, + Contributors: includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Ratings: includeRatings ? (ratings ?? [.. _audioRatingDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Albums: includeAlbums ? (albums ?? [.. _updateMusicArtistAlbumRequestFixture.CreateMany(_faker.Random.Number(1, 3))]) : null + ); + } + + /// + /// 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/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistTrackRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistTrackRequestFixture.cs new file mode 100644 index 00000000..9d1b6cf8 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Artists/UpdateMusicArtistTrackRequestFixture.cs @@ -0,0 +1,129 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; +using Lumina.Presentation.Web.Fixtures.Common.DTO.MediaContributors; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class UpdateMusicArtistTrackRequestFixture +{ + private readonly Faker _faker = new(); + private readonly MusicTrackMetadataDtoFixture _musicTrackMetadataDtoFixture = new(); + private readonly MusicWorkDtoFixture _musicWorkDtoFixture = new(); + private readonly MoodDtoFixture _moodDtoFixture = new(); + private readonly IsrcDtoFixture _isrcDtoFixture = new(); + private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new(); + private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The Id of the track, when the track already exists. + /// Optional. The file system path of the track. + /// Optional. The audio metadata of the track. + /// Optional. The number of the track on its disc. + /// Optional. The number of the disc the track belongs to. + /// Optional. The script used by the language of the track. + /// Optional. The musical key of the track. + /// Optional. The tempo of the track in beats per minute. + /// Optional. The work the track is a recording of. + /// Optional. The MusicBrainz identifier of the recording. + /// Optional. The MusicBrainz identifier of the track. + /// Optional. The moods of the track. + /// Optional. The ISRC codes of the track. + /// Optional. The references to the media contributors that performed on the track. + /// Optional. The ratings of the track. + /// Whether the track Id should be included, or forced to . + /// Whether the path should be included, or forced to . + /// Whether the metadata should be included, or forced to . + /// Whether the track number should be included, or forced to . + /// Whether the disc number should be included, or forced to . + /// Whether the script should be included, or forced to . + /// Whether the key should be included, or forced to . + /// Whether the BPM should be included, or forced to . + /// Whether the work should be included, or forced to . + /// Whether the MusicBrainz recording Id should be included, or forced to . + /// Whether the MusicBrainz track Id should be included, or forced to . + /// Whether the moods should be included, or forced to . + /// Whether the ISRC codes should be included, or forced to . + /// Whether the contributors should be included, or forced to . + /// Whether the ratings should be included, or forced to . + /// A configured instance. + public UpdateMusicArtistTrackRequest Create( + Guid? trackId = null, + string? path = null, + MusicTrackMetadataDto? metadata = null, + int? trackNumber = null, + int? discNumber = null, + string? script = null, + MusicKey? key = null, + int? bpm = null, + MusicWorkDto? work = null, + Guid? musicBrainzRecordingId = null, + Guid? musicBrainzTrackId = null, + List? moods = null, + List? isrcs = null, + List? contributors = null, + List? ratings = null, + bool includeTrackId = true, + bool includePath = true, + bool includeMetadata = true, + bool includeTrackNumber = true, + bool includeDiscNumber = true, + bool includeScript = true, + bool includeKey = true, + bool includeBpm = true, + bool includeWork = true, + bool includeMusicBrainzRecordingId = true, + bool includeMusicBrainzTrackId = true, + bool includeMoods = true, + bool includeIsrcs = true, + bool includeContributors = true, + bool includeRatings = true) + { + return new UpdateMusicArtistTrackRequest( + TrackId: includeTrackId ? (trackId ?? _faker.Random.Guid()) : null, + Path: includePath ? (path ?? _faker.System.FilePath()) : null, + Metadata: includeMetadata ? (metadata ?? _musicTrackMetadataDtoFixture.Create()) : null, + TrackNumber: includeTrackNumber ? (trackNumber ?? _faker.Random.Number(1, 30)) : null, + DiscNumber: includeDiscNumber ? (discNumber ?? _faker.Random.Number(1, 4)) : null, + Script: includeScript ? (script ?? _faker.Lorem.Word()) : null, + Key: includeKey ? (key ?? _faker.PickRandom()) : null, + Bpm: includeBpm ? (bpm ?? _faker.Random.Number(60, 200)) : null, + Work: includeWork ? (work ?? _musicWorkDtoFixture.Create()) : null, + MusicBrainzRecordingId: includeMusicBrainzRecordingId ? (musicBrainzRecordingId ?? _faker.Random.Guid()) : null, + MusicBrainzTrackId: includeMusicBrainzTrackId ? (musicBrainzTrackId ?? _faker.Random.Guid()) : null, + Moods: includeMoods ? (moods ?? [.. _moodDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Isrcs: includeIsrcs ? (isrcs ?? [.. _isrcDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Contributors: includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Ratings: includeRatings ? (ratings ?? [.. _audioRatingDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null + ); + } + + /// + /// 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/Requests/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracksLiteRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracksLiteRequestFixture.cs new file mode 100644 index 00000000..a40ce2fe --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracksLiteRequestFixture.cs @@ -0,0 +1,51 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class GetAlbumTracksLiteRequestFixture +{ + /// + /// Creates a new instance with randomized test data. + /// + /// Optional Id of the artist the album belongs to. + /// Optional Id of the album whose tracks are retrieved. + /// Optional Id of the media library the album belongs to. + /// Optional page of results to retrieve. + /// Optional maximum number of tracks to retrieve per page. + /// A configured instance. + public GetAlbumTracksLiteRequest Create( + string? artistId = null, + string? albumId = null, + Guid? libraryId = null, + int? currentPage = null, + int? perPage = null) + { + return new GetAlbumTracksLiteRequest( + ArtistId: artistId ?? Guid.NewGuid().ToString(), + AlbumId: albumId ?? Guid.NewGuid().ToString(), + LibraryId: libraryId ?? Guid.NewGuid(), + CurrentPage: currentPage, + PerPage: perPage + ); + } + + /// + /// 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/Requests/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrackViewRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrackViewRequestFixture.cs new file mode 100644 index 00000000..d135d136 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrackViewRequestFixture.cs @@ -0,0 +1,47 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class GetMusicTrackViewRequestFixture +{ + /// + /// Creates a new instance. + /// + /// Optional unique identifier of the artist the album belongs to. + /// Optional unique identifier of the album the track belongs to. + /// Optional unique identifier of the track to retrieve. + /// Optional unique identifier of the media library the track belongs to. + /// A configured instance. + public GetMusicTrackViewRequest Create( + string? artistId = null, + string? albumId = null, + string? trackId = null, + Guid? libraryId = null) + { + return new GetMusicTrackViewRequest( + artistId ?? Guid.NewGuid().ToString(), + albumId ?? Guid.NewGuid().ToString(), + trackId ?? Guid.NewGuid().ToString(), + libraryId ?? Guid.NewGuid()); + } + + /// + /// Creates a list of instances. + /// + /// 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/Requests/Library/AudioLibrary/MusicLibrary/Tracks/UpdateMusicTrackRequestFixture.cs b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/UpdateMusicTrackRequestFixture.cs new file mode 100644 index 00000000..b34db133 --- /dev/null +++ b/tests/Common/Lumina.Presentation.Web.Fixtures/Common/Requests/Library/AudioLibrary/MusicLibrary/Tracks/UpdateMusicTrackRequestFixture.cs @@ -0,0 +1,124 @@ +#region ========================================================================= USING ===================================================================================== +using Bogus; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.DTO.MediaContributors; +using Lumina.Presentation.Web.Common.Enums.AudioLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Common; +using Lumina.Presentation.Web.Fixtures.Common.DTO.MediaContributors; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +#endregion + +namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; + +/// +/// Fixture class for the record. +/// +[ExcludeFromCodeCoverage] +public class UpdateMusicTrackRequestFixture +{ + private readonly Faker _faker = new(); + private readonly MusicTrackMetadataDtoFixture _musicTrackMetadataDtoFixture = new(); + private readonly MusicWorkDtoFixture _musicWorkDtoFixture = new(); + private readonly MoodDtoFixture _moodDtoFixture = new(); + private readonly IsrcDtoFixture _isrcDtoFixture = new(); + private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new(); + private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new(); + + /// + /// Creates a new instance with randomized test data. + /// + /// Optional. The file system path of the track. + /// Optional. The audio metadata of the track. + /// Optional. The number of the track on its disc. + /// Optional. The number of the disc the track belongs to. + /// Optional. The script used by the language of the track. + /// Optional. The musical key of the track. + /// Optional. The tempo of the track in beats per minute. + /// Optional. The work the track is a recording of. + /// Optional. The MusicBrainz identifier of the recording. + /// Optional. The MusicBrainz identifier of the track. + /// Optional. The moods of the track. + /// Optional. The ISRC codes of the track. + /// Optional. The references to the media contributors that performed on the track. + /// Optional. The ratings of the track. + /// Whether the path should be included, or forced to . + /// Whether the metadata should be included, or forced to . + /// Whether the track number should be included, or forced to . + /// Whether the disc number should be included, or forced to . + /// Whether the script should be included, or forced to . + /// Whether the key should be included, or forced to . + /// Whether the BPM should be included, or forced to . + /// Whether the work should be included, or forced to . + /// Whether the MusicBrainz recording Id should be included, or forced to . + /// Whether the MusicBrainz track Id should be included, or forced to . + /// Whether the moods should be included, or forced to . + /// Whether the ISRC codes should be included, or forced to . + /// Whether the contributors should be included, or forced to . + /// Whether the ratings should be included, or forced to . + /// A configured instance. + public UpdateMusicTrackRequest Create( + string? path = null, + MusicTrackMetadataDto? metadata = null, + int? trackNumber = null, + int? discNumber = null, + string? script = null, + MusicKey? key = null, + int? bpm = null, + MusicWorkDto? work = null, + Guid? musicBrainzRecordingId = null, + Guid? musicBrainzTrackId = null, + List? moods = null, + List? isrcs = null, + List? contributors = null, + List? ratings = null, + bool includePath = true, + bool includeMetadata = true, + bool includeTrackNumber = true, + bool includeDiscNumber = true, + bool includeScript = true, + bool includeKey = true, + bool includeBpm = true, + bool includeWork = true, + bool includeMusicBrainzRecordingId = true, + bool includeMusicBrainzTrackId = true, + bool includeMoods = true, + bool includeIsrcs = true, + bool includeContributors = true, + bool includeRatings = true) + { + return new UpdateMusicTrackRequest( + Path: includePath ? (path ?? _faker.System.FilePath()) : null, + Metadata: includeMetadata ? (metadata ?? _musicTrackMetadataDtoFixture.Create()) : null, + TrackNumber: includeTrackNumber ? (trackNumber ?? _faker.Random.Number(1, 30)) : null, + DiscNumber: includeDiscNumber ? (discNumber ?? _faker.Random.Number(1, 4)) : null, + Script: includeScript ? (script ?? _faker.Lorem.Word()) : null, + Key: includeKey ? (key ?? _faker.PickRandom()) : null, + Bpm: includeBpm ? (bpm ?? _faker.Random.Number(60, 200)) : null, + Work: includeWork ? (work ?? _musicWorkDtoFixture.Create()) : null, + MusicBrainzRecordingId: includeMusicBrainzRecordingId ? (musicBrainzRecordingId ?? _faker.Random.Guid()) : null, + MusicBrainzTrackId: includeMusicBrainzTrackId ? (musicBrainzTrackId ?? _faker.Random.Guid()) : null, + Moods: includeMoods ? (moods ?? [.. _moodDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Isrcs: includeIsrcs ? (isrcs ?? [.. _isrcDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Contributors: includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null, + Ratings: includeRatings ? (ratings ?? [.. _audioRatingDtoFixture.CreateMany(_faker.Random.Number(1, 3))]) : null + ); + } + + /// + /// 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/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpointTests.cs new file mode 100644 index 00000000..6db7f020 --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpointTests.cs @@ -0,0 +1,113 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.DeleteMusicAlbum; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.DeleteMusicAlbum; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class DeleteMusicAlbumEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public DeleteMusicAlbumEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task DeleteMusicAlbum_WhenCalledByAuthenticatedUserWithAntiforgeryToken_ShouldForwardDeleteAndReturnSuccess() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + _apiFactory.ApiClientStub.RegisterDeleteSuccess($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}"); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(artistId, albumId, libraryId); + deleteRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Contains($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}", _apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Fact] + public async Task DeleteMusicAlbum_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequest() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(artistId, albumId, libraryId); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.DoesNotContain($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}", _apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Fact] + public async Task DeleteMusicAlbum_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid()); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(deleteRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + /// + /// Builds the delete request for the album identified by the route, with the owning library passed through the query string. + /// + /// The route Id of the artist the album belongs to. + /// The route Id of the album to delete. + /// The Id of the media library the album belongs to. + /// The configured delete request. + private static HttpRequestMessage CreateDeleteRequest(Guid artistId, Guid albumId, Guid libraryId) + { + HttpRequestMessage deleteRequest = new(HttpMethod.Delete, $"/en-us/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-delete-album?libraryId={libraryId}") + { + // The front-end sends the JSON content type even for DELETE requests, which triggers the antiforgery validation. + Content = new StringContent("{}", Encoding.UTF8, "application/json") + }; + // The antiforgery middleware matches the content type exactly, so the charset suffix must be omitted. + deleteRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + deleteRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + return deleteRequest; + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpointTests.cs new file mode 100644 index 00000000..4bac523a --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpointTests.cs @@ -0,0 +1,54 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.EditMusicAlbum; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.EditMusicAlbum; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class EditMusicAlbumViewEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly MusicAlbumDtoFixture _musicAlbumDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public EditMusicAlbumViewEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task EditMusicAlbum_WhenCalledByAuthenticatedUser_ShouldRenderEditAlbumPage() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + MusicAlbumDto expectedAlbum = _musicAlbumDtoFixture.Create(); + expectedAlbum.Metadata!.Title = "An album"; + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{expectedAlbum.LibraryId}/artists/{expectedAlbum.ArtistId}/albums/{expectedAlbum.Id}", expectedAlbum); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + + // Act + HttpResponseMessage response = await webClient.Client.GetAsync($"/en-us/library/audio-library/music-library/artists/{expectedAlbum.ArtistId}/albums/{expectedAlbum.Id}?libraryId={expectedAlbum.LibraryId}"); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/html", response.Content.Headers.ContentType!.MediaType); + Assert.Contains("An album", content); + } +} 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 new file mode 100644 index 00000000..a67fd33a --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs @@ -0,0 +1,78 @@ +#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.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetArtistAlbums; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetArtistAlbumsEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly PaginatedMusicAlbumLiteDtoFixture _paginatedMusicAlbumLiteDtoFixture = new(); + private readonly MusicAlbumLiteDtoFixture _musicAlbumLiteDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public GetArtistAlbumsEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task GetArtistAlbums_WhenCalledByAuthenticatedUser_ShouldReturnAlbumsFromApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + PaginatedMusicAlbumLiteDto 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); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/en-us/library/audio-library/music-library/artists/{artistId}/albums/api-get-albums?libraryId={libraryId}¤tPage=1&perPage=20"); + getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(getRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(expectedResponse.Data.Count, json.RootElement.GetProperty("data").GetProperty("data").GetArrayLength()); + Assert.Contains(expectedEndpoint, _apiFactory.ApiClientStub.GetEndpointsCalled); + } + + [Fact] + public async Task GetArtistAlbums_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/albums/api-get-albums?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpointTests.cs new file mode 100644 index 00000000..aa8db69b --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpointTests.cs @@ -0,0 +1,77 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetMusicAlbum; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetMusicAlbum; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetMusicAlbumEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly MusicAlbumDtoFixture _musicAlbumDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public GetMusicAlbumEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task GetMusicAlbum_WhenCalledByAuthenticatedUser_ShouldReturnAlbumFromApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + MusicAlbumDto expectedAlbum = _musicAlbumDtoFixture.Create(id: albumId, artistId: artistId, libraryId: libraryId); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}", expectedAlbum); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/en-us/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-get-album?libraryId={libraryId}"); + getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(getRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(albumId, json.RootElement.GetProperty("data").GetProperty("id").GetGuid()); + Assert.Contains($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}", _apiFactory.ApiClientStub.GetEndpointsCalled); + } + + [Fact] + public async Task GetMusicAlbum_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/albums/{Guid.NewGuid()}/api-get-album?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpointTests.cs new file mode 100644 index 00000000..6ce099ed --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpointTests.cs @@ -0,0 +1,123 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.SaveMusicAlbum; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Net.Http.Json; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.SaveMusicAlbum; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class SaveMusicAlbumEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly UpdateMusicAlbumRequestFixture _updateMusicAlbumRequestFixture = new(); + private readonly MusicAlbumDtoFixture _musicAlbumDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public SaveMusicAlbumEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task SaveMusicAlbum_WhenCalledByAuthenticatedUserWithAntiforgeryToken_ShouldForwardUpdateAndReturnSuccess() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + UpdateMusicAlbumRequest request = _updateMusicAlbumRequestFixture.Create(); + MusicAlbumDto expectedAlbum = _musicAlbumDtoFixture.Create(id: albumId, artistId: artistId, libraryId: libraryId); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}", expectedAlbum); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId, albumId, libraryId, request); + saveRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(albumId, json.RootElement.GetProperty("data").GetProperty("id").GetGuid()); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}/albums/{albumId}" && putRequest.Data is UpdateMusicAlbumRequest forwarded && forwarded.Metadata!.Title == request.Metadata!.Title && forwarded.ASIN == request.ASIN); + } + + [Fact] + public async Task SaveMusicAlbum_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequest() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + UpdateMusicAlbumRequest request = _updateMusicAlbumRequestFixture.Create(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId, albumId, libraryId, request); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}/albums/{albumId}"); + } + + [Fact] + public async Task SaveMusicAlbum_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), _updateMusicAlbumRequestFixture.Create()); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(saveRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + /// + /// Builds the save request that PUTs the given to the album identified by the route, + /// with the owning library passed through the query string. + /// + /// The route Id of the artist the album belongs to. + /// The route Id of the album to save. + /// The Id of the media library the album belongs to. + /// The album data to send. + /// The configured save request. + private static HttpRequestMessage CreateSaveRequest(Guid artistId, Guid albumId, Guid libraryId, UpdateMusicAlbumRequest request) + { + HttpRequestMessage saveRequest = new(HttpMethod.Put, $"/en-us/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-save-album?libraryId={libraryId}") + { + Content = JsonContent.Create(request) + }; + saveRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + saveRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + return saveRequest; + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpointTests.cs new file mode 100644 index 00000000..7bd00d69 --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpointTests.cs @@ -0,0 +1,154 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.DTO.Common; +using Lumina.Presentation.Web.Common.Exceptions; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.UpdateAlbumCover; +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; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.UpdateAlbumCover; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class UpdateAlbumCoverEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly ProblemDetailsDtoFixture _problemDetailsDtoFixture = new(); + private readonly UpdateMusicCoverDtoFixture _updateMusicCoverDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public UpdateAlbumCoverEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task UpdateAlbumCover_WhenCalledByAuthenticatedUserWithAntiforgeryToken_ShouldUploadCoverAndReturnSuccess() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + const string EXPECTED_PATH = "/media/albums/cover.png"; + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/cover", _updateMusicCoverDtoFixture.Create(coverPath: EXPECTED_PATH)); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(artistId, albumId, libraryId, "cover.png"); + uploadRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(EXPECTED_PATH, json.RootElement.GetProperty("data").GetString()); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/cover" && putRequest.Data as string == "cover.png"); + } + + [Fact] + public async Task UpdateAlbumCover_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequest() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(artistId, albumId, libraryId, "cover.png"); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/cover"); + } + + [Fact] + public async Task UpdateAlbumCover_WhenCalledWithoutUploadedFile_ShouldForwardRequestAndReturnFailure() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + ProblemDetailsDto problemDetails = _problemDetailsDtoFixture.Create(title: "General.Validation", detail: "AlbumCoverCannotBeNull"); + _apiFactory.ApiClientStub.RegisterPutException($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/cover", new ApiException(problemDetails, HttpStatusCode.UnprocessableEntity, $"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/cover")); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + MultipartFormDataContent noFileForm = []; + noFileForm.Add(new StringContent("unrelated-field")); + HttpRequestMessage uploadRequest = new(HttpMethod.Put, $"/en-us/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-update-cover?libraryId={libraryId}") + { + Content = noFileForm + }; + uploadRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + uploadRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + // The web does not short-circuit the missing file; it forwards the request, and the API reports the missing cover + // with the same AlbumCoverCannotBeNull validation error any other client receives. + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/cover" && putRequest.Data == null); + using JsonDocument json = JsonDocument.Parse(content); + Assert.False(json.RootElement.GetProperty("success").GetBoolean()); + } + + [Fact] + public async Task UpdateAlbumCover_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), "cover.png"); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(uploadRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + /// + /// Builds the multipart PUT request that uploads a cover to the album identified by the route. + /// + /// The route Id of the artist the album belongs to. + /// The route Id of the album whose cover is uploaded. + /// The Id of the media library the album belongs to. + /// The name of the uploaded file. + /// The configured upload request. + private static HttpRequestMessage CreateUploadRequest(Guid artistId, Guid albumId, Guid libraryId, string fileName) + { + MultipartFormDataContent form = []; + ByteArrayContent fileContent = new(Encoding.UTF8.GetBytes("fake cover payload")); + fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + form.Add(fileContent, "cover", fileName); + return new HttpRequestMessage(HttpMethod.Put, $"/en-us/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/api-update-cover?libraryId={libraryId}") + { + Content = form + }; + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpointTests.cs new file mode 100644 index 00000000..be8202b4 --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpointTests.cs @@ -0,0 +1,110 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.DeleteMusicArtist; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.DeleteMusicArtist; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class DeleteMusicArtistEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public DeleteMusicArtistEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task DeleteMusicArtist_WhenCalledByAuthenticatedUserWithAntiforgeryToken_ShouldForwardDeleteAndReturnSuccess() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + _apiFactory.ApiClientStub.RegisterDeleteSuccess($"libraries/{libraryId}/artists/{artistId}"); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(artistId, libraryId); + deleteRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Contains($"libraries/{libraryId}/artists/{artistId}", _apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Fact] + public async Task DeleteMusicArtist_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequest() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(artistId, libraryId); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.DoesNotContain($"libraries/{libraryId}/artists/{artistId}", _apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Fact] + public async Task DeleteMusicArtist_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(Guid.NewGuid(), Guid.NewGuid()); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(deleteRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + /// + /// Builds the delete request for the artist identified by the route, with the owning library passed through the query string. + /// + /// The route Id of the artist to delete. + /// The Id of the media library the artist belongs to. + /// The configured delete request. + private static HttpRequestMessage CreateDeleteRequest(Guid artistId, Guid libraryId) + { + HttpRequestMessage deleteRequest = new(HttpMethod.Delete, $"/en-us/library/audio-library/music-library/artists/{artistId}/api-delete-artist?libraryId={libraryId}") + { + // The front-end sends the JSON content type even for DELETE requests, which triggers the antiforgery validation. + Content = new StringContent("{}", Encoding.UTF8, "application/json") + }; + // The antiforgery middleware matches the content type exactly, so the charset suffix must be omitted. + deleteRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + deleteRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + return deleteRequest; + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/EditMusicArtist/EditMusicArtistViewEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/EditMusicArtist/EditMusicArtistViewEndpointTests.cs new file mode 100644 index 00000000..dacc0fc2 --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/EditMusicArtist/EditMusicArtistViewEndpointTests.cs @@ -0,0 +1,69 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.EditMusicArtist; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.EditMusicArtist; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class EditMusicArtistViewEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly MusicArtistDtoFixture _musicArtistDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public EditMusicArtistViewEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task EditMusicArtist_WhenCalledByAuthenticatedUser_ShouldRenderEditArtistPage() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + MusicArtistDto expectedArtist = _musicArtistDtoFixture.Create(); + expectedArtist.Metadata!.Name = "An artist"; + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{expectedArtist.LibraryId}/artists/{expectedArtist.Id}", expectedArtist); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + + // Act + HttpResponseMessage response = await webClient.Client.GetAsync($"/en-us/library/audio-library/music-library/artists/{expectedArtist.Id}?libraryId={expectedArtist.LibraryId}"); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/html", response.Content.Headers.ContentType!.MediaType); + Assert.Contains("An artist", content); + } + + [Fact] + public async Task EditMusicArtist_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpointTests.cs new file mode 100644 index 00000000..1b355e59 --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpointTests.cs @@ -0,0 +1,76 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtist; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtist; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetMusicArtistEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly MusicArtistDtoFixture _musicArtistDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public GetMusicArtistEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task GetMusicArtist_WhenCalledByAuthenticatedUser_ShouldReturnArtistFromApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + MusicArtistDto expectedArtist = _musicArtistDtoFixture.Create(id: artistId, libraryId: libraryId); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{artistId}", expectedArtist); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/en-us/library/audio-library/music-library/artists/{artistId}/api-get-artist?libraryId={libraryId}"); + getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(getRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(artistId, json.RootElement.GetProperty("data").GetProperty("id").GetGuid()); + Assert.Contains($"libraries/{libraryId}/artists/{artistId}", _apiFactory.ApiClientStub.GetEndpointsCalled); + } + + [Fact] + public async Task GetMusicArtist_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/api-get-artist?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } +} 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 new file mode 100644 index 00000000..035aac1a --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs @@ -0,0 +1,78 @@ +#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.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtists; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetMusicArtistsEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly PaginatedMusicArtistLiteDtoFixture _paginatedMusicArtistLiteDtoFixture = new(); + private readonly MusicArtistLiteDtoFixture _musicArtistLiteDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public GetMusicArtistsEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task GetMusicArtists_WhenCalledByAuthenticatedUser_ShouldReturnArtistsFromApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + const string EXPECTED_ENDPOINT = "libraries/{0}/artists/lite?currentPage=1&perPage=20&shouldIgnoreThePrefixForAlphaPicker=False"; + _apiFactory.ApiClientStub.RegisterGetResponse( + string.Format(EXPECTED_ENDPOINT, libraryId), + _paginatedMusicArtistLiteDtoFixture.Create(data: [_musicArtistLiteDtoFixture.Create(name: "Test Artist")], currentPage: 1, perPage: 20, count: 1, numberOfPages: 1)); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/en-us/library/audio-library/music-library/artists/api-get-artists?libraryId={libraryId}¤tPage=1&perPage=20&shouldIgnoreThePrefixForAlphaPicker=false"); + getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(getRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(1, json.RootElement.GetProperty("data").GetProperty("currentPage").GetInt32()); + Assert.Contains(string.Format(EXPECTED_ENDPOINT, libraryId), _apiFactory.ApiClientStub.GetEndpointsCalled); + } + + [Fact] + public async Task GetMusicArtists_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/api-get-artists?libraryId={Guid.NewGuid()}&shouldIgnoreThePrefixForAlphaPicker=false"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpointTests.cs new file mode 100644 index 00000000..fa91de51 --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpointTests.cs @@ -0,0 +1,70 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.Libraries; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.Index; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Libraries; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.Index; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class MusicArtistsIndexViewEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly LibraryDtoFixture _libraryDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public MusicArtistsIndexViewEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task MusicArtistsIndex_WhenCalledByAuthenticatedUserWithLibraryId_ShouldRenderArtistsPage() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + LibraryDto expectedLibrary = _libraryDtoFixture.Create(id: libraryId, title: "Music"); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}", expectedLibrary); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + + // Act + HttpResponseMessage response = await webClient.Client.GetAsync($"/en-us/library/audio-library/music-library/artists?libraryId={libraryId}"); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/html", response.Content.Headers.ContentType!.MediaType); + Assert.Contains("search-input", content); + Assert.Contains($"libraries/{libraryId}", _apiFactory.ApiClientStub.GetEndpointsCalled); + } + + [Fact] + public async Task MusicArtistsIndex_WhenCalledByAuthenticatedUserWithoutLibraryId_ShouldRedirectToHome() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + + // Act + HttpResponseMessage response = await webClient.Client.GetAsync("/en-us/library/audio-library/music-library/artists"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Contains("/en-us", response.Headers.Location!.ToString()); + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpointTests.cs new file mode 100644 index 00000000..3c69e033 --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpointTests.cs @@ -0,0 +1,120 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.SaveMusicArtist; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Net.Http.Json; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.SaveMusicArtist; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class SaveMusicArtistEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly UpdateMusicArtistRequestFixture _updateMusicArtistRequestFixture = new(); + private readonly MusicArtistDtoFixture _musicArtistDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public SaveMusicArtistEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task SaveMusicArtist_WhenCalledByAuthenticatedUserWithAntiforgeryToken_ShouldForwardUpdateAndReturnSuccess() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + UpdateMusicArtistRequest request = _updateMusicArtistRequestFixture.Create(); + MusicArtistDto expectedArtist = _musicArtistDtoFixture.Create(id: artistId, libraryId: libraryId); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{artistId}", expectedArtist); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId, libraryId, request); + saveRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(artistId, json.RootElement.GetProperty("data").GetProperty("id").GetGuid()); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}" && putRequest.Data is UpdateMusicArtistRequest forwarded && forwarded.Metadata!.Name == request.Metadata!.Name); + } + + [Fact] + public async Task SaveMusicArtist_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequest() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + UpdateMusicArtistRequest request = _updateMusicArtistRequestFixture.Create(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId, libraryId, request); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}"); + } + + [Fact] + public async Task SaveMusicArtist_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(Guid.NewGuid(), Guid.NewGuid(), _updateMusicArtistRequestFixture.Create()); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(saveRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + /// + /// Builds the save request that PUTs the given to the artist identified by the route, + /// with the owning library passed through the query string. + /// + /// The route Id of the artist to save. + /// The Id of the media library the artist belongs to. + /// The artist data to send. + /// The configured save request. + private static HttpRequestMessage CreateSaveRequest(Guid artistId, Guid libraryId, UpdateMusicArtistRequest request) + { + HttpRequestMessage saveRequest = new(HttpMethod.Put, $"/en-us/library/audio-library/music-library/artists/{artistId}/api-save-artist?libraryId={libraryId}") + { + Content = JsonContent.Create(request) + }; + saveRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + saveRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + return saveRequest; + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpointTests.cs new file mode 100644 index 00000000..b642d0df --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpointTests.cs @@ -0,0 +1,141 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.UpdateArtistCover; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.UpdateArtistCover; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class UpdateArtistCoverEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly UpdateMusicCoverDtoFixture _updateMusicCoverDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public UpdateArtistCoverEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task UpdateArtistCover_WhenCalledByAuthenticatedUserWithAntiforgeryToken_ShouldUploadCoverAndReturnSuccess() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + const string EXPECTED_PATH = "/media/artists/cover.png"; + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{artistId}/cover", _updateMusicCoverDtoFixture.Create(coverPath: EXPECTED_PATH)); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(artistId, libraryId, "cover.png"); + uploadRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(EXPECTED_PATH, json.RootElement.GetProperty("data").GetString()); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}/cover" && putRequest.Data as string == "cover.png"); + } + + [Fact] + public async Task UpdateArtistCover_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequest() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(artistId, libraryId, "cover.png"); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}/cover"); + } + + [Fact] + public async Task UpdateArtistCover_WhenCalledWithoutUploadedFile_ShouldForwardRequestAndReturnFailure() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{artistId}/cover", _updateMusicCoverDtoFixture.Create(includeCoverPath: false)); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + MultipartFormDataContent noFileForm = []; + noFileForm.Add(new StringContent("unrelated-field")); + HttpRequestMessage uploadRequest = new(HttpMethod.Put, $"/en-us/library/audio-library/music-library/artists/{artistId}/api-update-cover?libraryId={libraryId}") + { + Content = noFileForm + }; + uploadRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + uploadRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + + // Assert + // The web does not short-circuit the missing file; it forwards the request without a file, so that the upstream API reports it. + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}/cover" && putRequest.Data == null); + } + + [Fact] + public async Task UpdateArtistCover_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(Guid.NewGuid(), Guid.NewGuid(), "cover.png"); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(uploadRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + /// + /// Builds the multipart PUT request that uploads a cover to the artist identified by the route. + /// + /// The route Id of the artist whose cover is uploaded. + /// The Id of the media library the artist belongs to. + /// The name of the uploaded file. + /// The configured upload request. + private static HttpRequestMessage CreateUploadRequest(Guid artistId, Guid libraryId, string fileName) + { + MultipartFormDataContent form = []; + ByteArrayContent fileContent = new(Encoding.UTF8.GetBytes("fake cover payload")); + fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + form.Add(fileContent, "cover", fileName); + return new HttpRequestMessage(HttpMethod.Put, $"/en-us/library/audio-library/music-library/artists/{artistId}/api-update-cover?libraryId={libraryId}") + { + Content = form + }; + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpointTests.cs new file mode 100644 index 00000000..84ee603f --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpointTests.cs @@ -0,0 +1,116 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.DeleteMusicTrack; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.DeleteMusicTrack; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class DeleteMusicTrackEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public DeleteMusicTrackEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task DeleteMusicTrack_WhenCalledByAuthenticatedUserWithAntiforgeryToken_ShouldForwardDeleteAndReturnSuccess() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + _apiFactory.ApiClientStub.RegisterDeleteSuccess($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}"); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(artistId, albumId, trackId, libraryId); + deleteRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Contains($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}", _apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Fact] + public async Task DeleteMusicTrack_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequest() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(artistId, albumId, trackId, libraryId); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.DoesNotContain($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}", _apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Fact] + public async Task DeleteMusicTrack_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid()); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(deleteRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + /// + /// Builds the delete request for the track identified by the route, with the owning library passed through the query string. + /// + /// The route Id of the artist the track belongs to. + /// The route Id of the album the track belongs to. + /// The route Id of the track to delete. + /// The Id of the media library the track belongs to. + /// The configured delete request. + private static HttpRequestMessage CreateDeleteRequest(Guid artistId, Guid albumId, Guid trackId, Guid libraryId) + { + HttpRequestMessage deleteRequest = new(HttpMethod.Delete, $"/en-us/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}/api-delete-track?libraryId={libraryId}") + { + // The front-end sends the JSON content type even for DELETE requests, which triggers the antiforgery validation. + Content = new StringContent("{}", Encoding.UTF8, "application/json") + }; + // The antiforgery middleware matches the content type exactly, so the charset suffix must be omitted. + deleteRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + deleteRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + return deleteRequest; + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/EditMusicTrack/EditMusicTrackViewEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/EditMusicTrack/EditMusicTrackViewEndpointTests.cs new file mode 100644 index 00000000..6234e3f5 --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/EditMusicTrack/EditMusicTrackViewEndpointTests.cs @@ -0,0 +1,78 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.EditMusicTrack; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.EditMusicTrack; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class EditMusicTrackViewEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly MusicTrackDtoFixture _musicTrackDtoFixture = new(); + private readonly MusicAlbumDtoFixture _musicAlbumDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public EditMusicTrackViewEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task EditMusicTrack_WhenCalledByAuthenticatedUser_ShouldRenderEditTrackPage() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + MusicTrackDto expectedTrack = _musicTrackDtoFixture.Create(id: trackId, albumId: albumId, libraryId: libraryId); + expectedTrack.Metadata!.Title = "A track"; + MusicAlbumDto expectedAlbum = _musicAlbumDtoFixture.Create(id: albumId, artistId: artistId, libraryId: libraryId); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}", expectedTrack); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}", expectedAlbum); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + + // Act + HttpResponseMessage response = await webClient.Client.GetAsync($"/en-us/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}?libraryId={libraryId}"); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/html", response.Content.Headers.ContentType!.MediaType); + Assert.Contains("A track", content); + Assert.Contains($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}", _apiFactory.ApiClientStub.GetEndpointsCalled); + Assert.Contains($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}", _apiFactory.ApiClientStub.GetEndpointsCalled); + } + + [Fact] + public async Task EditMusicTrack_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/albums/{Guid.NewGuid()}/tracks/{Guid.NewGuid()}?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } +} 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 new file mode 100644 index 00000000..f3e18f1c --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs @@ -0,0 +1,79 @@ +#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.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetAlbumTracks; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetAlbumTracksEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly PaginatedMusicTrackLiteDtoFixture _paginatedMusicTrackLiteDtoFixture = new(); + private readonly MusicTrackLiteDtoFixture _musicTrackLiteDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public GetAlbumTracksEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task GetAlbumTracks_WhenCalledByAuthenticatedUser_ShouldReturnTracksFromApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + PaginatedMusicTrackLiteDto 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); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/en-us/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/api-get-tracks?libraryId={libraryId}¤tPage=1&perPage=20"); + getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(getRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(expectedResponse.Data.Count, json.RootElement.GetProperty("data").GetProperty("data").GetArrayLength()); + Assert.Contains(expectedEndpoint, _apiFactory.ApiClientStub.GetEndpointsCalled); + } + + [Fact] + public async Task GetAlbumTracks_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/albums/{Guid.NewGuid()}/tracks/api-get-tracks?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpointTests.cs new file mode 100644 index 00000000..3159f970 --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpointTests.cs @@ -0,0 +1,78 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetMusicTrack; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetMusicTrack; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetMusicTrackEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly MusicTrackDtoFixture _musicTrackDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public GetMusicTrackEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task GetMusicTrack_WhenCalledByAuthenticatedUser_ShouldReturnTrackFromApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + MusicTrackDto expectedTrack = _musicTrackDtoFixture.Create(id: trackId, albumId: albumId, libraryId: libraryId); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}", expectedTrack); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/en-us/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}/api-get-track?libraryId={libraryId}"); + getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(getRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(trackId, json.RootElement.GetProperty("data").GetProperty("id").GetGuid()); + Assert.Contains($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}", _apiFactory.ApiClientStub.GetEndpointsCalled); + } + + [Fact] + public async Task GetMusicTrack_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/albums/{Guid.NewGuid()}/tracks/{Guid.NewGuid()}/api-get-track?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } +} diff --git a/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpointTests.cs b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpointTests.cs new file mode 100644 index 00000000..91d20f5f --- /dev/null +++ b/tests/IntegrationTests/Lumina.Presentation.Web.IntegrationTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpointTests.cs @@ -0,0 +1,126 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.SaveMusicTrack; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.IntegrationTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Net.Http.Json; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.IntegrationTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.SaveMusicTrack; + +/// +/// Contains integration tests for the class. +/// +[ExcludeFromCodeCoverage] +public class SaveMusicTrackEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly UpdateMusicTrackRequestFixture _updateMusicTrackRequestFixture = new(); + private readonly MusicTrackDtoFixture _musicTrackDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public SaveMusicTrackEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task SaveMusicTrack_WhenCalledByAuthenticatedUserWithAntiforgeryToken_ShouldForwardUpdateAndReturnSuccess() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + UpdateMusicTrackRequest request = _updateMusicTrackRequestFixture.Create(); + MusicTrackDto expectedTrack = _musicTrackDtoFixture.Create(id: trackId, albumId: albumId, libraryId: libraryId); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}", expectedTrack); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId, albumId, trackId, libraryId, request); + saveRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using JsonDocument json = JsonDocument.Parse(content); + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(trackId, json.RootElement.GetProperty("data").GetProperty("id").GetGuid()); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}" && putRequest.Data is UpdateMusicTrackRequest forwarded && forwarded.Metadata!.Title == request.Metadata!.Title && forwarded.Path == request.Path); + } + + [Fact] + public async Task SaveMusicTrack_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequest() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + UpdateMusicTrackRequest request = _updateMusicTrackRequestFixture.Create(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId, albumId, trackId, libraryId, request); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}"); + } + + [Fact] + public async Task SaveMusicTrack_WhenNotAuthenticated_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), _updateMusicTrackRequestFixture.Create()); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(saveRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + /// + /// Builds the save request that PUTs the given to the track identified by the route, + /// with the owning library passed through the query string. + /// + /// The route Id of the artist the track belongs to. + /// The route Id of the album the track belongs to. + /// The route Id of the track to save. + /// The Id of the media library the track belongs to. + /// The track data to send. + /// The configured save request. + private static HttpRequestMessage CreateSaveRequest(Guid artistId, Guid albumId, Guid trackId, Guid libraryId, UpdateMusicTrackRequest request) + { + HttpRequestMessage saveRequest = new(HttpMethod.Put, $"/en-us/library/audio-library/music-library/artists/{artistId}/albums/{albumId}/tracks/{trackId}/api-save-track?libraryId={libraryId}") + { + Content = JsonContent.Create(request) + }; + saveRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + saveRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + return saveRequest; + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpointTests.cs new file mode 100644 index 00000000..f91858f0 --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpointTests.cs @@ -0,0 +1,113 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.DeleteMusicAlbum; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.DeleteMusicAlbum; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class DeleteMusicAlbumEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public DeleteMusicAlbumEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Theory] + [InlineData("'; DROP TABLE Albums; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task DeleteMusicAlbum_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverDeleteAnotherAlbum(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterDeleteSuccess($"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}"); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(maliciousId, maliciousId, libraryId.ToString()); + deleteRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains($"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}", _apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Fact] + public async Task DeleteMusicAlbum_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequestAndNotCallApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(artistId.ToString(), albumId.ToString(), libraryId.ToString()); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Fact] + public async Task DeleteMusicAlbum_WhenCalledWithoutAuthentication_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString()); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(deleteRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + /// + /// Builds the delete request for the album identified by the route, with the owning library passed through the query string. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw query value of the library Id. + /// The configured delete request. + private static HttpRequestMessage CreateDeleteRequest(string artistId, string albumId, string libraryId) + { + HttpRequestMessage deleteRequest = new(HttpMethod.Delete, $"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(artistId)}/albums/{Uri.EscapeDataString(albumId)}/api-delete-album?libraryId={Uri.EscapeDataString(libraryId)}") + { + // The front-end sends the JSON content type even for DELETE requests, which triggers the antiforgery validation. + Content = new StringContent("{}", Encoding.UTF8, "application/json") + }; + // The antiforgery middleware matches the content type exactly, so the charset suffix must be omitted. + deleteRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + deleteRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + return deleteRequest; + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpointTests.cs new file mode 100644 index 00000000..befc3ecd --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/EditMusicAlbum/EditMusicAlbumViewEndpointTests.cs @@ -0,0 +1,43 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.EditMusicAlbum; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.EditMusicAlbum; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class EditMusicAlbumViewEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public EditMusicAlbumViewEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task EditMusicAlbum_WhenCalledWithoutAuthentication_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient client = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await client.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/albums/{Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Equal("http://localhost/en-us/auth/login", response.Headers.Location!.ToString()); + } +} 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 new file mode 100644 index 00000000..e678722a --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs @@ -0,0 +1,75 @@ +#region ========================================================================= USING ===================================================================================== +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.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetArtistAlbums; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetArtistAlbumsEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly PaginatedMusicAlbumLiteDtoFixture _paginatedMusicAlbumLiteDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public GetArtistAlbumsEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task GetArtistAlbums_WhenCalledWithoutAuthentication_ShouldRedirectToLoginWithoutCallingApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/albums/api-get-albums?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } + + [Theory] + [InlineData("'; DROP TABLE Albums; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task GetArtistAlbums_WithSQLInjectionInArtistId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{normalizedId}/albums/lite", _paginatedMusicAlbumLiteDtoFixture.Create()); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + + // Act + HttpResponseMessage response = await webClient.Client.GetAsync($"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(maliciousId)}/albums/api-get-albums?libraryId={libraryId}"); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using (JsonDocument json = JsonDocument.Parse(content)) + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain(maliciousId, content, StringComparison.Ordinal); + Assert.Contains(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint == $"libraries/{libraryId}/artists/{normalizedId}/albums/lite"); + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpointTests.cs new file mode 100644 index 00000000..f84c387a --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpointTests.cs @@ -0,0 +1,79 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetMusicAlbum; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetMusicAlbum; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetMusicAlbumEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly MusicAlbumDtoFixture _musicAlbumDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public GetMusicAlbumEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task GetMusicAlbum_WhenCalledWithoutAuthentication_ShouldRedirectToLoginWithoutCallingApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/albums/{Guid.NewGuid()}/api-get-album?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } + + [Theory] + [InlineData("'; DROP TABLE Albums; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task GetMusicAlbum_WithSQLInjectionInRouteId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + MusicAlbumDto expectedAlbum = _musicAlbumDtoFixture.Create(); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}", expectedAlbum); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + + // Act + HttpResponseMessage response = await webClient.Client.GetAsync($"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(maliciousId)}/albums/{Uri.EscapeDataString(maliciousId)}/api-get-album?libraryId={libraryId}"); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + // The route values are normalized to Guids before they are substituted into the upstream URL, so a crafted route value can never escape + // its URL segment or reach a different album lookup; the Web layer must not fail local binding, leak stack traces or database details. + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using (JsonDocument json = JsonDocument.Parse(content)) + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain(maliciousId, content, StringComparison.Ordinal); + Assert.Contains(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint == $"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}"); + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpointTests.cs new file mode 100644 index 00000000..de55bc26 --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpointTests.cs @@ -0,0 +1,179 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.SaveMusicAlbum; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Net.Http.Json; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.SaveMusicAlbum; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class SaveMusicAlbumEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly UpdateMusicAlbumRequestFixture _updateMusicAlbumRequestFixture = new(); + private readonly MusicAlbumDtoFixture _musicAlbumDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public SaveMusicAlbumEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Theory] + [InlineData("'; DROP TABLE Albums; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task SaveMusicAlbum_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverCallAnotherAlbum(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}", _musicAlbumDtoFixture.Create()); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(maliciousId, maliciousId, libraryId.ToString(), _updateMusicAlbumRequestFixture.Create()); + saveRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + // The route is authoritative and its values are normalized to Guids before they are substituted into the upstream URL, so a crafted + // route value can never escape its URL segment or redirect the update to another album, and the response must not leak stack traces + // or database details. + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}"); + } + + [Theory] + [InlineData("'; DROP TABLE Albums; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task SaveMusicAlbum_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{normalizedId}/artists/{artistId}/albums/{albumId}", _musicAlbumDtoFixture.Create()); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId.ToString(), albumId.ToString(), maliciousLibraryId, _updateMusicAlbumRequestFixture.Create()); + saveRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{normalizedId}/artists/{artistId}/albums/{albumId}"); + } + + [Theory] + [InlineData("'; DROP TABLE Albums; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task SaveMusicAlbum_WithSQLInjectionInPostedTitle_ShouldNotLeakOrExecuteIt(string maliciousTitle) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + UpdateMusicAlbumRequest request = _updateMusicAlbumRequestFixture.Create(); + request.Metadata!.Title = maliciousTitle; + MusicAlbumDto expectedAlbum = _musicAlbumDtoFixture.Create(id: albumId); + expectedAlbum.Metadata!.Title = maliciousTitle; + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}", expectedAlbum); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId.ToString(), albumId.ToString(), libraryId.ToString(), request); + saveRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}/albums/{albumId}" && putRequest.Data is UpdateMusicAlbumRequest forwarded && forwarded.Metadata!.Title == maliciousTitle); + } + + [Fact] + public async Task SaveMusicAlbum_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequestAndNotCallApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId.ToString(), albumId.ToString(), libraryId.ToString(), _updateMusicAlbumRequestFixture.Create()); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + [Fact] + public async Task SaveMusicAlbum_WhenCalledWithoutAuthentication_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), _updateMusicAlbumRequestFixture.Create()); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(saveRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + /// + /// Builds the save request that PUTs the given to the album identified by the route, + /// with the owning library passed through the query string. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw query value of the library Id. + /// The album data to send. + /// The configured save request. + private static HttpRequestMessage CreateSaveRequest(string artistId, string albumId, string libraryId, UpdateMusicAlbumRequest request) + { + HttpRequestMessage saveRequest = new(HttpMethod.Put, $"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(artistId)}/albums/{Uri.EscapeDataString(albumId)}/api-save-album?libraryId={Uri.EscapeDataString(libraryId)}") + { + Content = JsonContent.Create(request) + }; + saveRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + saveRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + return saveRequest; + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpointTests.cs new file mode 100644 index 00000000..a4424354 --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpointTests.cs @@ -0,0 +1,162 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.UpdateAlbumCover; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.UpdateAlbumCover; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class UpdateAlbumCoverEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly UpdateMusicCoverDtoFixture _updateMusicCoverDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public UpdateAlbumCoverEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Theory] + [InlineData("'; DROP TABLE Albums; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task UpdateAlbumCover_WithSQLInjectionInRouteId_ShouldNeverReachAnAlbumOrLeakData(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{Guid.Empty}/albums/{Guid.Empty}/cover", _updateMusicCoverDtoFixture.Create(coverPath: "/media/albums/cover.png")); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(maliciousId, maliciousId, libraryId.ToString(), "cover.png"); + uploadRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + // The route is authoritative: an unparseable route value becomes an empty album or artist Id, so the upload can never reach a real album. + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{Guid.Empty}/albums/{Guid.Empty}/cover"); + } + + [Theory] + [InlineData("'; DROP TABLE MusicArtwork; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task UpdateAlbumCover_WithSQLInjectionInLibraryQueryId_ShouldNormalizeItAndNotLeakData(string maliciousLibraryId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{Guid.Empty}/artists/{artistId}/albums/{albumId}/cover", _updateMusicCoverDtoFixture.Create(coverPath: "/media/albums/cover.png")); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(artistId.ToString(), albumId.ToString(), maliciousLibraryId, "cover.png"); + uploadRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + // The library id is normalized to a Guid before it is substituted into the upstream URL, so a crafted value can never escape its URL segment. + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain(maliciousLibraryId, content, StringComparison.Ordinal); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{Guid.Empty}/artists/{artistId}/albums/{albumId}/cover"); + } + + [Fact] + public async Task UpdateAlbumCover_WithPathTraversalFileName_ShouldNotLeakData() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/cover", _updateMusicCoverDtoFixture.Create(coverPath: "/media/albums/cover.png")); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(artistId.ToString(), albumId.ToString(), libraryId.ToString(), "..\\..\\evil.png"); + uploadRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("..\\", content, StringComparison.Ordinal); + } + + [Fact] + public async Task UpdateAlbumCover_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequestAndNotCallApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(artistId.ToString(), albumId.ToString(), libraryId.ToString(), "cover.png"); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + [Fact] + public async Task UpdateAlbumCover_WhenCalledWithoutAuthentication_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), "cover.png"); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(uploadRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + /// + /// Builds the multipart PUT request that uploads a cover to the album identified by the route. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw query value of the library Id. + /// The name of the uploaded file. + /// The configured upload request. + private static HttpRequestMessage CreateUploadRequest(string artistId, string albumId, string libraryId, string fileName) + { + MultipartFormDataContent form = []; + ByteArrayContent fileContent = new(Encoding.UTF8.GetBytes("fake cover payload")); + fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + form.Add(fileContent, "cover", fileName); + return new HttpRequestMessage(HttpMethod.Put, $"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(artistId)}/albums/{Uri.EscapeDataString(albumId)}/api-update-cover?libraryId={Uri.EscapeDataString(libraryId)}") + { + Content = form + }; + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpointTests.cs new file mode 100644 index 00000000..377f1e60 --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpointTests.cs @@ -0,0 +1,111 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.DeleteMusicArtist; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.DeleteMusicArtist; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class DeleteMusicArtistEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public DeleteMusicArtistEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Theory] + [InlineData("'; DROP TABLE Artists; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task DeleteMusicArtist_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverDeleteAnotherArtist(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterDeleteSuccess($"libraries/{libraryId}/artists/{normalizedId}"); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(maliciousId, libraryId.ToString()); + deleteRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains($"libraries/{libraryId}/artists/{normalizedId}", _apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Fact] + public async Task DeleteMusicArtist_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequestAndNotCallApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(artistId.ToString(), libraryId.ToString()); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Fact] + public async Task DeleteMusicArtist_WhenCalledWithoutAuthentication_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString()); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(deleteRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + /// + /// Builds the delete request for the artist identified by the route, with the owning library passed through the query string. + /// + /// The raw route value of the artist Id. + /// The raw query value of the library Id. + /// The configured delete request. + private static HttpRequestMessage CreateDeleteRequest(string artistId, string libraryId) + { + HttpRequestMessage deleteRequest = new(HttpMethod.Delete, $"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(artistId)}/api-delete-artist?libraryId={Uri.EscapeDataString(libraryId)}") + { + // The front-end sends the JSON content type even for DELETE requests, which triggers the antiforgery validation. + Content = new StringContent("{}", Encoding.UTF8, "application/json") + }; + // The antiforgery middleware matches the content type exactly, so the charset suffix must be omitted. + deleteRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + deleteRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + return deleteRequest; + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/EditMusicArtist/EditMusicArtistViewEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/EditMusicArtist/EditMusicArtistViewEndpointTests.cs new file mode 100644 index 00000000..25391c57 --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/EditMusicArtist/EditMusicArtistViewEndpointTests.cs @@ -0,0 +1,44 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.EditMusicArtist; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.EditMusicArtist; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class EditMusicArtistViewEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public EditMusicArtistViewEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task EditMusicArtist_WhenCalledWithoutAuthentication_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient client = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await client.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Equal("http://localhost/en-us/auth/login", response.Headers.Location!.ToString()); + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpointTests.cs new file mode 100644 index 00000000..6cbdf0f7 --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpointTests.cs @@ -0,0 +1,79 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtist; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtist; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetMusicArtistEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly MusicArtistDtoFixture _musicArtistDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public GetMusicArtistEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task GetMusicArtist_WhenCalledWithoutAuthentication_ShouldRedirectToLoginWithoutCallingApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/api-get-artist?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } + + [Theory] + [InlineData("'; DROP TABLE Artists; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task GetMusicArtist_WithSQLInjectionInRouteId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + MusicArtistDto expectedArtist = _musicArtistDtoFixture.Create(); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{normalizedId}", expectedArtist); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + + // Act + HttpResponseMessage response = await webClient.Client.GetAsync($"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(maliciousId)}/api-get-artist?libraryId={libraryId}"); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + // The route value is normalized to a Guid before it is substituted into the upstream URL, so a crafted route value can never escape + // its URL segment or reach a different artist lookup; the Web layer must not fail local binding, leak stack traces or database details. + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using (JsonDocument json = JsonDocument.Parse(content)) + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain(maliciousId, content, StringComparison.Ordinal); + Assert.Contains($"libraries/{libraryId}/artists/{normalizedId}", _apiFactory.ApiClientStub.GetEndpointsCalled); + } +} 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 new file mode 100644 index 00000000..358b78c1 --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs @@ -0,0 +1,131 @@ +#region ========================================================================= USING ===================================================================================== +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.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtists; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetMusicArtistsEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly PaginatedMusicArtistLiteDtoFixture _paginatedMusicArtistLiteDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public GetMusicArtistsEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task GetMusicArtists_WhenCalledWithoutAuthentication_ShouldRedirectToLoginWithoutCallingApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/api-get-artists?libraryId={Guid.NewGuid()}&shouldIgnoreThePrefixForAlphaPicker=false"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } + + [Theory] + [InlineData("'; DROP TABLE Artists--")] // destructive SQL injection + [InlineData("' OR '1'='1")] // basic SQL injection + public async Task GetMusicArtists_WhenCalledWithInjectionInSearchTerm_ShouldRemainSecure(string maliciousSearchTerm) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string expectedEndpoint = $"libraries/{libraryId}/artists/lite?searchTerm={Uri.EscapeDataString(maliciousSearchTerm)}&shouldIgnoreThePrefixForAlphaPicker=False"; + _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, _paginatedMusicArtistLiteDtoFixture.Create()); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/en-us/library/audio-library/music-library/artists/api-get-artists?libraryId={libraryId}&searchTerm={Uri.EscapeDataString(maliciousSearchTerm)}&shouldIgnoreThePrefixForAlphaPicker=false"); + getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(getRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("stack trace", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("password", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("hash", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("salt", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain(AppContext.BaseDirectory, content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain(maliciousSearchTerm, content, StringComparison.Ordinal); + Assert.Contains(expectedEndpoint, _apiFactory.ApiClientStub.GetEndpointsCalled); + } + + [Theory] + [InlineData("'; DROP TABLE Artists--")] // destructive SQL injection + [InlineData("' OR '1'='1")] // basic SQL injection + public async Task GetMusicArtists_WhenCalledWithInjectionInFilterAlphaKey_ShouldRemainSecure(string maliciousAlphaKey) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string expectedEndpoint = $"libraries/{libraryId}/artists/lite?filterAlphaKey={Uri.EscapeDataString(maliciousAlphaKey)}&shouldIgnoreThePrefixForAlphaPicker=False"; + _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, _paginatedMusicArtistLiteDtoFixture.Create()); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/en-us/library/audio-library/music-library/artists/api-get-artists?libraryId={libraryId}&filterAlphaKey={Uri.EscapeDataString(maliciousAlphaKey)}&shouldIgnoreThePrefixForAlphaPicker=false"); + getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(getRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain(maliciousAlphaKey, content, StringComparison.Ordinal); + Assert.Contains(expectedEndpoint, _apiFactory.ApiClientStub.GetEndpointsCalled); + } + + [Theory] + [InlineData("'; DROP TABLE Artists--")] // destructive SQL injection + [InlineData("' OR '1'='1")] // basic SQL injection + public async Task GetMusicArtists_WhenCalledWithInjectionInSortBy_ShouldRemainSecure(string maliciousSortBy) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string expectedEndpoint = $"libraries/{libraryId}/artists/lite?shouldIgnoreThePrefixForAlphaPicker=False&sortBy={Uri.EscapeDataString(maliciousSortBy)}"; + _apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, _paginatedMusicArtistLiteDtoFixture.Create()); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage getRequest = new(HttpMethod.Get, $"/en-us/library/audio-library/music-library/artists/api-get-artists?libraryId={libraryId}&sortBy={Uri.EscapeDataString(maliciousSortBy)}&shouldIgnoreThePrefixForAlphaPicker=false"); + getRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(getRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + response.EnsureSuccessStatusCode(); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain(maliciousSortBy, content, StringComparison.Ordinal); + Assert.Contains(expectedEndpoint, _apiFactory.ApiClientStub.GetEndpointsCalled); + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpointTests.cs new file mode 100644 index 00000000..3b8b3453 --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpointTests.cs @@ -0,0 +1,45 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.Index; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.Index; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class MusicArtistsIndexViewEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public MusicArtistsIndexViewEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task MusicArtistsIndex_WhenCalledWithoutAuthentication_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient client = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await client.GetAsync($"/en-us/library/audio-library/music-library/artists?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Equal("http://localhost/en-us/auth/login", response.Headers.Location!.ToString()); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.Ordinal)); + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpointTests.cs new file mode 100644 index 00000000..5af3b5a0 --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpointTests.cs @@ -0,0 +1,174 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.SaveMusicArtist; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Net.Http.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.SaveMusicArtist; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class SaveMusicArtistEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly UpdateMusicArtistRequestFixture _updateMusicArtistRequestFixture = new(); + private readonly MusicArtistDtoFixture _musicArtistDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public SaveMusicArtistEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Theory] + [InlineData("'; DROP TABLE Artists; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task SaveMusicArtist_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverCallAnotherArtist(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{normalizedId}", _musicArtistDtoFixture.Create()); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(maliciousId, libraryId.ToString(), _updateMusicArtistRequestFixture.Create()); + saveRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + // The route is authoritative and its value is normalized to a Guid before it is substituted into the upstream URL, so a crafted + // route value can never escape its URL segment or redirect the update to another artist, and the response must not leak stack traces + // or database details. + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{normalizedId}"); + } + + [Theory] + [InlineData("'; DROP TABLE Artists; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task SaveMusicArtist_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid artistId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{normalizedId}/artists/{artistId}", _musicArtistDtoFixture.Create()); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId.ToString(), maliciousLibraryId, _updateMusicArtistRequestFixture.Create()); + saveRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{normalizedId}/artists/{artistId}"); + } + + [Theory] + [InlineData("'; DROP TABLE Artists; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task SaveMusicArtist_WithSQLInjectionInPostedName_ShouldNotLeakOrExecuteIt(string maliciousName) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + UpdateMusicArtistRequest request = _updateMusicArtistRequestFixture.Create(); + request.Metadata!.Name = maliciousName; + MusicArtistDto expectedArtist = _musicArtistDtoFixture.Create(id: artistId); + expectedArtist.Metadata!.Name = maliciousName; + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{artistId}", expectedArtist); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId.ToString(), libraryId.ToString(), request); + saveRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}" && putRequest.Data is UpdateMusicArtistRequest forwarded && forwarded.Metadata!.Name == maliciousName); + } + + [Fact] + public async Task SaveMusicArtist_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequestAndNotCallApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId.ToString(), libraryId.ToString(), _updateMusicArtistRequestFixture.Create()); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + [Fact] + public async Task SaveMusicArtist_WhenCalledWithoutAuthentication_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), _updateMusicArtistRequestFixture.Create()); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(saveRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + /// + /// Builds the save request that PUTs the given to the artist identified by the route, + /// with the owning library passed through the query string. + /// + /// The raw route value of the artist Id. + /// The raw query value of the library Id. + /// The artist data to send. + /// The configured save request. + private static HttpRequestMessage CreateSaveRequest(string artistId, string libraryId, UpdateMusicArtistRequest request) + { + HttpRequestMessage saveRequest = new(HttpMethod.Put, $"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(artistId)}/api-save-artist?libraryId={Uri.EscapeDataString(libraryId)}") + { + Content = JsonContent.Create(request) + }; + saveRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + saveRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + return saveRequest; + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpointTests.cs new file mode 100644 index 00000000..31b778d2 --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpointTests.cs @@ -0,0 +1,158 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.UpdateArtistCover; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.UpdateArtistCover; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class UpdateArtistCoverEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly UpdateMusicCoverDtoFixture _updateMusicCoverDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public UpdateArtistCoverEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Theory] + [InlineData("'; DROP TABLE Artists; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task UpdateArtistCover_WithSQLInjectionInRouteId_ShouldNeverReachAnArtistOrLeakData(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{Guid.Empty}/cover", _updateMusicCoverDtoFixture.Create(coverPath: "/media/artists/cover.png")); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(maliciousId, libraryId.ToString(), "cover.png"); + uploadRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + // The route is authoritative: an unparseable route value becomes an empty artist Id, so the upload can never reach a real artist. + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{Guid.Empty}/cover"); + } + + [Theory] + [InlineData("'; DROP TABLE MusicArtwork; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task UpdateArtistCover_WithSQLInjectionInLibraryQueryId_ShouldNormalizeItAndNotLeakData(string maliciousLibraryId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid artistId = Guid.NewGuid(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{Guid.Empty}/artists/{artistId}/cover", _updateMusicCoverDtoFixture.Create(coverPath: "/media/artists/cover.png")); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(artistId.ToString(), maliciousLibraryId, "cover.png"); + uploadRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + // The library id is normalized to a Guid before it is substituted into the upstream URL, so a crafted value can never escape its URL segment. + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain(maliciousLibraryId, content, StringComparison.Ordinal); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{Guid.Empty}/artists/{artistId}/cover"); + } + + [Fact] + public async Task UpdateArtistCover_WithPathTraversalFileName_ShouldNotLeakData() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{artistId}/cover", _updateMusicCoverDtoFixture.Create(coverPath: "/media/artists/cover.png")); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(artistId.ToString(), libraryId.ToString(), "..\\..\\evil.png"); + uploadRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("..\\", content, StringComparison.Ordinal); + } + + [Fact] + public async Task UpdateArtistCover_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequestAndNotCallApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(artistId.ToString(), libraryId.ToString(), "cover.png"); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(uploadRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + [Fact] + public async Task UpdateArtistCover_WhenCalledWithoutAuthentication_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage uploadRequest = CreateUploadRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), "cover.png"); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(uploadRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + /// + /// Builds the multipart PUT request that uploads a cover to the artist identified by the route. + /// + /// The raw route value of the artist Id. + /// The raw query value of the library Id. + /// The name of the uploaded file. + /// The configured upload request. + private static HttpRequestMessage CreateUploadRequest(string artistId, string libraryId, string fileName) + { + MultipartFormDataContent form = []; + ByteArrayContent fileContent = new(Encoding.UTF8.GetBytes("fake cover payload")); + fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + form.Add(fileContent, "cover", fileName); + return new HttpRequestMessage(HttpMethod.Put, $"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(artistId)}/api-update-cover?libraryId={Uri.EscapeDataString(libraryId)}") + { + Content = form + }; + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpointTests.cs new file mode 100644 index 00000000..9206fb16 --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpointTests.cs @@ -0,0 +1,142 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.DeleteMusicTrack; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.DeleteMusicTrack; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class DeleteMusicTrackEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public DeleteMusicTrackEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Theory] + [InlineData("'; DROP TABLE Tracks; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task DeleteMusicTrack_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverDeleteAnotherTrack(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterDeleteSuccess($"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}/tracks/{normalizedId}"); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(maliciousId, maliciousId, maliciousId, libraryId.ToString()); + deleteRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains($"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}/tracks/{normalizedId}", _apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Theory] + [InlineData("'; DROP TABLE Tracks; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task DeleteMusicTrack_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterDeleteSuccess($"libraries/{normalizedId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}"); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(artistId.ToString(), albumId.ToString(), trackId.ToString(), maliciousLibraryId); + deleteRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains($"libraries/{normalizedId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}", _apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Fact] + public async Task DeleteMusicTrack_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequestAndNotCallApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(artistId.ToString(), albumId.ToString(), trackId.ToString(), libraryId.ToString()); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(deleteRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + [Fact] + public async Task DeleteMusicTrack_WhenCalledWithoutAuthentication_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage deleteRequest = CreateDeleteRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString()); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(deleteRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.DeleteEndpointsCalled); + } + + /// + /// Builds the delete request for the track identified by the route, with the owning library passed through the query string. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw route value of the track Id. + /// The raw query value of the library Id. + /// The configured delete request. + private static HttpRequestMessage CreateDeleteRequest(string artistId, string albumId, string trackId, string libraryId) + { + HttpRequestMessage deleteRequest = new(HttpMethod.Delete, $"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(artistId)}/albums/{Uri.EscapeDataString(albumId)}/tracks/{Uri.EscapeDataString(trackId)}/api-delete-track?libraryId={Uri.EscapeDataString(libraryId)}") + { + // The front-end sends the JSON content type even for DELETE requests, which triggers the antiforgery validation. + Content = new StringContent("{}", Encoding.UTF8, "application/json") + }; + // The antiforgery middleware matches the content type exactly, so the charset suffix must be omitted. + deleteRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + deleteRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + return deleteRequest; + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/EditMusicTrack/EditMusicTrackViewEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/EditMusicTrack/EditMusicTrackViewEndpointTests.cs new file mode 100644 index 00000000..c15f28b4 --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/EditMusicTrack/EditMusicTrackViewEndpointTests.cs @@ -0,0 +1,78 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.EditMusicTrack; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.EditMusicTrack; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class EditMusicTrackViewEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly MusicTrackDtoFixture _musicTrackDtoFixture = new(); + private readonly MusicAlbumDtoFixture _musicAlbumDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public EditMusicTrackViewEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task EditMusicTrack_WhenCalledWithoutAuthentication_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient client = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await client.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/albums/{Guid.NewGuid()}/tracks/{Guid.NewGuid()}?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Equal("http://localhost/en-us/auth/login", response.Headers.Location!.ToString()); + } + + [Theory] + [InlineData("'; DROP TABLE Tracks; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task EditMusicTrack_WithSQLInjectionInRouteId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + MusicTrackDto expectedTrack = _musicTrackDtoFixture.Create(); + expectedTrack.Metadata!.Title = "A track"; + MusicAlbumDto expectedAlbum = _musicAlbumDtoFixture.Create(); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}/tracks/{normalizedId}", expectedTrack); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}", expectedAlbum); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + + // Act + HttpResponseMessage response = await webClient.Client.GetAsync($"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(maliciousId)}/albums/{Uri.EscapeDataString(maliciousId)}/tracks/{Uri.EscapeDataString(maliciousId)}?libraryId={libraryId}"); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint == $"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}/tracks/{normalizedId}"); + Assert.Contains(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint == $"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}"); + } +} 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 new file mode 100644 index 00000000..9949914d --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs @@ -0,0 +1,104 @@ +#region ========================================================================= USING ===================================================================================== +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.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetAlbumTracks; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetAlbumTracksEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly PaginatedMusicTrackLiteDtoFixture _paginatedMusicTrackLiteDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public GetAlbumTracksEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task GetAlbumTracks_WhenCalledWithoutAuthentication_ShouldRedirectToLoginWithoutCallingApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/albums/{Guid.NewGuid()}/tracks/api-get-tracks?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } + + [Theory] + [InlineData("'; DROP TABLE Tracks; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task GetAlbumTracks_WithSQLInjectionInArtistId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{normalizedId}/albums/{albumId}/tracks/lite", _paginatedMusicTrackLiteDtoFixture.Create()); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + + // Act + HttpResponseMessage response = await webClient.Client.GetAsync($"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(maliciousId)}/albums/{albumId}/tracks/api-get-tracks?libraryId={libraryId}"); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using (JsonDocument json = JsonDocument.Parse(content)) + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain(maliciousId, content, StringComparison.Ordinal); + Assert.Contains(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint == $"libraries/{libraryId}/artists/{normalizedId}/albums/{albumId}/tracks/lite"); + } + + [Theory] + [InlineData("'; DROP TABLE Tracks; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task GetAlbumTracks_WithSQLInjectionInAlbumId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{artistId}/albums/{normalizedId}/tracks/lite", _paginatedMusicTrackLiteDtoFixture.Create()); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + + // Act + HttpResponseMessage response = await webClient.Client.GetAsync($"/en-us/library/audio-library/music-library/artists/{artistId}/albums/{Uri.EscapeDataString(maliciousId)}/tracks/api-get-tracks?libraryId={libraryId}"); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using (JsonDocument json = JsonDocument.Parse(content)) + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain(maliciousId, content, StringComparison.Ordinal); + Assert.Contains(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint == $"libraries/{libraryId}/artists/{artistId}/albums/{normalizedId}/tracks/lite"); + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpointTests.cs new file mode 100644 index 00000000..71cd2b9b --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpointTests.cs @@ -0,0 +1,79 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetMusicTrack; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetMusicTrack; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetMusicTrackEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly MusicTrackDtoFixture _musicTrackDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public GetMusicTrackEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Fact] + public async Task GetMusicTrack_WhenCalledWithoutAuthentication_ShouldRedirectToLoginWithoutCallingApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + + // Act + HttpResponseMessage response = await anonymousClient.GetAsync($"/en-us/library/audio-library/music-library/artists/{Guid.NewGuid()}/albums/{Guid.NewGuid()}/tracks/{Guid.NewGuid()}/api-get-track?libraryId={Guid.NewGuid()}"); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.DoesNotContain(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint.StartsWith("libraries/", StringComparison.OrdinalIgnoreCase)); + } + + [Theory] + [InlineData("'; DROP TABLE Tracks; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task GetMusicTrack_WithSQLInjectionInRouteId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + MusicTrackDto expectedTrack = _musicTrackDtoFixture.Create(); + _apiFactory.ApiClientStub.RegisterGetResponse($"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}/tracks/{normalizedId}", expectedTrack); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + + // Act + HttpResponseMessage response = await webClient.Client.GetAsync($"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(maliciousId)}/albums/{Uri.EscapeDataString(maliciousId)}/tracks/{Uri.EscapeDataString(maliciousId)}/api-get-track?libraryId={libraryId}"); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + // The route values are normalized to Guids before they are substituted into the upstream URL, so a crafted route value can never escape + // its URL segment or reach a different track lookup; the Web layer must not fail local binding, leak stack traces or database details. + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + using (JsonDocument json = JsonDocument.Parse(content)) + Assert.True(json.RootElement.GetProperty("success").GetBoolean()); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain(maliciousId, content, StringComparison.Ordinal); + Assert.Contains(_apiFactory.ApiClientStub.GetEndpointsCalled, endpoint => endpoint == $"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}/tracks/{normalizedId}"); + } +} diff --git a/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpointTests.cs b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpointTests.cs new file mode 100644 index 00000000..2f7e8d4e --- /dev/null +++ b/tests/SecurityTests/Lumina.Presentation.Web.SecurityTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpointTests.cs @@ -0,0 +1,182 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.SaveMusicTrack; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Lumina.Presentation.Web.SecurityTests.Common.Setup; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Net.Http.Json; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.SaveMusicTrack; + +/// +/// Contains security tests for the class. +/// +[ExcludeFromCodeCoverage] +public class SaveMusicTrackEndpointTests : IClassFixture +{ + private readonly LuminaWebFactory _apiFactory; + private readonly UpdateMusicTrackRequestFixture _updateMusicTrackRequestFixture = new(); + private readonly MusicTrackDtoFixture _musicTrackDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Injected Web application factory. + public SaveMusicTrackEndpointTests(LuminaWebFactory apiFactory) + { + _apiFactory = apiFactory; + } + + [Theory] + [InlineData("'; DROP TABLE Tracks; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task SaveMusicTrack_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverCallAnotherTrack(string maliciousId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}/tracks/{normalizedId}", _musicTrackDtoFixture.Create()); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(maliciousId, maliciousId, maliciousId, libraryId.ToString(), _updateMusicTrackRequestFixture.Create()); + saveRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + // The route is authoritative and its values are normalized to Guids before they are substituted into the upstream URL, so a crafted + // route value can never escape its URL segment or redirect the update to another track, and the response must not leak stack traces + // or database details. + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("at Lumina", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{normalizedId}/albums/{normalizedId}/tracks/{normalizedId}"); + } + + [Theory] + [InlineData("'; DROP TABLE Tracks; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task SaveMusicTrack_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + string normalizedId = Guid.Empty.ToString(); + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{normalizedId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}", _musicTrackDtoFixture.Create()); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId.ToString(), albumId.ToString(), trackId.ToString(), maliciousLibraryId, _updateMusicTrackRequestFixture.Create()); + saveRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{normalizedId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}"); + } + + [Theory] + [InlineData("'; DROP TABLE Tracks; --")] // destructive injection + [InlineData("' OR '1'='1")] // boolean-based injection + public async Task SaveMusicTrack_WithSQLInjectionInPostedTitle_ShouldNotLeakOrExecuteIt(string maliciousTitle) + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + UpdateMusicTrackRequest request = _updateMusicTrackRequestFixture.Create(); + request.Metadata!.Title = maliciousTitle; + MusicTrackDto expectedTrack = _musicTrackDtoFixture.Create(id: trackId); + expectedTrack.Metadata!.Title = maliciousTitle; + _apiFactory.ApiClientStub.RegisterPutResponse($"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}", expectedTrack); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId.ToString(), albumId.ToString(), trackId.ToString(), libraryId.ToString(), request); + saveRequest.Headers.Add("RequestVerificationToken", webClient.AntiforgeryToken); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + string content = await response.Content.ReadAsStringAsync(); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("SqliteException", content, StringComparison.OrdinalIgnoreCase); + Assert.Contains(_apiFactory.ApiClientStub.PutRequests, putRequest => putRequest.Endpoint == $"libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}" && putRequest.Data is UpdateMusicTrackRequest forwarded && forwarded.Metadata!.Title == maliciousTitle); + } + + [Fact] + public async Task SaveMusicTrack_WhenCalledWithoutAntiforgeryToken_ShouldRejectRequestAndNotCallApi() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + Guid libraryId = Guid.NewGuid(); + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(artistId.ToString(), albumId.ToString(), trackId.ToString(), libraryId.ToString(), _updateMusicTrackRequestFixture.Create()); + + // Act + HttpResponseMessage response = await webClient.Client.SendAsync(saveRequest); + + // Assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + [Fact] + public async Task SaveMusicTrack_WhenCalledWithoutAuthentication_ShouldRedirectToLogin() + { + // Arrange + _apiFactory.ApiClientStub.Reset(); + HttpClient anonymousClient = WebTestHelpers.CreateAnonymousClient(_apiFactory); + HttpRequestMessage saveRequest = CreateSaveRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), _updateMusicTrackRequestFixture.Create()); + + // Act + HttpResponseMessage response = await anonymousClient.SendAsync(saveRequest); + + // Assert + Assert.Equal(HttpStatusCode.Redirect, response.StatusCode); + Assert.Empty(_apiFactory.ApiClientStub.PutRequests); + } + + /// + /// Builds the save request that PUTs the given to the track identified by the route, + /// with the owning library passed through the query string. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw route value of the track Id. + /// The raw query value of the library Id. + /// The track data to send. + /// The configured save request. + private static HttpRequestMessage CreateSaveRequest(string artistId, string albumId, string trackId, string libraryId, UpdateMusicTrackRequest request) + { + HttpRequestMessage saveRequest = new(HttpMethod.Put, $"/en-us/library/audio-library/music-library/artists/{Uri.EscapeDataString(artistId)}/albums/{Uri.EscapeDataString(albumId)}/tracks/{Uri.EscapeDataString(trackId)}/api-save-track?libraryId={Uri.EscapeDataString(libraryId)}") + { + Content = JsonContent.Create(request) + }; + saveRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + saveRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + return saveRequest; + } +} diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpointTests.cs new file mode 100644 index 00000000..6ac3d861 --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/DeleteMusicAlbum/DeleteMusicAlbumEndpointTests.cs @@ -0,0 +1,145 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.DeleteMusicAlbum; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.DeleteMusicAlbum; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class DeleteMusicAlbumEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly DeleteMusicAlbumEndpoint _sut; + + /// + /// Initializes a new instance of the class. + /// + public DeleteMusicAlbumEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalled_ShouldDeleteAlbumViaApiAndReturnSuccessWithoutData() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid libraryId = Guid.NewGuid(); + ConfigureRequest(artistId.ToString(), albumId.ToString(), libraryId); + + // Act + IResult result = await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + await _mockApiHttpClient.Received(1).DeleteAsync( + BuildExpectedEndpoint(libraryId, artistId, albumId), + Arg.Any()); + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.False(jsonDocument.RootElement.TryGetProperty("data", out JsonElement _)); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteIdsAreNotParseable_ShouldForwardGuidEmptyIdsToApi() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + ConfigureRequest("not-a-guid", "not-a-guid", libraryId); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).DeleteAsync( + BuildExpectedEndpoint(libraryId, Guid.Empty, Guid.Empty), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteIdsAreMissing_ShouldForwardGuidEmptyIdsToApi() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={libraryId}"); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).DeleteAsync( + BuildExpectedEndpoint(libraryId, Guid.Empty, Guid.Empty), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenLibraryQueryIdIsNotParseable_ShouldForwardGuidEmptyLibraryIdToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + ConfigureRequest(artistId.ToString(), albumId.ToString(), "not-a-guid"); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).DeleteAsync( + BuildExpectedEndpoint(Guid.Empty, artistId, albumId), + Arg.Any()); + } + + /// + /// Sets the route and query values the endpoint reads the album identities from. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw query value of the library Id. + private void ConfigureRequest(string artistId, string albumId, Guid libraryId) + { + ConfigureRequest(artistId, albumId, libraryId.ToString()); + } + + /// + /// Sets the route and query values the endpoint reads the album identities from. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw query value of the library Id. + private void ConfigureRequest(string artistId, string albumId, string libraryId) + { + _sut.HttpContext.Request.RouteValues["artistId"] = artistId; + _sut.HttpContext.Request.RouteValues["albumId"] = albumId; + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={libraryId}"); + } + + /// + /// Builds the upstream endpoint the album deletion is expected to be sent to. + /// + /// The normalized Id of the media library. + /// The normalized Id of the artist. + /// The normalized Id of the album. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(Guid libraryId, Guid artistId, Guid albumId) + { + return ApiRoutes.Music.DELETE_ALBUM + .Replace("{libraryId}", libraryId.ToString()) + .Replace("{artistId}", artistId.ToString()) + .Replace("{albumId}", albumId.ToString()); + } +} 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 new file mode 100644 index 00000000..6fe7bda2 --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetArtistAlbums/GetArtistAlbumsEndpointTests.cs @@ -0,0 +1,166 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.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.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetArtistAlbums; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetArtistAlbumsEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly GetArtistAlbumsEndpoint _sut; + private readonly GetArtistAlbumsLiteRequestFixture _getArtistAlbumsLiteRequestFixture = new(); + private readonly PaginatedMusicAlbumLiteDtoFixture _paginatedMusicAlbumLiteDtoFixture = new(); + private readonly MusicAlbumLiteDtoFixture _musicAlbumLiteDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + public GetArtistAlbumsEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalledWithPagination_ShouldRequestAlbumsWithQueryParameters() + { + // Arrange + GetArtistAlbumsLiteRequest request = _getArtistAlbumsLiteRequestFixture.Create(currentPage: 2, perPage: 48); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicAlbumLiteDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId))}?currentPage=2&perPage=48"), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenCalledWithoutPagination_ShouldRequestAlbumsWithoutQueryParameters() + { + // Arrange + GetArtistAlbumsLiteRequest request = _getArtistAlbumsLiteRequestFixture.Create(); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicAlbumLiteDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId))), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenOnlyCurrentPageIsProvided_ShouldAppendOnlyCurrentPage() + { + // Arrange + GetArtistAlbumsLiteRequest request = _getArtistAlbumsLiteRequestFixture.Create(currentPage: 3); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicAlbumLiteDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId))}?currentPage=3"), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenOnlyPerPageIsProvided_ShouldAppendOnlyPerPage() + { + // Arrange + GetArtistAlbumsLiteRequest request = _getArtistAlbumsLiteRequestFixture.Create(perPage: 24); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicAlbumLiteDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId))}?perPage=24"), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenArtistIdIsNotParseable_ShouldForwardGuidEmptyArtistIdToApi() + { + // Arrange + GetArtistAlbumsLiteRequest request = _getArtistAlbumsLiteRequestFixture.Create(artistId: "not-a-guid", currentPage: 1, perPage: 20); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicAlbumLiteDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Empty)}?currentPage=1&perPage=20"), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenApiReturnsPaginatedAlbums_ShouldReturnSuccessJsonWithAlbums() + { + // Arrange + GetArtistAlbumsLiteRequest request = _getArtistAlbumsLiteRequestFixture.Create(); + PaginatedMusicAlbumLiteDto expectedResponse = _paginatedMusicAlbumLiteDtoFixture.Create( + data: [_musicAlbumLiteDtoFixture.Create(title: "Test Album")], + currentPage: 1, + perPage: 20, + count: 1, + numberOfPages: 1); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(expectedResponse); + + // Act + IResult result = await _sut.ExecuteAsync(request, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + JsonElement data = jsonDocument.RootElement.GetProperty("data"); + Assert.Equal(1, data.GetProperty("currentPage").GetInt32()); + Assert.Equal(1, data.GetProperty("data").GetArrayLength()); + } + + /// + /// Builds the upstream endpoint the artist album retrieval is expected to be sent to, without query parameters. + /// + /// The Id of the media library. + /// The normalized Id of the artist. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(Guid libraryId, Guid artistId) + { + return ApiRoutes.Music.GET_ARTIST_ALBUMS_LITE + .Replace("{libraryId}", libraryId.ToString()) + .Replace("{artistId}", artistId.ToString()); + } +} diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpointTests.cs new file mode 100644 index 00000000..a556f6f2 --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetMusicAlbum/GetMusicAlbumEndpointTests.cs @@ -0,0 +1,127 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetMusicAlbum; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.GetMusicAlbum; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetMusicAlbumEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly GetMusicAlbumEndpoint _sut; + private readonly GetMusicAlbumViewRequestFixture _getMusicAlbumViewRequestFixture = new(); + private readonly MusicAlbumDtoFixture _musicAlbumDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + public GetMusicAlbumEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalled_ShouldRequestAlbumFromApiWithNormalizedIds() + { + // Arrange + GetMusicAlbumViewRequest request = _getMusicAlbumViewRequestFixture.Create(); + MusicAlbumDto expectedAlbum = _musicAlbumDtoFixture.Create(); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(expectedAlbum); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId), Guid.Parse(request.AlbumId))), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteIdsAreNotParseable_ShouldForwardGuidEmptyIdsToApi() + { + // Arrange + GetMusicAlbumViewRequest request = _getMusicAlbumViewRequestFixture.Create(artistId: "not-a-guid", albumId: "' OR '1'='1"); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_musicAlbumDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Empty, Guid.Empty)), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteIdsAreEmpty_ShouldForwardGuidEmptyIdsToApi() + { + // Arrange + GetMusicAlbumViewRequest request = _getMusicAlbumViewRequestFixture.Create(artistId: string.Empty, albumId: string.Empty); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_musicAlbumDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Empty, Guid.Empty)), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenApiReturnsAlbum_ShouldReturnSuccessJsonWithAlbum() + { + // Arrange + GetMusicAlbumViewRequest request = _getMusicAlbumViewRequestFixture.Create(); + MusicAlbumDto expectedAlbum = _musicAlbumDtoFixture.Create(); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(expectedAlbum); + + // Act + IResult result = await _sut.ExecuteAsync(request, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(expectedAlbum.Id, jsonDocument.RootElement.GetProperty("data").GetProperty("id").GetGuid()); + } + + /// + /// Builds the upstream endpoint the album retrieval is expected to be sent to. + /// + /// The normalized Id of the media library. + /// The normalized Id of the artist. + /// The normalized Id of the album. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(Guid libraryId, Guid artistId, Guid albumId) + { + return ApiRoutes.Music.GET_ALBUM + .Replace("{libraryId}", libraryId.ToString()) + .Replace("{artistId}", artistId.ToString()) + .Replace("{albumId}", albumId.ToString()); + } +} diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpointTests.cs new file mode 100644 index 00000000..9495be24 --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/SaveMusicAlbum/SaveMusicAlbumEndpointTests.cs @@ -0,0 +1,212 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.SaveMusicAlbum; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Albums; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.SaveMusicAlbum; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class SaveMusicAlbumEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly SaveMusicAlbumEndpoint _sut; + private readonly UpdateMusicAlbumRequestFixture _updateMusicAlbumRequestFixture = new(); + private readonly MusicAlbumDtoFixture _musicAlbumDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + public SaveMusicAlbumEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalled_ShouldForwardUpdateMusicAlbumRequestToApiWithRouteAndQueryIds() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid libraryId = Guid.NewGuid(); + UpdateMusicAlbumRequest request = _updateMusicAlbumRequestFixture.Create(); + MusicAlbumDto expectedAlbum = _musicAlbumDtoFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(expectedAlbum); + ConfigureRequest(artistId.ToString(), albumId.ToString(), libraryId); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(libraryId, artistId, albumId)), + Arg.Is(forwardedRequest => forwardedRequest == request), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenArtistRouteIdIsNotParseable_ShouldForwardGuidEmptyArtistIdToApi() + { + // Arrange + const string MALICIOUS_ARTIST_ID = "not-a-guid"; + Guid albumId = Guid.NewGuid(); + Guid libraryId = Guid.NewGuid(); + UpdateMusicAlbumRequest request = _updateMusicAlbumRequestFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_musicAlbumDtoFixture.Create()); + ConfigureRequest(MALICIOUS_ARTIST_ID, albumId.ToString(), libraryId); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(libraryId, Guid.Empty, albumId)), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenAlbumRouteIdIsNotParseable_ShouldForwardGuidEmptyAlbumIdToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + const string MALICIOUS_ALBUM_ID = "' OR '1'='1"; + Guid libraryId = Guid.NewGuid(); + UpdateMusicAlbumRequest request = _updateMusicAlbumRequestFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_musicAlbumDtoFixture.Create()); + ConfigureRequest(artistId.ToString(), MALICIOUS_ALBUM_ID, libraryId); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(libraryId, artistId, Guid.Empty)), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteIdsAreMissing_ShouldForwardGuidEmptyIdsToApi() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + UpdateMusicAlbumRequest request = _updateMusicAlbumRequestFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_musicAlbumDtoFixture.Create()); + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={libraryId}"); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(libraryId, Guid.Empty, Guid.Empty)), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenLibraryQueryIdIsNotParseable_ShouldForwardGuidEmptyLibraryIdToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + const string MALICIOUS_LIBRARY_ID = "not-a-guid"; + UpdateMusicAlbumRequest request = _updateMusicAlbumRequestFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_musicAlbumDtoFixture.Create()); + ConfigureRequest(artistId.ToString(), albumId.ToString(), MALICIOUS_LIBRARY_ID); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(Guid.Empty, artistId, albumId)), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenApiReturnsUpdatedAlbum_ShouldReturnSuccessJsonWithAlbum() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid libraryId = Guid.NewGuid(); + UpdateMusicAlbumRequest request = _updateMusicAlbumRequestFixture.Create(); + MusicAlbumDto expectedAlbum = _musicAlbumDtoFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(expectedAlbum); + ConfigureRequest(artistId.ToString(), albumId.ToString(), libraryId); + + // Act + IResult result = await _sut.ExecuteAsync(request, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(expectedAlbum.Id, jsonDocument.RootElement.GetProperty("data").GetProperty("id").GetGuid()); + } + + /// + /// Sets the route and query values the endpoint reads the album identities from. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw query value of the library Id. + private void ConfigureRequest(string artistId, string albumId, Guid libraryId) + { + ConfigureRequest(artistId, albumId, libraryId.ToString()); + } + + /// + /// Sets the route and query values the endpoint reads the album identities from. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw query value of the library Id. + private void ConfigureRequest(string artistId, string albumId, string libraryId) + { + _sut.HttpContext.Request.RouteValues["artistId"] = artistId; + _sut.HttpContext.Request.RouteValues["albumId"] = albumId; + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={libraryId}"); + } + + /// + /// Builds the upstream endpoint the album update is expected to be sent to. + /// + /// The normalized Id of the media library. + /// The normalized Id of the artist. + /// The normalized Id of the album. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(Guid libraryId, Guid artistId, Guid albumId) + { + return ApiRoutes.Music.UPDATE_ALBUM + .Replace("{libraryId}", libraryId.ToString()) + .Replace("{artistId}", artistId.ToString()) + .Replace("{albumId}", albumId.ToString()); + } +} diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpointTests.cs new file mode 100644 index 00000000..89ccaad1 --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/UpdateAlbumCover/UpdateAlbumCoverEndpointTests.cs @@ -0,0 +1,313 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.UpdateAlbumCover; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Albums.UpdateAlbumCover; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class UpdateAlbumCoverEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly UpdateAlbumCoverEndpoint _sut; + private readonly UpdateMusicCoverDtoFixture _updateMusicCoverDtoFixture = new(); + private static readonly Guid s_libraryId = Guid.NewGuid(); + + /// + /// Initializes a new instance of the class. + /// + public UpdateAlbumCoverEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalledWithFile_ShouldUploadCoverToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: "/media/albums/cover.jpg")); + ConfigureRequest(artistId, albumId, [1, 2, 3], "cover.jpg"); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(s_libraryId.ToString(), artistId, albumId)), + Arg.Any(), + Arg.Is(fileName => fileName == "cover.jpg"), + Arg.Is(fieldName => fieldName == "cover"), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteIdsAreNotParseable_ShouldUploadCoverWithEmptyIds() + { + // Arrange + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: "/media/albums/cover.jpg")); + ConfigureRequest("not-a-guid", "not-a-guid", [1, 2, 3], "cover.jpg"); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(s_libraryId.ToString(), Guid.Empty, Guid.Empty)), + Arg.Any(), + Arg.Any(), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenLibraryQueryIdIsNotParseable_ShouldUploadCoverWithEmptyLibraryId() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: "/media/albums/cover.jpg")); + ConfigureRequest(artistId, albumId, [1, 2, 3], "cover.jpg"); + // The query value is normalized to a Guid before it is substituted into the upstream URL, so a crafted value can never escape its segment. + _sut.HttpContext.Request.QueryString = new QueryString("?libraryId=not-a-library-guid"); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(Guid.Empty.ToString(), artistId, albumId)), + Arg.Any(), + Arg.Any(), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenLibraryQueryIdIsMissing_ShouldUploadCoverWithEmptyLibraryId() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: "/media/albums/cover.jpg")); + ConfigureRequest(artistId, albumId, [1, 2, 3], "cover.jpg"); + _sut.HttpContext.Request.QueryString = new QueryString(string.Empty); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(Guid.Empty.ToString(), artistId, albumId)), + Arg.Any(), + Arg.Any(), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenApiReturnsCoverPath_ShouldReturnSuccessJsonWithPath() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + const string EXPECTED_PATH = "/media/albums/cover.jpg"; + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: EXPECTED_PATH)); + ConfigureRequest(artistId, albumId, [1, 2, 3], "cover.jpg"); + + // Act + IResult result = await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(EXPECTED_PATH, jsonDocument.RootElement.GetProperty("data").GetString()); + } + + [Fact] + public async Task ExecuteAsync_WhenFormHasNoFile_ShouldForwardRequestWithoutFileToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + const string EXPECTED_PATH = "/media/albums/cover.jpg"; + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: EXPECTED_PATH)); + ConfigureRequestWithoutFiles(artistId, albumId); + + // Act + IResult result = await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(s_libraryId.ToString(), artistId, albumId)), + Arg.Is(stream => stream == null), + Arg.Is(fileName => fileName == null), + Arg.Is(fieldName => fieldName == "cover"), + Arg.Any()); + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(EXPECTED_PATH, jsonDocument.RootElement.GetProperty("data").GetString()); + } + + [Fact] + public async Task ExecuteAsync_WhenRequestIsNotMultipart_ShouldForwardRequestWithoutFileToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + const string EXPECTED_PATH = "/media/albums/cover.jpg"; + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: EXPECTED_PATH)); + _sut.HttpContext.Request.RouteValues["artistId"] = artistId.ToString(); + _sut.HttpContext.Request.RouteValues["albumId"] = albumId.ToString(); + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={s_libraryId}"); + _sut.HttpContext.Request.ContentType = "application/json"; + + // Act + IResult result = await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(s_libraryId.ToString(), artistId, albumId)), + Arg.Is(stream => stream == null), + Arg.Is(fileName => fileName == null), + Arg.Is(fieldName => fieldName == "cover"), + Arg.Any()); + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(EXPECTED_PATH, jsonDocument.RootElement.GetProperty("data").GetString()); + } + + [Fact] + public async Task ExecuteAsync_WhenFormIsMalformed_ShouldForwardRequestWithoutFileToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + const string EXPECTED_PATH = "/media/albums/cover.jpg"; + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: EXPECTED_PATH)); + ConfigureMalformedRequest(artistId, albumId); + + // Act + IResult result = await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(s_libraryId.ToString(), artistId, albumId)), + Arg.Is(stream => stream == null), + Arg.Is(fileName => fileName == null), + Arg.Is(fieldName => fieldName == "cover"), + Arg.Any()); + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(EXPECTED_PATH, jsonDocument.RootElement.GetProperty("data").GetString()); + } + + /// + /// Configures a multipart form request carrying a single file. + /// + /// The route Id of the artist. + /// The route Id of the album whose cover is uploaded. + /// The bytes of the uploaded file. + /// The name of the uploaded file. + private void ConfigureRequest(Guid artistId, Guid albumId, byte[] content, string fileName) + { + ConfigureRequest(artistId.ToString(), albumId.ToString(), content, fileName); + } + + /// + /// Configures a multipart form request carrying a single file. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The bytes of the uploaded file. + /// The name of the uploaded file. + private void ConfigureRequest(string artistId, string albumId, byte[] content, string fileName) + { + _sut.HttpContext.Request.RouteValues["artistId"] = artistId; + _sut.HttpContext.Request.RouteValues["albumId"] = albumId; + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={s_libraryId}"); + MemoryStream coverStream = new(content); + IFormFile formFile = new FormFile(coverStream, 0, content.Length, "cover", fileName); + FormFileCollection files = [formFile]; + IFormCollection form = new FormCollection([], files); + _sut.HttpContext.Request.ContentType = "multipart/form-data; boundary=----test"; + _sut.HttpContext.Features.Set(new FormFeature(form)); + } + + /// + /// Configures a multipart form request without any file. + /// + /// The route Id of the artist. + /// The route Id of the album whose cover is uploaded. + private void ConfigureRequestWithoutFiles(Guid artistId, Guid albumId) + { + _sut.HttpContext.Request.RouteValues["artistId"] = artistId.ToString(); + _sut.HttpContext.Request.RouteValues["albumId"] = albumId.ToString(); + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={s_libraryId}"); + IFormCollection form = new FormCollection([]); + _sut.HttpContext.Request.ContentType = "multipart/form-data; boundary=----test"; + _sut.HttpContext.Features.Set(new FormFeature(form)); + } + + /// + /// Configures a multipart form request whose body cannot be parsed. + /// + /// The route Id of the artist. + /// The route Id of the album whose cover is uploaded. + private void ConfigureMalformedRequest(Guid artistId, Guid albumId) + { + _sut.HttpContext.Request.RouteValues["artistId"] = artistId.ToString(); + _sut.HttpContext.Request.RouteValues["albumId"] = albumId.ToString(); + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={s_libraryId}"); + _sut.HttpContext.Request.ContentType = "multipart/form-data; boundary=----test"; + IFormCollection malformedForm = Substitute.For(); + malformedForm.Files.Returns(_ => throw new InvalidDataException("Malformed multipart body.")); + _sut.HttpContext.Features.Set(new FormFeature(malformedForm)); + } + + /// + /// Builds the upstream endpoint the cover upload is expected to be sent to. + /// + /// The raw Id of the media library. + /// The normalized Id of the artist. + /// The normalized Id of the album. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(string libraryId, Guid artistId, Guid albumId) + { + return ApiRoutes.Music.UPDATE_ALBUM_COVER + .Replace("{libraryId}", libraryId) + .Replace("{artistId}", artistId.ToString()) + .Replace("{albumId}", albumId.ToString()); + } +} diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpointTests.cs new file mode 100644 index 00000000..ceb3550e --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/DeleteMusicArtist/DeleteMusicArtistEndpointTests.cs @@ -0,0 +1,128 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.DeleteMusicArtist; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.DeleteMusicArtist; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class DeleteMusicArtistEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly DeleteMusicArtistEndpoint _sut; + + /// + /// Initializes a new instance of the class. + /// + public DeleteMusicArtistEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalled_ShouldDeleteArtistViaApiAndReturnSuccessWithoutData() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid libraryId = Guid.NewGuid(); + ConfigureRequest(artistId.ToString(), libraryId.ToString()); + + // Act + IResult result = await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + await _mockApiHttpClient.Received(1).DeleteAsync( + BuildExpectedEndpoint(libraryId, artistId), + Arg.Any()); + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.False(jsonDocument.RootElement.TryGetProperty("data", out JsonElement _)); + } + + [Fact] + public async Task ExecuteAsync_WhenArtistRouteIdIsNotParseable_ShouldForwardGuidEmptyArtistIdToApi() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + ConfigureRequest("not-a-guid", libraryId.ToString()); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).DeleteAsync( + BuildExpectedEndpoint(libraryId, Guid.Empty), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenArtistRouteIdIsMissing_ShouldForwardGuidEmptyArtistIdToApi() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={libraryId}"); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).DeleteAsync( + BuildExpectedEndpoint(libraryId, Guid.Empty), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenLibraryQueryIdIsNotParseable_ShouldForwardGuidEmptyLibraryIdToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + ConfigureRequest(artistId.ToString(), "not-a-guid"); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).DeleteAsync( + BuildExpectedEndpoint(Guid.Empty, artistId), + Arg.Any()); + } + + /// + /// Sets the route and query values the endpoint reads the artist identities from. + /// + /// The raw route value of the artist Id. + /// The raw query value of the library Id. + private void ConfigureRequest(string artistId, string libraryId) + { + _sut.HttpContext.Request.RouteValues["artistId"] = artistId; + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={libraryId}"); + } + + /// + /// Builds the upstream endpoint the artist deletion is expected to be sent to. + /// + /// The normalized Id of the media library. + /// The normalized Id of the artist. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(Guid libraryId, Guid artistId) + { + return ApiRoutes.Music.DELETE_ARTIST + .Replace("{libraryId}", libraryId.ToString()) + .Replace("{artistId}", artistId.ToString()); + } +} diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpointTests.cs new file mode 100644 index 00000000..cd74891a --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtist/GetMusicArtistEndpointTests.cs @@ -0,0 +1,143 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtist; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtist; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetMusicArtistEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly GetMusicArtistEndpoint _sut; + private readonly GetMusicArtistViewRequestFixture _getMusicArtistViewRequestFixture = new(); + private readonly MusicArtistDtoFixture _musicArtistDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + public GetMusicArtistEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalled_ShouldRequestArtistFromApiWithNormalizedIds() + { + // Arrange + GetMusicArtistViewRequest request = _getMusicArtistViewRequestFixture.Create(); + MusicArtistDto expectedArtist = _musicArtistDtoFixture.Create(); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(expectedArtist); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId))), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteArtistIdIsNotParseable_ShouldForwardGuidEmptyArtistIdToApi() + { + // Arrange + GetMusicArtistViewRequest request = _getMusicArtistViewRequestFixture.Create(artistId: "not-a-guid"); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_musicArtistDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Empty)), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteArtistIdIsMissing_ShouldForwardGuidEmptyArtistIdToApi() + { + // Arrange + GetMusicArtistViewRequest request = _getMusicArtistViewRequestFixture.Create(artistId: string.Empty); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_musicArtistDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Empty)), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenApiReturnsArtist_ShouldReturnSuccessJsonWithArtist() + { + // Arrange + GetMusicArtistViewRequest request = _getMusicArtistViewRequestFixture.Create(); + MusicArtistDto expectedArtist = _musicArtistDtoFixture.Create(); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(expectedArtist); + + // Act + IResult result = await _sut.ExecuteAsync(request, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(expectedArtist.Id, jsonDocument.RootElement.GetProperty("data").GetProperty("id").GetGuid()); + } + + [Fact] + public async Task ExecuteAsync_WhenCalled_ShouldForwardCancellationTokenToApi() + { + // Arrange + GetMusicArtistViewRequest request = _getMusicArtistViewRequestFixture.Create(); + using CancellationTokenSource cancellationTokenSource = new(); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_musicArtistDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, cancellationTokenSource.Token); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Any(), + Arg.Is(cancellationTokenSource.Token)); + } + + /// + /// Builds the upstream endpoint the artist retrieval is expected to be sent to. + /// + /// The Id of the media library the artist belongs to. + /// The normalized Id of the artist. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(Guid libraryId, Guid artistId) + { + return ApiRoutes.Music.GET_ARTIST + .Replace("{libraryId}", libraryId.ToString()) + .Replace("{artistId}", artistId.ToString()); + } +} 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 new file mode 100644 index 00000000..ec4f32dc --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetMusicArtists/GetMusicArtistsEndpointTests.cs @@ -0,0 +1,219 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +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.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.GetMusicArtists; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetMusicArtistsEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly GetMusicArtistsEndpoint _sut; + private readonly GetMusicArtistsLiteRequestFixture _getMusicArtistsLiteRequestFixture = new(); + private readonly PaginatedMusicArtistLiteDtoFixture _paginatedMusicArtistLiteDtoFixture = new(); + private readonly MusicArtistLiteDtoFixture _musicArtistLiteDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + public GetMusicArtistsEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalledWithAllParameters_ShouldBuildExactQueryString() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + const string SEARCH_TERM = " The Beatles "; + const string FILTER_ALPHA_KEY = "B"; + const string SORT_BY = "name asc"; + GetMusicArtistsLiteRequest request = _getMusicArtistsLiteRequestFixture.Create( + libraryId: libraryId, + currentPage: 2, + perPage: 48, + searchTerm: SEARCH_TERM, + filterAlphaKey: FILTER_ALPHA_KEY, + shouldIgnoreThePrefixForAlphaPicker: true, + sortBy: SORT_BY, + sortOrder: SortOrder.Descending); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicArtistLiteDtoFixture.Create()); + string expectedEndpoint = $"{BuildExpectedEndpoint(libraryId)}?currentPage=2&perPage=48" + + $"&searchTerm={Uri.EscapeDataString(SEARCH_TERM)}" + + $"&filterAlphaKey={Uri.EscapeDataString(FILTER_ALPHA_KEY)}" + + "&shouldIgnoreThePrefixForAlphaPicker=True" + + $"&sortBy={Uri.EscapeDataString(SORT_BY)}" + + "&sortOrder=Descending"; + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == expectedEndpoint), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenOptionalParametersAreOmitted_ShouldAppendOnlyTheIgnorePrefixFlag() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + GetMusicArtistsLiteRequest request = _getMusicArtistsLiteRequestFixture.Create( + libraryId: libraryId, + includeCurrentPage: false, + includePerPage: false, + includeSearchTerm: false, + includeFilterAlphaKey: false, + includeSortBy: false, + includeSortOrder: false); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicArtistLiteDtoFixture.Create()); + string expectedEndpoint = $"{BuildExpectedEndpoint(libraryId)}?shouldIgnoreThePrefixForAlphaPicker=False"; + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == expectedEndpoint), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenSearchTermHasSpecialCharacters_ShouldEscapeIt() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + const string SEARCH_TERM = "rock & roll"; + GetMusicArtistsLiteRequest request = _getMusicArtistsLiteRequestFixture.Create( + libraryId: libraryId, + searchTerm: SEARCH_TERM, + includeCurrentPage: false, + includePerPage: false, + includeFilterAlphaKey: false, + includeSortBy: false, + includeSortOrder: false); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicArtistLiteDtoFixture.Create()); + string expectedEndpoint = $"{BuildExpectedEndpoint(libraryId)}?searchTerm={Uri.EscapeDataString(SEARCH_TERM)}&shouldIgnoreThePrefixForAlphaPicker=False"; + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == expectedEndpoint), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenSearchTermAndAlphaKeyAndSortByAreWhitespace_ShouldOmitThem() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + GetMusicArtistsLiteRequest request = _getMusicArtistsLiteRequestFixture.Create( + libraryId: libraryId, + searchTerm: " ", + filterAlphaKey: " ", + sortBy: string.Empty, + includeCurrentPage: false, + includePerPage: false, + includeSortOrder: false); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicArtistLiteDtoFixture.Create()); + string expectedEndpoint = $"{BuildExpectedEndpoint(libraryId)}?shouldIgnoreThePrefixForAlphaPicker=False"; + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == expectedEndpoint), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenOnlyCurrentPageIsProvided_ShouldAppendOnlyCurrentPageAndTheIgnorePrefixFlag() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + GetMusicArtistsLiteRequest request = _getMusicArtistsLiteRequestFixture.Create( + libraryId: libraryId, + currentPage: 3, + includePerPage: false, + includeSearchTerm: false, + includeFilterAlphaKey: false, + includeSortBy: false, + includeSortOrder: false); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicArtistLiteDtoFixture.Create()); + string expectedEndpoint = $"{BuildExpectedEndpoint(libraryId)}?currentPage=3&shouldIgnoreThePrefixForAlphaPicker=False"; + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == expectedEndpoint), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenApiReturnsPaginatedArtists_ShouldReturnSuccessJsonWithArtists() + { + // Arrange + GetMusicArtistsLiteRequest request = _getMusicArtistsLiteRequestFixture.Create(); + PaginatedMusicArtistLiteDto expectedResponse = _paginatedMusicArtistLiteDtoFixture.Create( + data: [_musicArtistLiteDtoFixture.Create(name: "Test Artist")], + currentPage: 1, + perPage: 20, + count: 1, + numberOfPages: 1); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(expectedResponse); + + // Act + IResult result = await _sut.ExecuteAsync(request, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + JsonElement data = jsonDocument.RootElement.GetProperty("data"); + Assert.Equal(1, data.GetProperty("currentPage").GetInt32()); + Assert.Equal(1, data.GetProperty("data").GetArrayLength()); + } + + /// + /// Builds the upstream endpoint the artist retrieval is expected to be sent to, without query parameters. + /// + /// The Id of the media library whose artists are retrieved. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(Guid libraryId) + { + return ApiRoutes.Music.GET_ARTISTS_LITE.Replace("{libraryId}", libraryId.ToString()); + } +} diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpointTests.cs new file mode 100644 index 00000000..9dc17eff --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/Index/MusicArtistsIndexViewEndpointTests.cs @@ -0,0 +1,146 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.Libraries; +using Lumina.Presentation.Web.Common.DTO.Themes; +using Lumina.Presentation.Web.Common.Http; +using Lumina.Presentation.Web.Common.Primitives; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Common.Services; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.Index; +using Lumina.Presentation.Web.Core.Themes; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Libraries; +using Lumina.Presentation.Web.Fixtures.Common.DTO.Themes; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Antiforgery; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.HttpResults; +using Microsoft.Extensions.Localization; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.Index; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class MusicArtistsIndexViewEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly IUrlService _mockUrlService; + private readonly ThemePageRenderer _mockThemePageRenderer; + private readonly IAntiforgery _mockAntiforgery; + private readonly IStringLocalizerFactory _mockStringLocalizerFactory; + private readonly IStringLocalizer _mockStringLocalizer; + private readonly MusicArtistsIndexViewEndpoint _sut; + private readonly LibraryDtoFixture _libraryDtoFixture = new(); + private readonly GetMusicArtistsViewRequestFixture _getMusicArtistsViewRequestFixture = new(); + private readonly ThemePageRenderResultDtoFixture _themePageRenderResultDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + public MusicArtistsIndexViewEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _mockUrlService = Substitute.For(); + _mockThemePageRenderer = Substitute.For(new ThemeService(_mockApiHttpClient), new ThemeTemplateEngine()); + _mockAntiforgery = Substitute.For(); + _mockAntiforgery.GetAndStoreTokens(Arg.Any()) + .Returns(new AntiforgeryTokenSet("request-token", "cookie-token", "__RequestVerificationToken", "RequestVerificationToken")); + _mockStringLocalizer = Substitute.For(); + _mockStringLocalizer.GetAllStrings(Arg.Any()).Returns(new LocalizedString[] { new("Search", "Search") }); + _mockStringLocalizerFactory = Substitute.For(); + _mockStringLocalizerFactory.Create(Arg.Any(), Arg.Any()).Returns(_mockStringLocalizer); + _sut = Factory.Create(_mockApiHttpClient, _mockUrlService, _mockThemePageRenderer, _mockAntiforgery, _mockStringLocalizerFactory); + TestHttpContextFactory.ConfigureSession(_sut.HttpContext, TestHttpContextFactory.CreateSession()); + _sut.HttpContext.Request.Path = "/en-us/library/audio-library/music-library/artists"; + } + + [Fact] + public async Task ExecuteAsync_WhenLibraryIdIsNull_ShouldRedirectToHome() + { + // Arrange + _mockUrlService.GetAbsoluteUrl(WebRoutes.Home.INDEX_CULTURED).Returns("http://localhost/en-us"); + + // Act + IResult result = await _sut.ExecuteAsync(_getMusicArtistsViewRequestFixture.Create(libraryId: null), CancellationToken.None); + + // Assert + RedirectHttpResult redirectResult = Assert.IsType(result); + Assert.Equal("http://localhost/en-us", redirectResult.Url); + await _mockApiHttpClient.DidNotReceive().GetAsync(Arg.Any(), Arg.Any()); + await _mockThemePageRenderer.DidNotReceive().RenderAsync(Arg.Any(), Arg.Any(), Arg.Any()); + _mockAntiforgery.DidNotReceive().GetAndStoreTokens(Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenLibraryIdProvided_ShouldRenderThemedPageThroughTheSharedView() + { + // Arrange + LibraryDto expectedLibrary = _libraryDtoFixture.Create(); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(expectedLibrary); + _mockUrlService.GetAbsoluteUrl(WebRoutes.Music.GET_ARTISTS).Returns("http://localhost/en-us/library/audio-library/music-library/artists/api-get-artists"); + _mockUrlService.GetAbsoluteUrl(WebRoutes.Settings.GET_USER_SETTINGS).Returns("http://localhost/en-us/tools/settings/api-get-user-settings"); + _mockUrlService.GetAbsoluteUrl(WebRoutes.Music.ARTIST, Arg.Any()).Returns("http://localhost/en-us/library/audio-library/music-library/artists/00000000-0000-0000-0000-000000000000"); + _mockUrlService.GetAbsoluteUrl(WebRoutes.Music.DELETE_ARTIST, Arg.Any()).Returns("http://localhost/en-us/library/audio-library/music-library/artists/00000000-0000-0000-0000-000000000000/api-delete-artist"); + _mockThemePageRenderer.RenderAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(Result.From(_themePageRenderResultDtoFixture.Create(content: "
content
", script: ""))); + + // Act + IResult result = await _sut.ExecuteAsync(_getMusicArtistsViewRequestFixture.Create(libraryId: expectedLibrary.Id), CancellationToken.None); + + // Assert + Assert.IsType(result); + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == ApiRoutes.Libraries.GET_LIBRARY_BY_ID.Replace("{id}", expectedLibrary.Id.ToString())), + Arg.Any()); + await _mockThemePageRenderer.Received(1).RenderAsync( + Arg.Is(page => + page.PageKey == "library/audio-library/music-library/artists/index" && + page.Title == expectedLibrary.Title && + page.PageData.ContainsKey("libraryId") && + page.PageData.ContainsKey("settingsUrl") && + page.PageData.ContainsKey("strings") && + string.Equals( + page.PageData["itemsUrl"] as string, + "http://localhost/en-us/library/audio-library/music-library/artists/api-get-artists", + StringComparison.Ordinal) && + string.Equals( + page.PageData["artistUrl"] as string, + "http://localhost/en-us/library/audio-library/music-library/artists/00000000-0000-0000-0000-000000000000", + StringComparison.Ordinal) && + string.Equals( + page.PageData["deleteUrl"] as string, + "http://localhost/en-us/library/audio-library/music-library/artists/00000000-0000-0000-0000-000000000000/api-delete-artist", + StringComparison.Ordinal)), + Arg.Is(requestedThemeId => requestedThemeId == null), + Arg.Any()); + _mockAntiforgery.Received(1).GetAndStoreTokens(Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenThemeRenderingFails_ShouldFallBackToRazorView() + { + // Arrange + LibraryDto expectedLibrary = _libraryDtoFixture.Create(); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(expectedLibrary); + _mockThemePageRenderer.RenderAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(Result.Failure(Error.Failure("Theme.Render", "The page could not be rendered."))); + + // Act + IResult result = await _sut.ExecuteAsync(_getMusicArtistsViewRequestFixture.Create(libraryId: expectedLibrary.Id), CancellationToken.None); + + // Assert + Assert.IsType(result); + await _mockThemePageRenderer.Received(1).RenderAsync(Arg.Any(), Arg.Any(), Arg.Any()); + } +} diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpointTests.cs new file mode 100644 index 00000000..4ce780f2 --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/SaveMusicArtist/SaveMusicArtistEndpointTests.cs @@ -0,0 +1,181 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.SaveMusicArtist; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Artists; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.SaveMusicArtist; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class SaveMusicArtistEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly SaveMusicArtistEndpoint _sut; + private readonly UpdateMusicArtistRequestFixture _updateMusicArtistRequestFixture = new(); + private readonly MusicArtistDtoFixture _musicArtistDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + public SaveMusicArtistEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalled_ShouldForwardUpdateMusicArtistRequestToApiWithRouteAndQueryIds() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid libraryId = Guid.NewGuid(); + UpdateMusicArtistRequest request = _updateMusicArtistRequestFixture.Create(); + MusicArtistDto expectedArtist = _musicArtistDtoFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(expectedArtist); + ConfigureRequest(artistId.ToString(), libraryId); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(libraryId, artistId)), + Arg.Is(forwardedRequest => forwardedRequest == request), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenArtistRouteIdIsNotParseable_ShouldForwardGuidEmptyArtistIdToApi() + { + // Arrange + const string MALICIOUS_ARTIST_ID = "not-a-guid"; + Guid libraryId = Guid.NewGuid(); + UpdateMusicArtistRequest request = _updateMusicArtistRequestFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_musicArtistDtoFixture.Create()); + ConfigureRequest(MALICIOUS_ARTIST_ID, libraryId); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(libraryId, Guid.Empty)), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenArtistRouteIdIsMissing_ShouldForwardGuidEmptyArtistIdToApi() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + UpdateMusicArtistRequest request = _updateMusicArtistRequestFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_musicArtistDtoFixture.Create()); + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={libraryId}"); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(libraryId, Guid.Empty)), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenLibraryQueryIdIsNotParseable_ShouldForwardGuidEmptyLibraryIdToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + const string MALICIOUS_LIBRARY_ID = "not-a-guid"; + UpdateMusicArtistRequest request = _updateMusicArtistRequestFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_musicArtistDtoFixture.Create()); + ConfigureRequest(artistId.ToString(), MALICIOUS_LIBRARY_ID); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(Guid.Empty, artistId)), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenApiReturnsUpdatedArtist_ShouldReturnSuccessJsonWithArtist() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid libraryId = Guid.NewGuid(); + UpdateMusicArtistRequest request = _updateMusicArtistRequestFixture.Create(); + MusicArtistDto expectedArtist = _musicArtistDtoFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(expectedArtist); + ConfigureRequest(artistId.ToString(), libraryId); + + // Act + IResult result = await _sut.ExecuteAsync(request, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(expectedArtist.Id, jsonDocument.RootElement.GetProperty("data").GetProperty("id").GetGuid()); + } + + /// + /// Sets the route and query values the endpoint reads the artist identities from. + /// + /// The raw route value of the artist Id. + /// The raw query value of the library Id. + private void ConfigureRequest(string artistId, Guid libraryId) + { + ConfigureRequest(artistId, libraryId.ToString()); + } + + /// + /// Sets the route and query values the endpoint reads the artist identities from. + /// + /// The raw route value of the artist Id. + /// The raw query value of the library Id. + private void ConfigureRequest(string artistId, string libraryId) + { + _sut.HttpContext.Request.RouteValues["artistId"] = artistId; + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={libraryId}"); + } + + /// + /// Builds the upstream endpoint the artist update is expected to be sent to. + /// + /// The normalized Id of the media library. + /// The normalized Id of the artist. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(Guid libraryId, Guid artistId) + { + return ApiRoutes.Music.UPDATE_ARTIST + .Replace("{libraryId}", libraryId.ToString()) + .Replace("{artistId}", artistId.ToString()); + } +} diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpointTests.cs new file mode 100644 index 00000000..b71df8c9 --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/UpdateArtistCover/UpdateArtistCoverEndpointTests.cs @@ -0,0 +1,297 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.UpdateArtistCover; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Artists.UpdateArtistCover; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class UpdateArtistCoverEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly UpdateArtistCoverEndpoint _sut; + private readonly UpdateMusicCoverDtoFixture _updateMusicCoverDtoFixture = new(); + private static readonly Guid s_libraryId = Guid.NewGuid(); + + /// + /// Initializes a new instance of the class. + /// + public UpdateArtistCoverEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalledWithFile_ShouldUploadCoverToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: "/media/artists/cover.jpg")); + ConfigureRequest(artistId, [1, 2, 3], "cover.jpg"); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(s_libraryId.ToString(), artistId)), + Arg.Any(), + Arg.Is(fileName => fileName == "cover.jpg"), + Arg.Is(fieldName => fieldName == "cover"), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenArtistRouteIdIsNotParseable_ShouldUploadCoverWithEmptyId() + { + // Arrange + const string MALICIOUS_ARTIST_ID = "not-a-guid"; + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: "/media/artists/cover.jpg")); + ConfigureRequest(MALICIOUS_ARTIST_ID, [1, 2, 3], "cover.jpg"); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(s_libraryId.ToString(), Guid.Empty)), + Arg.Any(), + Arg.Any(), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenLibraryQueryIdIsNotParseable_ShouldUploadCoverWithEmptyLibraryId() + { + // Arrange + Guid artistId = Guid.NewGuid(); + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: "/media/artists/cover.jpg")); + ConfigureRequest(artistId, [1, 2, 3], "cover.jpg"); + // The query value is normalized to a Guid before it is substituted into the upstream URL, so a crafted value can never escape its segment. + _sut.HttpContext.Request.QueryString = new QueryString("?libraryId=not-a-library-guid"); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(Guid.Empty.ToString(), artistId)), + Arg.Any(), + Arg.Any(), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenLibraryQueryIdIsMissing_ShouldUploadCoverWithEmptyLibraryId() + { + // Arrange + Guid artistId = Guid.NewGuid(); + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: "/media/artists/cover.jpg")); + ConfigureRequest(artistId, [1, 2, 3], "cover.jpg"); + _sut.HttpContext.Request.QueryString = new QueryString(string.Empty); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(Guid.Empty.ToString(), artistId)), + Arg.Any(), + Arg.Any(), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenApiReturnsCoverPath_ShouldReturnSuccessJsonWithPath() + { + // Arrange + Guid artistId = Guid.NewGuid(); + const string EXPECTED_PATH = "/media/artists/cover.jpg"; + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: EXPECTED_PATH)); + ConfigureRequest(artistId, [1, 2, 3], "cover.jpg"); + + // Act + IResult result = await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(EXPECTED_PATH, jsonDocument.RootElement.GetProperty("data").GetString()); + } + + [Fact] + public async Task ExecuteAsync_WhenFormHasNoFile_ShouldForwardRequestWithoutFileToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + const string EXPECTED_PATH = "/media/artists/cover.jpg"; + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: EXPECTED_PATH)); + ConfigureRequestWithoutFiles(artistId); + + // Act + IResult result = await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(s_libraryId.ToString(), artistId)), + Arg.Is(stream => stream == null), + Arg.Is(fileName => fileName == null), + Arg.Is(fieldName => fieldName == "cover"), + Arg.Any()); + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(EXPECTED_PATH, jsonDocument.RootElement.GetProperty("data").GetString()); + } + + [Fact] + public async Task ExecuteAsync_WhenRequestIsNotMultipart_ShouldForwardRequestWithoutFileToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + const string EXPECTED_PATH = "/media/artists/cover.jpg"; + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: EXPECTED_PATH)); + _sut.HttpContext.Request.RouteValues["artistId"] = artistId.ToString(); + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={s_libraryId}"); + _sut.HttpContext.Request.ContentType = "application/json"; + + // Act + IResult result = await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(s_libraryId.ToString(), artistId)), + Arg.Is(stream => stream == null), + Arg.Is(fileName => fileName == null), + Arg.Is(fieldName => fieldName == "cover"), + Arg.Any()); + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(EXPECTED_PATH, jsonDocument.RootElement.GetProperty("data").GetString()); + } + + [Fact] + public async Task ExecuteAsync_WhenFormIsMalformed_ShouldForwardRequestWithoutFileToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + const string EXPECTED_PATH = "/media/artists/cover.jpg"; + _mockApiHttpClient.PutMultipartAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_updateMusicCoverDtoFixture.Create(coverPath: EXPECTED_PATH)); + ConfigureMalformedRequest(artistId); + + // Act + IResult result = await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + await _mockApiHttpClient.Received(1).PutMultipartAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(s_libraryId.ToString(), artistId)), + Arg.Is(stream => stream == null), + Arg.Is(fileName => fileName == null), + Arg.Is(fieldName => fieldName == "cover"), + Arg.Any()); + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(EXPECTED_PATH, jsonDocument.RootElement.GetProperty("data").GetString()); + } + + /// + /// Configures a multipart form request carrying a single file. + /// + /// The route Id of the artist whose cover is uploaded. + /// The bytes of the uploaded file. + /// The name of the uploaded file. + private void ConfigureRequest(Guid artistId, byte[] content, string fileName) + { + ConfigureRequest(artistId.ToString(), content, fileName); + } + + /// + /// Configures a multipart form request carrying a single file. + /// + /// The raw route value of the artist Id. + /// The bytes of the uploaded file. + /// The name of the uploaded file. + private void ConfigureRequest(string artistId, byte[] content, string fileName) + { + _sut.HttpContext.Request.RouteValues["artistId"] = artistId; + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={s_libraryId}"); + MemoryStream coverStream = new(content); + IFormFile formFile = new FormFile(coverStream, 0, content.Length, "cover", fileName); + FormFileCollection files = [formFile]; + IFormCollection form = new FormCollection([], files); + _sut.HttpContext.Request.ContentType = "multipart/form-data; boundary=----test"; + _sut.HttpContext.Features.Set(new FormFeature(form)); + } + + /// + /// Configures a multipart form request without any file. + /// + /// The route Id of the artist whose cover is uploaded. + private void ConfigureRequestWithoutFiles(Guid artistId) + { + _sut.HttpContext.Request.RouteValues["artistId"] = artistId.ToString(); + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={s_libraryId}"); + IFormCollection form = new FormCollection([]); + _sut.HttpContext.Request.ContentType = "multipart/form-data; boundary=----test"; + _sut.HttpContext.Features.Set(new FormFeature(form)); + } + + /// + /// Configures a multipart form request whose body cannot be parsed. + /// + /// The route Id of the artist whose cover is uploaded. + private void ConfigureMalformedRequest(Guid artistId) + { + _sut.HttpContext.Request.RouteValues["artistId"] = artistId.ToString(); + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={s_libraryId}"); + _sut.HttpContext.Request.ContentType = "multipart/form-data; boundary=----test"; + IFormCollection malformedForm = Substitute.For(); + malformedForm.Files.Returns(_ => throw new InvalidDataException("Malformed multipart body.")); + _sut.HttpContext.Features.Set(new FormFeature(malformedForm)); + } + + /// + /// Builds the upstream endpoint the cover upload is expected to be sent to. + /// + /// The raw Id of the media library. + /// The normalized Id of the artist. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(string libraryId, Guid artistId) + { + return ApiRoutes.Music.UPDATE_ARTIST_COVER + .Replace("{libraryId}", libraryId) + .Replace("{artistId}", artistId.ToString()); + } +} diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpointTests.cs new file mode 100644 index 00000000..d58bd4e3 --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/DeleteMusicTrack/DeleteMusicTrackEndpointTests.cs @@ -0,0 +1,152 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.DeleteMusicTrack; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.DeleteMusicTrack; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class DeleteMusicTrackEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly DeleteMusicTrackEndpoint _sut; + + /// + /// Initializes a new instance of the class. + /// + public DeleteMusicTrackEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalled_ShouldDeleteTrackViaApiAndReturnSuccessWithoutData() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + Guid libraryId = Guid.NewGuid(); + ConfigureRequest(artistId.ToString(), albumId.ToString(), trackId.ToString(), libraryId); + + // Act + IResult result = await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + await _mockApiHttpClient.Received(1).DeleteAsync( + BuildExpectedEndpoint(libraryId, artistId, albumId, trackId), + Arg.Any()); + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.False(jsonDocument.RootElement.TryGetProperty("data", out JsonElement _)); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteIdsAreNotParseable_ShouldForwardGuidEmptyIdsToApi() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + ConfigureRequest("not-a-guid", "not-a-guid", "not-a-guid", libraryId); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).DeleteAsync( + BuildExpectedEndpoint(libraryId, Guid.Empty, Guid.Empty, Guid.Empty), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteIdsAreMissing_ShouldForwardGuidEmptyIdsToApi() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={libraryId}"); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).DeleteAsync( + BuildExpectedEndpoint(libraryId, Guid.Empty, Guid.Empty, Guid.Empty), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenLibraryQueryIdIsNotParseable_ShouldForwardGuidEmptyLibraryIdToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + ConfigureRequest(artistId.ToString(), albumId.ToString(), trackId.ToString(), "not-a-guid"); + + // Act + await _sut.ExecuteAsync(EmptyRequest.Instance, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).DeleteAsync( + BuildExpectedEndpoint(Guid.Empty, artistId, albumId, trackId), + Arg.Any()); + } + + /// + /// Sets the route and query values the endpoint reads the track identities from. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw route value of the track Id. + /// The raw query value of the library Id. + private void ConfigureRequest(string artistId, string albumId, string trackId, Guid libraryId) + { + ConfigureRequest(artistId, albumId, trackId, libraryId.ToString()); + } + + /// + /// Sets the route and query values the endpoint reads the track identities from. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw route value of the track Id. + /// The raw query value of the library Id. + private void ConfigureRequest(string artistId, string albumId, string trackId, string libraryId) + { + _sut.HttpContext.Request.RouteValues["artistId"] = artistId; + _sut.HttpContext.Request.RouteValues["albumId"] = albumId; + _sut.HttpContext.Request.RouteValues["trackId"] = trackId; + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={libraryId}"); + } + + /// + /// Builds the upstream endpoint the track deletion is expected to be sent to. + /// + /// The normalized Id of the media library. + /// The normalized Id of the artist. + /// The normalized Id of the album. + /// The normalized Id of the track. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(Guid libraryId, Guid artistId, Guid albumId, Guid trackId) + { + return ApiRoutes.Music.DELETE_TRACK + .Replace("{libraryId}", libraryId.ToString()) + .Replace("{artistId}", artistId.ToString()) + .Replace("{albumId}", albumId.ToString()) + .Replace("{trackId}", trackId.ToString()); + } +} 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 new file mode 100644 index 00000000..ed6020ad --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetAlbumTracks/GetAlbumTracksEndpointTests.cs @@ -0,0 +1,202 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetAlbumTracks; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetAlbumTracks; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetAlbumTracksEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly GetAlbumTracksEndpoint _sut; + private readonly GetAlbumTracksLiteRequestFixture _getAlbumTracksLiteRequestFixture = new(); + private readonly PaginatedMusicTrackLiteDtoFixture _paginatedMusicTrackLiteDtoFixture = new(); + private readonly MusicTrackLiteDtoFixture _musicTrackLiteDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + public GetAlbumTracksEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalledWithPagination_ShouldRequestTracksWithQueryParameters() + { + // Arrange + GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(currentPage: 2, perPage: 48); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + 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()); + } + + [Fact] + public async Task ExecuteAsync_WhenCalledWithoutPagination_ShouldRequestTracksWithoutQueryParameters() + { + // Arrange + GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId), Guid.Parse(request.AlbumId))), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenOnlyCurrentPageIsProvided_ShouldAppendOnlyCurrentPage() + { + // Arrange + GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(currentPage: 3); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId), Guid.Parse(request.AlbumId))}?currentPage=3"), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenOnlyPerPageIsProvided_ShouldAppendOnlyPerPage() + { + // Arrange + GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(perPage: 24); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId), Guid.Parse(request.AlbumId))}?perPage=24"), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenArtistIdIsNotParseable_ShouldForwardGuidEmptyArtistIdToApi() + { + // Arrange + GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(artistId: "not-a-guid", currentPage: 1, perPage: 20); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Empty, Guid.Parse(request.AlbumId))}?currentPage=1&perPage=20"), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenAlbumIdIsNotParseable_ShouldForwardGuidEmptyAlbumIdToApi() + { + // Arrange + GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(albumId: "' OR '1'='1", currentPage: 1, perPage: 20); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId), Guid.Empty)}?currentPage=1&perPage=20"), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenArtistIdAndAlbumIdAreMissing_ShouldForwardGuidEmptyIdsToApi() + { + // Arrange + GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(artistId: string.Empty, albumId: string.Empty, currentPage: 1, perPage: 20); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_paginatedMusicTrackLiteDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == $"{BuildExpectedEndpoint(request.LibraryId, Guid.Empty, Guid.Empty)}?currentPage=1&perPage=20"), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenApiReturnsPaginatedTracks_ShouldReturnSuccessJsonWithTracks() + { + // Arrange + GetAlbumTracksLiteRequest request = _getAlbumTracksLiteRequestFixture.Create(); + PaginatedMusicTrackLiteDto expectedResponse = _paginatedMusicTrackLiteDtoFixture.Create( + data: [_musicTrackLiteDtoFixture.Create(title: "Test Track")], + currentPage: 1, + perPage: 20, + count: 1, + numberOfPages: 1); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(expectedResponse); + + // Act + IResult result = await _sut.ExecuteAsync(request, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + JsonElement data = jsonDocument.RootElement.GetProperty("data"); + Assert.Equal(1, data.GetProperty("currentPage").GetInt32()); + Assert.Equal(1, data.GetProperty("data").GetArrayLength()); + } + + /// + /// Builds the upstream endpoint the album track retrieval is expected to be sent to, without query parameters. + /// + /// The Id of the media library. + /// The normalized Id of the artist. + /// The normalized Id of the album. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(Guid libraryId, Guid artistId, Guid albumId) + { + return ApiRoutes.Music.GET_ALBUM_TRACKS_LITE + .Replace("{libraryId}", libraryId.ToString()) + .Replace("{artistId}", artistId.ToString()) + .Replace("{albumId}", albumId.ToString()); + } +} diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpointTests.cs new file mode 100644 index 00000000..ddf9c687 --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/GetMusicTrack/GetMusicTrackEndpointTests.cs @@ -0,0 +1,129 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetMusicTrack; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.GetMusicTrack; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class GetMusicTrackEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly GetMusicTrackEndpoint _sut; + private readonly GetMusicTrackViewRequestFixture _getMusicTrackViewRequestFixture = new(); + private readonly MusicTrackDtoFixture _musicTrackDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + public GetMusicTrackEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalled_ShouldRequestTrackFromApiWithNormalizedIds() + { + // Arrange + GetMusicTrackViewRequest request = _getMusicTrackViewRequestFixture.Create(); + MusicTrackDto expectedTrack = _musicTrackDtoFixture.Create(); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(expectedTrack); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Parse(request.ArtistId), Guid.Parse(request.AlbumId), Guid.Parse(request.TrackId))), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteIdsAreNotParseable_ShouldForwardGuidEmptyIdsToApi() + { + // Arrange + GetMusicTrackViewRequest request = _getMusicTrackViewRequestFixture.Create(artistId: "not-a-guid", albumId: "' OR '1'='1", trackId: "'; DROP TABLE Tracks; --"); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_musicTrackDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Empty, Guid.Empty, Guid.Empty)), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteIdsAreEmpty_ShouldForwardGuidEmptyIdsToApi() + { + // Arrange + GetMusicTrackViewRequest request = _getMusicTrackViewRequestFixture.Create(artistId: string.Empty, albumId: string.Empty, trackId: string.Empty); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(_musicTrackDtoFixture.Create()); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).GetAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(request.LibraryId, Guid.Empty, Guid.Empty, Guid.Empty)), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenApiReturnsTrack_ShouldReturnSuccessJsonWithTrack() + { + // Arrange + GetMusicTrackViewRequest request = _getMusicTrackViewRequestFixture.Create(); + MusicTrackDto expectedTrack = _musicTrackDtoFixture.Create(); + _mockApiHttpClient.GetAsync(Arg.Any(), Arg.Any()) + .Returns(expectedTrack); + + // Act + IResult result = await _sut.ExecuteAsync(request, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(expectedTrack.Id, jsonDocument.RootElement.GetProperty("data").GetProperty("id").GetGuid()); + } + + /// + /// Builds the upstream endpoint the track retrieval is expected to be sent to. + /// + /// The normalized Id of the media library. + /// The normalized Id of the artist. + /// The normalized Id of the album. + /// The normalized Id of the track. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(Guid libraryId, Guid artistId, Guid albumId, Guid trackId) + { + return ApiRoutes.Music.GET_TRACK + .Replace("{libraryId}", libraryId.ToString()) + .Replace("{artistId}", artistId.ToString()) + .Replace("{albumId}", albumId.ToString()) + .Replace("{trackId}", trackId.ToString()); + } +} diff --git a/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpointTests.cs b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpointTests.cs new file mode 100644 index 00000000..ded9d594 --- /dev/null +++ b/tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Tracks/SaveMusicTrack/SaveMusicTrackEndpointTests.cs @@ -0,0 +1,245 @@ +#region ========================================================================= USING ===================================================================================== +using FastEndpoints; +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Common.Routes; +using Lumina.Presentation.Web.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.SaveMusicTrack; +using Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary; +using Lumina.Presentation.Web.Fixtures.Common.Requests.Library.AudioLibrary.MusicLibrary.Tracks; +using Lumina.Presentation.Web.Fixtures.Common.TestHelpers; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +#endregion + +namespace Lumina.Presentation.Web.UnitTests.Core.Endpoints.Library.AudioLibrary.MusicLibrary.Tracks.SaveMusicTrack; + +/// +/// Contains unit tests for the class. +/// +[ExcludeFromCodeCoverage] +public class SaveMusicTrackEndpointTests +{ + private readonly IApiHttpClient _mockApiHttpClient; + private readonly SaveMusicTrackEndpoint _sut; + private readonly UpdateMusicTrackRequestFixture _updateMusicTrackRequestFixture = new(); + private readonly MusicTrackDtoFixture _musicTrackDtoFixture = new(); + + /// + /// Initializes a new instance of the class. + /// + public SaveMusicTrackEndpointTests() + { + _mockApiHttpClient = Substitute.For(); + _sut = Factory.Create(_mockApiHttpClient); + } + + [Fact] + public async Task ExecuteAsync_WhenCalled_ShouldForwardUpdateMusicTrackRequestToApiWithRouteAndQueryIds() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + Guid libraryId = Guid.NewGuid(); + UpdateMusicTrackRequest request = _updateMusicTrackRequestFixture.Create(); + MusicTrackDto expectedTrack = _musicTrackDtoFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(expectedTrack); + ConfigureRequest(artistId.ToString(), albumId.ToString(), trackId.ToString(), libraryId); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(libraryId, artistId, albumId, trackId)), + Arg.Is(forwardedRequest => forwardedRequest == request), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenArtistRouteIdIsNotParseable_ShouldForwardGuidEmptyArtistIdToApi() + { + // Arrange + const string MALICIOUS_ARTIST_ID = "not-a-guid"; + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + Guid libraryId = Guid.NewGuid(); + UpdateMusicTrackRequest request = _updateMusicTrackRequestFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_musicTrackDtoFixture.Create()); + ConfigureRequest(MALICIOUS_ARTIST_ID, albumId.ToString(), trackId.ToString(), libraryId); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(libraryId, Guid.Empty, albumId, trackId)), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenAlbumRouteIdIsNotParseable_ShouldForwardGuidEmptyAlbumIdToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + const string MALICIOUS_ALBUM_ID = "' OR '1'='1"; + Guid trackId = Guid.NewGuid(); + Guid libraryId = Guid.NewGuid(); + UpdateMusicTrackRequest request = _updateMusicTrackRequestFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_musicTrackDtoFixture.Create()); + ConfigureRequest(artistId.ToString(), MALICIOUS_ALBUM_ID, trackId.ToString(), libraryId); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(libraryId, artistId, Guid.Empty, trackId)), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenTrackRouteIdIsNotParseable_ShouldForwardGuidEmptyTrackIdToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + const string MALICIOUS_TRACK_ID = "'; DROP TABLE Tracks; --"; + Guid libraryId = Guid.NewGuid(); + UpdateMusicTrackRequest request = _updateMusicTrackRequestFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_musicTrackDtoFixture.Create()); + ConfigureRequest(artistId.ToString(), albumId.ToString(), MALICIOUS_TRACK_ID, libraryId); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(libraryId, artistId, albumId, Guid.Empty)), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenRouteIdsAreMissing_ShouldForwardGuidEmptyIdsToApi() + { + // Arrange + Guid libraryId = Guid.NewGuid(); + UpdateMusicTrackRequest request = _updateMusicTrackRequestFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_musicTrackDtoFixture.Create()); + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={libraryId}"); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(libraryId, Guid.Empty, Guid.Empty, Guid.Empty)), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenLibraryQueryIdIsNotParseable_ShouldForwardGuidEmptyLibraryIdToApi() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + const string MALICIOUS_LIBRARY_ID = "not-a-guid"; + UpdateMusicTrackRequest request = _updateMusicTrackRequestFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(_musicTrackDtoFixture.Create()); + ConfigureRequest(artistId.ToString(), albumId.ToString(), trackId.ToString(), MALICIOUS_LIBRARY_ID); + + // Act + await _sut.ExecuteAsync(request, CancellationToken.None); + + // Assert + await _mockApiHttpClient.Received(1).PutAsync( + Arg.Is(endpoint => endpoint == BuildExpectedEndpoint(Guid.Empty, artistId, albumId, trackId)), + Arg.Any(), + Arg.Any()); + } + + [Fact] + public async Task ExecuteAsync_WhenApiReturnsUpdatedTrack_ShouldReturnSuccessJsonWithTrack() + { + // Arrange + Guid artistId = Guid.NewGuid(); + Guid albumId = Guid.NewGuid(); + Guid trackId = Guid.NewGuid(); + Guid libraryId = Guid.NewGuid(); + UpdateMusicTrackRequest request = _updateMusicTrackRequestFixture.Create(); + MusicTrackDto expectedTrack = _musicTrackDtoFixture.Create(); + _mockApiHttpClient.PutAsync(Arg.Any(), Arg.Any(), Arg.Any()) + .Returns(expectedTrack); + ConfigureRequest(artistId.ToString(), albumId.ToString(), trackId.ToString(), libraryId); + + // Act + IResult result = await _sut.ExecuteAsync(request, CancellationToken.None); + string body = await JsonResultTestHelper.GetResponseBodyAsync(result); + + // Assert + using JsonDocument jsonDocument = JsonDocument.Parse(body); + Assert.True(jsonDocument.RootElement.GetProperty("success").GetBoolean()); + Assert.Equal(expectedTrack.Id, jsonDocument.RootElement.GetProperty("data").GetProperty("id").GetGuid()); + } + + /// + /// Sets the route and query values the endpoint reads the track identities from. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw route value of the track Id. + /// The raw query value of the library Id. + private void ConfigureRequest(string artistId, string albumId, string trackId, Guid libraryId) + { + ConfigureRequest(artistId, albumId, trackId, libraryId.ToString()); + } + + /// + /// Sets the route and query values the endpoint reads the track identities from. + /// + /// The raw route value of the artist Id. + /// The raw route value of the album Id. + /// The raw route value of the track Id. + /// The raw query value of the library Id. + private void ConfigureRequest(string artistId, string albumId, string trackId, string libraryId) + { + _sut.HttpContext.Request.RouteValues["artistId"] = artistId; + _sut.HttpContext.Request.RouteValues["albumId"] = albumId; + _sut.HttpContext.Request.RouteValues["trackId"] = trackId; + _sut.HttpContext.Request.QueryString = new QueryString($"?libraryId={libraryId}"); + } + + /// + /// Builds the upstream endpoint the track update is expected to be sent to. + /// + /// The normalized Id of the media library. + /// The normalized Id of the artist. + /// The normalized Id of the album. + /// The normalized Id of the track. + /// The expected upstream endpoint. + private static string BuildExpectedEndpoint(Guid libraryId, Guid artistId, Guid albumId, Guid trackId) + { + return ApiRoutes.Music.UPDATE_TRACK + .Replace("{libraryId}", libraryId.ToString()) + .Replace("{artistId}", artistId.ToString()) + .Replace("{albumId}", albumId.ToString()) + .Replace("{trackId}", trackId.ToString()); + } +}