-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Threading.Tasks; | ||
using SynologyDotNet.AudioStation.Model; | ||
using SynologyDotNet.Core.Responses; | ||
|
||
namespace SynologyDotNet.AudioStation | ||
{ | ||
public partial class AudioStationClient | ||
{ | ||
/// <summary> | ||
/// Lists the genres. | ||
/// </summary> | ||
/// <param name="limit">The limit.</param> | ||
/// <param name="offset">The offset.</param> | ||
/// <returns></returns> | ||
public async Task<ApiListRessponse<GenreList>> ListGenresAsync(int limit, int offset) | ||
{ | ||
return await Client.QueryListAsync<ApiListRessponse<GenreList>>(SYNO_AudioStation_Genre, "list", limit, offset, | ||
GetLibraryArg(), | ||
("additional", "avg_rating")); | ||
} | ||
|
||
/// <summary> | ||
/// Searches the genres by name. | ||
/// </summary> | ||
/// <param name="limit">The limit.</param> | ||
/// <param name="offset">The offset.</param> | ||
/// <param name="keyword">The keyword.</param> | ||
/// <returns></returns> | ||
public async Task<ApiListRessponse<GenreList>> SearchGenresByNameAsync(int limit, int offset, string keyword) | ||
{ | ||
return await Client.QueryListAsync<ApiListRessponse<GenreList>>(SYNO_AudioStation_Genre, "list", limit, offset, | ||
GetLibraryArg(), | ||
("additional", "avg_rating"), | ||
("keyword", keyword), | ||
("filter", keyword)); | ||
} | ||
} | ||
} |