Skip to content

Commit

Permalink
Renaming Id to TargetId
Browse files Browse the repository at this point in the history
  • Loading branch information
akrol95 committed Oct 2, 2024
1 parent a8878f9 commit ed2c820
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions BMM.Api/Framework/HTTP/ApiUris.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public class ApiUris
public static string TrackTranscriptions = "track/{id}/transcription";
public static string TrackCover = "track/{id}/cover";
public static string TrackCollections = "track_collection/";
public static string TrackCollection = "track_collection/{id}";
public static string TrackCollectionAlbum = "track_collection/{id}/album/{albumId}";
public static string TrackCollectionPlaylist = "track_collection/{id}/playlist/{playlistId}";
public static string TrackCollectionTrackCollection = "track_collection/{id}/track_collection/{playlistId}";
public static string TrackCollection = "track_collection/{targetId}";
public static string TrackCollectionAlbum = "track_collection/{targetId}/album/{albumId}";
public static string TrackCollectionPlaylist = "track_collection/{targetId}/playlist/{playlistId}";
public static string TrackCollectionTrackCollection = "track_collection/{targetId}/track_collection/{playlistId}";
public static string TrackCollectionResetShare = "track_collection/{id}/reset-share";
public static string TrackCollectionUnfollow = "track_collection/{id}/unfollow";
public static string TrackCollectionTopSongs = "track_collection/top-songs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ namespace BMM.Api.Implementation.Clients.Contracts
public interface ITrackCollectionClient
{
/// <summary>Adds the tracks with the specified ids to the track collection.</summary>
Task<bool> AddTracksToTrackCollection(int id, IList<int> trackIds);
Task<bool> AddTracksToTrackCollection(int targetId, IList<int> trackIds);

Task AddAlbumToTrackCollection(int id, int albumId);
Task AddAlbumToTrackCollection(int targetId, int albumId);

Task AddPlaylistToTrackCollection(int id, int playlistId);
Task AddPlaylistToTrackCollection(int targetId, int playlistId);

Task AddTrackCollectionToTrackCollection(int id, int trackCollectionId);
Task AddTrackCollectionToTrackCollection(int targetId, int trackCollectionId);

/// <summary>Deletes the track collection.</summary>
Task<bool> Delete(int id);
Expand Down
16 changes: 8 additions & 8 deletions BMM.Api/Implementation/Clients/TrackCollectionClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,41 @@ public TrackCollectionClient(IRequestHandler handler, ApiBaseUri baseUri, ILogge
: base(handler, baseUri, logger)
{ }

public async Task AddAlbumToTrackCollection(int id, int albumId)
public async Task AddAlbumToTrackCollection(int targetId, int albumId)
{
var uri = new UriTemplate(ApiUris.TrackCollectionAlbum);
uri.SetParameter("id", id);
uri.SetParameter("targetId", targetId);
uri.SetParameter("albumId", albumId);

var request = BuildRequest(uri, HttpMethod.Post);
await RequestIsSuccessful(request);
}

public async Task<bool> AddTracksToTrackCollection(int id, IList<int> trackIds)
public async Task<bool> AddTracksToTrackCollection(int targetId, IList<int> trackIds)
{
var uri = new UriTemplate(ApiUris.TrackCollection);
uri.SetParameter("id", id);
uri.SetParameter("targetId", targetId);

var request = BuildRequest(uri, HttpMethod.Post);
SetLinkHeader(trackIds, request);

return await RequestIsSuccessful(request);
}

public async Task AddPlaylistToTrackCollection(int id, int playlistId)
public async Task AddPlaylistToTrackCollection(int targetId, int playlistId)
{
var uri = new UriTemplate(ApiUris.TrackCollectionPlaylist);
uri.SetParameter("id", id);
uri.SetParameter("targetId", targetId);
uri.SetParameter("playlistId", playlistId);

var request = BuildRequest(uri, HttpMethod.Post);
await RequestIsSuccessful(request);
}

public async Task AddTrackCollectionToTrackCollection(int id, int trackCollectionId)
public async Task AddTrackCollectionToTrackCollection(int targetId, int trackCollectionId)
{
var uri = new UriTemplate(ApiUris.TrackCollectionTrackCollection);
uri.SetParameter("id", id);
uri.SetParameter("targetId", targetId);
uri.SetParameter("playlistId", trackCollectionId);

var request = BuildRequest(uri, HttpMethod.Post);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ public CachedTrackCollectionClientDecorator(ITrackCollectionClient client, IClie
_clientCache = clientCache;
}

public Task<bool> AddTracksToTrackCollection(int id, IList<int> trackIds)
public Task<bool> AddTracksToTrackCollection(int targetId, IList<int> trackIds)
{
return _client.AddTracksToTrackCollection(id, trackIds);
return _client.AddTracksToTrackCollection(targetId, trackIds);
}

public Task AddAlbumToTrackCollection(int id, int albumId)
public Task AddAlbumToTrackCollection(int targetId, int albumId)
{
return _client.AddAlbumToTrackCollection(id, albumId);
return _client.AddAlbumToTrackCollection(targetId, albumId);
}

public Task AddPlaylistToTrackCollection(int id, int playlistId)
public Task AddPlaylistToTrackCollection(int targetId, int playlistId)
{
return _client.AddPlaylistToTrackCollection(id, playlistId);
return _client.AddPlaylistToTrackCollection(targetId, playlistId);
}

public Task AddTrackCollectionToTrackCollection(int id, int trackCollectionId)
public Task AddTrackCollectionToTrackCollection(int targetId, int trackCollectionId)
{
return _client.AddTrackCollectionToTrackCollection(id, trackCollectionId);
return _client.AddTrackCollectionToTrackCollection(targetId, trackCollectionId);
}

public Task<bool> Delete(int id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ public MeasuringTrackCollectionClientDecorator(ITrackCollectionClient client, IC
_stopwatchManager = stopwatchManager;
}

public Task<bool> AddTracksToTrackCollection(int id, IList<int> trackIds)
public Task<bool> AddTracksToTrackCollection(int targetId, IList<int> trackIds)
{
return _client.AddTracksToTrackCollection(id, trackIds);
return _client.AddTracksToTrackCollection(targetId, trackIds);
}

public Task AddAlbumToTrackCollection(int id, int albumId)
public Task AddAlbumToTrackCollection(int targetId, int albumId)
{
return _client.AddAlbumToTrackCollection(id, albumId);
return _client.AddAlbumToTrackCollection(targetId, albumId);
}

public Task AddPlaylistToTrackCollection(int id, int playlistId)
public Task AddPlaylistToTrackCollection(int targetId, int playlistId)
{
return _client.AddPlaylistToTrackCollection(id, playlistId);
return _client.AddPlaylistToTrackCollection(targetId, playlistId);
}

public Task AddTrackCollectionToTrackCollection(int id, int trackCollectionId)
public Task AddTrackCollectionToTrackCollection(int targetId, int trackCollectionId)
{
return _client.AddTrackCollectionToTrackCollection(id, trackCollectionId);
return _client.AddTrackCollectionToTrackCollection(targetId, trackCollectionId);
}

public Task<bool> Delete(int id)
Expand Down

0 comments on commit ed2c820

Please sign in to comment.