mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-05-25 09:02:32 -04:00
Chapter/Issue level Reviews and Ratings (#3778)
Co-authored-by: Joseph Milazzo <josephmajora@gmail.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#nullable enable
|
||||
using System.Collections.Generic;
|
||||
using API.DTOs.SeriesDetail;
|
||||
|
||||
namespace API.DTOs;
|
||||
|
||||
public class ChapterDetailPlusDto
|
||||
{
|
||||
public float Rating { get; set; }
|
||||
public bool HasBeenRated { get; set; }
|
||||
|
||||
public IList<UserReviewDto> Reviews { get; set; } = [];
|
||||
public IList<RatingDto> Ratings { get; set; } = [];
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using API.Services.Plus;
|
||||
using API.Entities.Enums;
|
||||
using API.Services.Plus;
|
||||
|
||||
namespace API.DTOs;
|
||||
#nullable enable
|
||||
@@ -8,5 +9,6 @@ public class RatingDto
|
||||
public int AverageScore { get; set; }
|
||||
public int FavoriteCount { get; set; }
|
||||
public ScrobbleProvider Provider { get; set; }
|
||||
public RatingAuthority Authority { get; set; } = RatingAuthority.User;
|
||||
public string? ProviderUrl { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
|
||||
namespace API.DTOs.SeriesDetail;
|
||||
#nullable enable
|
||||
|
||||
public class UpdateUserReviewDto
|
||||
{
|
||||
public int SeriesId { get; set; }
|
||||
public int? ChapterId { get; set; }
|
||||
public string Body { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using API.Services.Plus;
|
||||
using API.Entities;
|
||||
using API.Entities.Enums;
|
||||
using API.Services.Plus;
|
||||
|
||||
namespace API.DTOs.SeriesDetail;
|
||||
#nullable enable
|
||||
@@ -26,6 +28,7 @@ public class UserReviewDto
|
||||
/// The series this is for
|
||||
/// </summary>
|
||||
public int SeriesId { get; set; }
|
||||
public int? ChapterId { get; set; }
|
||||
/// <summary>
|
||||
/// The library this series belongs in
|
||||
/// </summary>
|
||||
@@ -54,4 +57,8 @@ public class UserReviewDto
|
||||
/// If this review is External, which Provider did it come from
|
||||
/// </summary>
|
||||
public ScrobbleProvider Provider { get; set; } = ScrobbleProvider.Kavita;
|
||||
/// <summary>
|
||||
/// Source of the Rating
|
||||
/// </summary>
|
||||
public RatingAuthority Authority { get; set; } = RatingAuthority.User;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
namespace API.DTOs;
|
||||
|
||||
public class UpdateSeriesRatingDto
|
||||
public class UpdateRatingDto
|
||||
{
|
||||
public int SeriesId { get; init; }
|
||||
public int? ChapterId { get; init; }
|
||||
public float UserRating { get; init; }
|
||||
}
|
||||
Reference in New Issue
Block a user