Skip to content

Commit

Permalink
GH-469: Use extended comment sort order in movies and episodes module
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikfroehling authored May 29, 2023
1 parent ff69965 commit 87aa94b
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Source/Lib/Trakt.NET/Modules/TraktEpisodesModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public async IAsyncEnumerable<TraktResponse<ITraktEpisode>> GetEpisodesStreamAsy
/// <param name="showIdOrSlug">The show's Trakt-Id or -Slug. See also <seealso cref="ITraktShowIds" />.</param>
/// <param name="seasonNumber">The number of the season containing the episode, for which the comments should be queried.</param>
/// <param name="episodeNumber">The number of the episode, for which the comments should be queried.</param>
/// <param name="commentSortOrder">The comments sort order. See also <seealso cref="TraktCommentSortOrder" />.</param>
/// <param name="commentSortOrder">The comments sort order. See also <seealso cref="TraktExtendedCommentSortOrder" />.</param>
/// <param name="pagedParameters">Specifies pagination parameters. <see cref="TraktPagedParameters" />.</param>
/// <param name="cancellationToken">
/// Propagates notification that the request should be canceled.<para/>
Expand All @@ -157,7 +157,7 @@ public async IAsyncEnumerable<TraktResponse<ITraktEpisode>> GetEpisodesStreamAsy
/// <exception cref="TraktException">Thrown, if the request fails.</exception>
/// <exception cref="TraktRequestValidationException">Thrown, if validation of request data fails.</exception>
public Task<TraktPagedResponse<ITraktComment>> GetEpisodeCommentsAsync(string showIdOrSlug, uint seasonNumber, uint episodeNumber,
TraktCommentSortOrder commentSortOrder = null,
TraktExtendedCommentSortOrder commentSortOrder = null,
TraktPagedParameters pagedParameters = null,
CancellationToken cancellationToken = default)
{
Expand Down
4 changes: 2 additions & 2 deletions Source/Lib/Trakt.NET/Modules/TraktMoviesModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public Task<TraktListResponse<ITraktMovieTranslation>> GetMovieTranslationsAsync
/// </para>
/// </summary>
/// <param name="movieIdOrSlug">The movie's Trakt-Id or -Slug. See also <seealso cref="ITraktMovieIds" />.</param>
/// <param name="commentSortOrder">The comments sort order. See also <seealso cref="TraktCommentSortOrder" />.</param>
/// <param name="commentSortOrder">The comments sort order. See also <seealso cref="TraktExtendedCommentSortOrder" />.</param>
/// <param name="pagedParameters">Specifies pagination parameters. <see cref="TraktPagedParameters" />.</param>
/// <param name="cancellationToken">
/// Propagates notification that the request should be canceled.<para/>
Expand All @@ -234,7 +234,7 @@ public Task<TraktListResponse<ITraktMovieTranslation>> GetMovieTranslationsAsync
/// <exception cref="TraktException">Thrown, if the request fails.</exception>
/// <exception cref="TraktRequestValidationException">Thrown, if validation of request data fails.</exception>
public Task<TraktPagedResponse<ITraktComment>> GetMovieCommentsAsync(string movieIdOrSlug,
TraktCommentSortOrder commentSortOrder = null,
TraktExtendedCommentSortOrder commentSortOrder = null,
TraktPagedParameters pagedParameters = null,
CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

internal sealed class EpisodeCommentsRequest : AEpisodeRequest<ITraktComment>, ISupportsPagination
{
internal TraktCommentSortOrder SortOrder { get; set; }
internal TraktExtendedCommentSortOrder SortOrder { get; set; }

public uint? Page { get; set; }

Expand All @@ -19,7 +19,7 @@ public override IDictionary<string, object> GetUriPathParameters()
{
var uriParams = base.GetUriPathParameters();

if (SortOrder != null && SortOrder != TraktCommentSortOrder.Unspecified)
if (SortOrder != null && SortOrder != TraktExtendedCommentSortOrder.Unspecified)
uriParams.Add("sort_order", SortOrder.UriName);

if (Page.HasValue)
Expand Down
4 changes: 2 additions & 2 deletions Source/Lib/Trakt.NET/Requests/Movies/MovieCommentsRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

internal sealed class MovieCommentsRequest : AMovieRequest<ITraktComment>, ISupportsPagination
{
internal TraktCommentSortOrder SortOrder { get; set; }
internal TraktExtendedCommentSortOrder SortOrder { get; set; }

public uint? Page { get; set; }

Expand All @@ -19,7 +19,7 @@ public override IDictionary<string, object> GetUriPathParameters()
{
var uriParams = base.GetUriPathParameters();

if (SortOrder != null && SortOrder != TraktCommentSortOrder.Unspecified)
if (SortOrder != null && SortOrder != TraktExtendedCommentSortOrder.Unspecified)
uriParams.Add("sort_order", SortOrder.UriName);

if (Page.HasValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public partial class TraktEpisodesModule_Tests
private const int COMMENTS_ITEM_COUNT = 4;
private const int LISTS_ITEM_COUNT = 10;
private readonly TraktExtendedInfo EXTENDED_INFO = new TraktExtendedInfo { Full = true };
private readonly TraktCommentSortOrder COMMENT_SORT_ORDER = TraktCommentSortOrder.Likes;
private readonly TraktExtendedCommentSortOrder COMMENT_SORT_ORDER = TraktExtendedCommentSortOrder.Likes;
private readonly TraktListSortOrder LIST_SORT_ORDER = TraktListSortOrder.Comments;
private readonly TraktListType LIST_TYPE = TraktListType.Official;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public partial class TraktMoviesModule_Tests
private const int LISTS_ITEM_COUNT = 10;
private readonly TraktExtendedInfo EXTENDED_INFO = new TraktExtendedInfo { Full = true };
private readonly TraktTimePeriod TIME_PERIOD = TraktTimePeriod.Monthly;
private readonly TraktCommentSortOrder COMMENT_SORT_ORDER = TraktCommentSortOrder.Likes;
private readonly TraktExtendedCommentSortOrder COMMENT_SORT_ORDER = TraktExtendedCommentSortOrder.Likes;
private readonly TraktListSortOrder LIST_SORT_ORDER = TraktListSortOrder.Comments;
private readonly TraktListType LIST_TYPE = TraktListType.Official;
private readonly DateTime TODAY = DateTime.UtcNow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class EpisodeCommentsRequest_TestData : IEnumerable<object[]>
private const string _id = "123";
private const uint _seasonNumber = 1;
private const uint _episodeNumber = 8;
private static readonly TraktCommentSortOrder _sortOrder = TraktCommentSortOrder.Newest;
private static readonly TraktExtendedCommentSortOrder _sortOrder = TraktExtendedCommentSortOrder.Newest;
private const int _page = 5;
private const int _limit = 20;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void Test_MovieCommentsRequest_Returns_Valid_UriPathParameters(IDictionar
public class MovieCommentsRequest_TestData : IEnumerable<object[]>
{
private const string _id = "123";
private static readonly TraktCommentSortOrder _sortOrder = TraktCommentSortOrder.Newest;
private static readonly TraktExtendedCommentSortOrder _sortOrder = TraktExtendedCommentSortOrder.Newest;
private const int _page = 5;
private const int _limit = 20;

Expand Down

0 comments on commit 87aa94b

Please sign in to comment.