Skip to content

Commit

Permalink
Extend Artist with average rating
Browse files Browse the repository at this point in the history
  • Loading branch information
geloczi committed Dec 19, 2021
1 parent 5d8756f commit 93c4151
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SynologyDotNet.AudioStation/AudioStationClient.Artist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public partial class AudioStationClient
public async Task<ApiListRessponse<ArtistList>> ListArtistsAsync(int limit, int offset)
{
return await Client.QueryListAsync<ApiListRessponse<ArtistList>>(SYNO_AudioStation_Artist, "list", limit, offset,
GetLibraryArg());
GetLibraryArg(),
("additional", "avg_rating"));
}

/// <summary>
Expand All @@ -30,6 +31,7 @@ public async Task<ApiListRessponse<ArtistList>> ListArtistsAsync(int limit, int
{
return await Client.QueryListAsync<ApiListRessponse<ArtistList>>(SYNO_AudioStation_Artist, "list", limit, offset,
GetLibraryArg(),
("additional", "avg_rating"),
("genre", genre));
}

Expand Down
9 changes: 9 additions & 0 deletions SynologyDotNet.AudioStation/Model/Artist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ public class Artist
[JsonProperty("name")]
public string Name { get; set; }

[JsonProperty("additional")]
public GenreAdditional Additional { get; set; }

public override string ToString() => Name ?? base.ToString();
}

public struct ArtistAdditional
{
[JsonProperty("avg_rating")]
public AvgRating AverageRating { get; set; }
}
}

0 comments on commit 93c4151

Please sign in to comment.