Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
句和一 committed Aug 4, 2023
1 parent c2d7a19 commit 8067e0d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions SaayaClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ public class SaayaClient : ISaayaClient
private RestClient _rest;
private readonly CancellationTokenSource CancellationTokenSource;

private const string Songs = "https://api.saaya.dev/songs";
private const string Playlists = "https://api.saaya.dev/playlists";

public SaayaClient()
{
_rest = new RestClient();
Expand All @@ -22,7 +19,7 @@ public SaayaClient()

public async Task<IEnumerable<Song>> GetSongsAsync(string token)
{
RestRequest Request = new RestRequest($"{Songs}", Method.Get);
RestRequest Request = new RestRequest($"https://api.saaya.dev/songs", Method.Get);
Request.AddHeader("Authorization", $"Bearer {token}");
RestResponse Response = await _rest.ExecuteAsync(Request);

Expand All @@ -37,7 +34,7 @@ public async Task<IEnumerable<Song>> GetSongsAsync(string token)

public async Task<IEnumerable<Song>> GetSongsForPlaylist(string token, string playlistId)
{
RestRequest Request = new RestRequest($"{Songs}", Method.Get);
RestRequest Request = new RestRequest($"https://api.saaya.dev/playlists", Method.Get);
Request.AddHeader("Authorization", $"Bearer {token}");
Request.AddParameter("playlist", playlistId);

Expand All @@ -54,7 +51,7 @@ public async Task<IEnumerable<Song>> GetSongsForPlaylist(string token, string pl

public async Task<IEnumerable<Playlist>> GetPlaylistsAsync(string token)
{
RestRequest Request = new RestRequest($"{Playlists}", Method.Get);
RestRequest Request = new RestRequest($"https://api.saaya.dev/playlists", Method.Get);
Request.AddHeader("Authorization", $"Bearer {token}");

RestResponse Response = await _rest.ExecuteAsync(Request);
Expand Down

0 comments on commit 8067e0d

Please sign in to comment.