UserPage - Lists of rated movies and tv series added
This commit is contained in:
@@ -54,6 +54,9 @@ public class MediaQueryParameters : QueryParameters<MediaResponse>
|
||||
|
||||
[FromQuery(Name = "rating_count_to")]
|
||||
public long? RatingCountTo { get; set; }
|
||||
|
||||
[FromQuery(Name = "genre")]
|
||||
public IEnumerable<short>? Genres { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -78,6 +81,8 @@ public class MediaQueryParameters : QueryParameters<MediaResponse>
|
||||
TestComparable(item.Rating.Average, RatingAverage, RatingAverageFrom, RatingAverageTo)
|
||||
&&
|
||||
TestComparable(item.Rating.Count, RatingCount, RatingCountFrom, RatingCountTo)
|
||||
&&
|
||||
TestContains(Genres, item.Genres.Select(x => x.Id))
|
||||
);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
using WatchIt.Common.Model.Genres;
|
||||
using WatchIt.Common.Model.Rating;
|
||||
using WatchIt.Common.Query;
|
||||
|
||||
@@ -31,6 +32,9 @@ public class MediaResponse : Media, IQueryOrderable<MediaResponse>
|
||||
|
||||
[JsonPropertyName("rating")]
|
||||
public RatingResponse Rating { get; set; }
|
||||
|
||||
[JsonPropertyName("genres")]
|
||||
public IEnumerable<GenreResponse> Genres { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -52,6 +56,7 @@ public class MediaResponse : Media, IQueryOrderable<MediaResponse>
|
||||
Length = media.Length;
|
||||
Type = mediaType;
|
||||
Rating = RatingResponse.Create(media.RatingMedia);
|
||||
Genres = media.Genres.Select(x => new GenreResponse(x)).ToList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user