Exemplo n.º 1
0
 public PlaylistEndpoint(ISpotifyHttpClient spotifyHttpClient, ILogService logService, Dictionary <ApiEndpointType, SpotifyEndpoint> apiEndpoints)
 {
     _spotifyHttpClient = spotifyHttpClient;
     _logService        = logService;
     _mapper            = new SpotifyToSpotibroModelMapper();
     _apiEndpoints      = apiEndpoints;
 }
Exemplo n.º 2
0
 public PartyService(IPartyRepository partyRepository, ISpotifyHttpClient spotifyHttpClient, ILogService logService, IPartyGoerService partyGoerService)
 {
     _partyRepository   = partyRepository;
     _spotifyHttpClient = spotifyHttpClient;
     _partyGoerService  = partyGoerService;
     _logService        = logService;
 }
Exemplo n.º 3
0
 public PartyService(IPartyRepository partyRepository, ISpotifyHttpClient spotifyHttpClient, ILogService logService)
 {
     _partyRepository   = partyRepository;
     _spotifyHttpClient = spotifyHttpClient;
     _random            = new Random();
     _logService        = logService;
 }
Exemplo n.º 4
0
 public void SetUp()
 {
     _spotifyAuthentication = new Mock <ISpotifyAuthentication>();
     _httpClient            = new Mock <IHttpClient>();
     _logService            = new Mock <ILogService>();
     _spotifyHttpClient     = new SpotifyHttpClient(_spotifyAuthentication.Object, _httpClient.Object, _logService.Object);
 }
Exemplo n.º 5
0
 public PartyHub(IPartyService partyService, ISpotifyHttpClient spotifyHttpClient, ILogService logService, IPartyGoerService partyGoerService)
 {
     _partyService      = partyService;
     _spotifyHttpClient = spotifyHttpClient;
     _logService        = logService;
     _partyGoerService  = partyGoerService;
 }
Exemplo n.º 6
0
 public PartyGoerService(ISpotifyHttpClient spotifyHttpClient, IHttpContextAccessor httpContextAccessor, ISpotifyAuthentication spotifyAuthentication)
 {
     _spotifyHttpClient     = spotifyHttpClient;
     _httpContextAccessor   = httpContextAccessor;
     _spotifyAuthentication = spotifyAuthentication;
     _partyGoerCache        = new Dictionary <string, PartyGoer>();
 }
Exemplo n.º 7
0
        public SpotifyApi(ISpotifyHttpClient spotifyHttpClient, ILogService logService)
        {
            var apiEndpoints = new Dictionary <ApiEndpointType, SpotifyEndpoint>
            {
                { ApiEndpointType.CurrentSong, new SpotifyEndpoint {
                      EndpointUrl = "https://api.spotify.com/v1/me/player/currently-playing", HttpMethod = HttpMethod.Get
                  } },
                { ApiEndpointType.PlaySong, new SpotifyEndpoint {
                      EndpointUrl = "https://api.spotify.com/v1/me/player/play", HttpMethod = HttpMethod.Put
                  } },
                { ApiEndpointType.Token, new SpotifyEndpoint {
                      EndpointUrl = "https://accounts.spotify.com/api/token", HttpMethod = HttpMethod.Post
                  } },
                { ApiEndpointType.UserInformation, new SpotifyEndpoint {
                      EndpointUrl = "https://api.spotify.com/v1/me", HttpMethod = HttpMethod.Get
                  } },
                { ApiEndpointType.GetTopTracks, new SpotifyEndpoint {
                      EndpointUrl = "https://api.spotify.com/v1/me/top/tracks", HttpMethod = HttpMethod.Get
                  } },
                { ApiEndpointType.GetRecommendedTracks, new SpotifyEndpoint {
                      EndpointUrl = "https://api.spotify.com/v1/recommendations", HttpMethod = HttpMethod.Get
                  } },
                { ApiEndpointType.GetUserDevices, new SpotifyEndpoint {
                      EndpointUrl = "https://api.spotify.com/v1/me/player/devices", HttpMethod = HttpMethod.Get
                  } },
                { ApiEndpointType.SearchSpotify, new SpotifyEndpoint {
                      EndpointUrl = "https://api.spotify.com/v1/search", HttpMethod = HttpMethod.Get
                  } },
                { ApiEndpointType.PausePlayback, new SpotifyEndpoint {
                      EndpointUrl = "https://api.spotify.com/v1/me/player/pause", HttpMethod = HttpMethod.Put
                  } },
                { ApiEndpointType.GetUserPlaylists, new SpotifyEndpoint {
                      EndpointUrl = "https://api.spotify.com/v1/me/playlists", HttpMethod = HttpMethod.Get
                  } },
                { ApiEndpointType.GetPlaylistItems, new SpotifyEndpoint {
                      EndpointUrl = "https://api.spotify.com/v1/playlists/{playlist_id}/tracks", HttpMethod = HttpMethod.Get,
                      Keys        = new List <string> {
                          "{playlist_id}"
                      }
                  } },
                { ApiEndpointType.ArtistInformation, new SpotifyEndpoint {
                      EndpointUrl = "https://api.spotify.com/v1/artists/{id}", HttpMethod = HttpMethod.Get,
                      Keys        = new List <string> {
                          "{id}"
                      }
                  } }, { ApiEndpointType.ArtistTopTracks, new SpotifyEndpoint {
                             EndpointUrl = "https://api.spotify.com/v1/artists/{id}/top-tracks", HttpMethod = HttpMethod.Get,
                             Keys        = new List <string> {
                                 "{id}"
                             }
                         } },
                { ApiEndpointType.UsersTopArtists, new SpotifyEndpoint {
                      EndpointUrl = "https://api.spotify.com/v1/me/top/artists", HttpMethod = HttpMethod.Get
                  } }
            };

            _playlistEndpoint        = new PlaylistEndpoint(spotifyHttpClient, logService, apiEndpoints);
            _personalizationEndpoint = new PersonalizationEndpoint(spotifyHttpClient, logService, apiEndpoints);
        }
Exemplo n.º 8
0
 public PartyHandler(ISpotifyHttpClient spotifyHttpClient, IHubContext<PartyHub> partyHubContext, ILogService logService, IPartyService partyService, IPartyGoerService partyGoerService)
 {
     _logService = logService;
     _partyHubContext = partyHubContext;
     _spotifyHttpClient = spotifyHttpClient;
     _partyService = partyService;
     _partyGoerService = partyGoerService;
 }
Exemplo n.º 9
0
 public PartyGoerService(ISpotifyHttpClient spotifyHttpClient, IHttpContextAccessor httpContextAccessor,
                         ISpotifyAuthentication spotifyAuthentication, ILogService logService, ISpotifyApi spotifyApi, IUserRepository userRepository)
 {
     _spotifyHttpClient     = spotifyHttpClient;
     _httpContextAccessor   = httpContextAccessor;
     _spotifyAuthentication = spotifyAuthentication;
     _partyGoerCache        = new ConcurrentDictionary <string, PartyGoer>();
     _logService            = logService;
     _spotifyApi            = spotifyApi;
     _userRepository        = userRepository;
     _userIds    = new Dictionary <string, int>();
     _randomLock = new object();
     _random     = new Random();
 }
Exemplo n.º 10
0
 public AuthenticationService(ISpotifyHttpClient spotifyHttpClient, ISpotifyAuthentication spotifyAuthentication)
 {
     _spotifyHttpClient     = spotifyHttpClient;
     _spotifyAuthentication = spotifyAuthentication;
 }
Exemplo n.º 11
0
 public BrowseSpotifyService(ISpotifyHttpClient spotifyHttpClient, ILogService logService)
 {
     _spotifyHttpClient = spotifyHttpClient;
     _logService        = logService;
 }
Exemplo n.º 12
0
 public AuthenticationService(ISpotifyHttpClient spotifyHttpClient, ISpotifyAuthentication spotifyAuthentication, IPartyGoerService partyGoerService)
 {
     _spotifyHttpClient     = spotifyHttpClient;
     _spotifyAuthentication = spotifyAuthentication;
     _partyGoerService      = partyGoerService;
 }
Exemplo n.º 13
0
 public ContextData(ISpotifyHttpClient spotifyHttpClient, IOptionsProvider <FluentSpotifyClientOptions> fluentSpotifyClientOptionsProvider)
 {
     this.SpotifyHttpClient = spotifyHttpClient;
     this.FluentSpotifyClientOptionsProvider = fluentSpotifyClientOptionsProvider;
 }
Exemplo n.º 14
0
 public FluentSpotifyClient(ISpotifyHttpClient spotifyHttpClient, IOptionsProvider <FluentSpotifyClientOptions> fluentSpotifyClientOptionsProvider)
 {
     this.contextData       = new ContextData(spotifyHttpClient, fluentSpotifyClientOptionsProvider);
     this.spotifyHttpClient = spotifyHttpClient;
 }
Exemplo n.º 15
0
 public PartyGoerService(ISpotifyHttpClient spotifyHttpClient)
 {
     _spotifyHttpClient = spotifyHttpClient;
 }