lib/songstats/api/artist.rb in songstats-api-1.2.0 vs lib/songstats/api/artist.rb in songstats-api-1.4.0

- old
+ new

@@ -71,8 +71,26 @@ def delete_link(id, link) # https://docs.songstats.com/docs/api/dc58c858fdbb6-delete-artist-link delete path(id, "/artists/link_request", link: link) end + + def add_track(id, track_id) + # https://docs.songstats.com/docs/api/aux8fvg3g9sv7-add-artist-track + options = {} + options[:isrc] = track_id if track_id.size == ISRC_LENGTH + options[:spotify_track_id] = track_id if track_id.size > ISRC_LENGTH && !url?(track_id) + options[:link] = track_id if url? track_id + post path(id, "/artists/track_request", options) + end + + def delete_track(id, track_id) + # https://docs.songstats.com/docs/api/sijd2vkvgwpdj-remove-artist-track + options = {} + options[:isrc] = track_id if track_id.size == ISRC_LENGTH + options[:songstats_track_id] = track_id if track_id.size == SONG_STATS_ID_LENGTH + options[:spotify_track_id] = track_id if track_id.size > ISRC_LENGTH + delete path(id, "/artists/track_request", options) + end end end end