using System.Linq; using Nancy; using Sony.Filtr.Contracts.Abstractions; using Sony.Filtr.Playlists.Spotify; namespace Sony.Filtr.AdminAPI.Modules.SpotifySpecific { public class SpotifyPlaylistChangeModule : BaseModule { private readonly SpotifyPlaylistManager _spotifyPlaylistManager; public SpotifyPlaylistChangeModule(IApplicationInstanceManager applicationInstanceManager, SpotifyPlaylistManager spotifyPlaylistManager) : base(applicationInstanceManager) { _spotifyPlaylistManager = spotifyPlaylistManager; Get["GetSpotifyPlaylistChanges", "/spotify/playlistchanges", true] = async (parameters, cx) => { var playlistUri = (string)Request.Query.playlistUri; var playlistChanges = await _spotifyPlaylistManager.GetPlaylistChangesAsync(playlistUri); return Response.AsJson(playlistChanges); }; } } }