diff --git a/Webzine.Business/Seeders/SeedDataSpotify.cs b/Webzine.Business/Seeders/SeedDataSpotify.cs index 455cf60..0894341 100644 --- a/Webzine.Business/Seeders/SeedDataSpotify.cs +++ b/Webzine.Business/Seeders/SeedDataSpotify.cs @@ -22,6 +22,12 @@ public class SeedDataSpotify this.options = optionsAccessor.Value; } + /// + /// Générer les données de la base a l'aide des données de spotify. + /// + /// Cancellation token. + /// Jeu de données. + /// Erreur de connexion a spotify. public async Task GenererJeuDeDonneesAsync(CancellationToken cancellationToken = default) { // Verification des parametres pour l'acces a Spotify. @@ -35,7 +41,7 @@ public class SeedDataSpotify var artistes = new List(); var titres = new List(); var commentaires = new List(); - var artistIds = new HashSet(StringComparer.OrdinalIgnoreCase); + var artistIds = new HashSet(); int nextArtistId = 1; int nextStyleId = 1; int nextTitreId = 1; @@ -68,7 +74,7 @@ public class SeedDataSpotify token, cancellationToken); - foreach (var album in albums?.Items.GroupBy(a => a.Name, StringComparer.OrdinalIgnoreCase).Select(g => g.First()) ??[]) + foreach (var album in albums?.Items.GroupBy(a => a.Name).Select(g => g.First()) ??[]) { var tracks = await this.GetAsync( $"https://api.spotify.com/v1/albums/{album.Id}/tracks?market={this.options.Market}&limit={Math.Clamp(this.options.TracksPerAlbum, 1, 10)}", diff --git a/Webzine.WebApplication/Views/Accueil/Index.cshtml b/Webzine.WebApplication/Views/Accueil/Index.cshtml index defe1e8..b557a9d 100644 --- a/Webzine.WebApplication/Views/Accueil/Index.cshtml +++ b/Webzine.WebApplication/Views/Accueil/Index.cshtml @@ -60,7 +60,7 @@ @foreach (var style in titre.Styles) { - diff --git a/Webzine.WebApplication/appsettings.Development.json b/Webzine.WebApplication/appsettings.Development.json index c34f064..9777510 100644 --- a/Webzine.WebApplication/appsettings.Development.json +++ b/Webzine.WebApplication/appsettings.Development.json @@ -2,7 +2,7 @@ "Seeder": "Spotify", "Repository": "Db", "SpotifySeeder": { - "ClientId": "754247cf73e047bf9d6acf44977b6c4a", - "ClientSecret": "0e674c5ac1c249f1af711fb08a919a02" + "ClientId": "", + "ClientSecret": "" } } diff --git a/Webzine.WebApplication/appsettings.json b/Webzine.WebApplication/appsettings.json index 76fbdbd..5c21727 100644 --- a/Webzine.WebApplication/appsettings.json +++ b/Webzine.WebApplication/appsettings.json @@ -14,11 +14,11 @@ "PostGreSQLConnection": "Host=localhost;Port=5432;Username=admin;Password=admin123;Database=webzine_db" }, "SpotifySeeder": { - "ClientId": "754247cf73e047bf9d6acf44977b6c4a", - "ClientSecret": "0e674c5ac1c249f1af711fb08a919a02", + "ClientId": "", + "ClientSecret": "", "Market": "FR", - "Genres": [ "rock", "pop", "jazz", "hip hop", "electronic", "metal", "hyper pop" ], - "ArtistsPerGenre": 50, + "Genres": [ "rock", "pop", "jazz", "hip hop", "electronic", "metal", "hyper pop", "shatta", "french%20rap" ], + "ArtistsPerGenre": 5, "AlbumsPerArtist": 20, "TracksPerAlbum": 40, "MaxCommentsPerTrack": 3