コード例 #1
0
ファイル: Program.cs プロジェクト: mpxx24/SpotifyHelper
        private static void DisplayRecommendedTracks(string testTrackId)
        {
            var features = AudioAnalysisWrapper.GetTrackFeatures(testTrackId);
            var genres   = new List <RecommendationsGenre> {
                RecommendationsGenre.Rock
            };

            var criteria = new RecommendationsParameters(genres)
            {
                Tracks = new List <string> {
                    testTrackId
                },
                MinDanceability = features.Danceability.ToString(CultureInfo.InvariantCulture),
                MinEnergy       = features.Energy.ToString(CultureInfo.InvariantCulture),
                MinTempo        = features.Tempo.ToString(CultureInfo.InvariantCulture)
            };

            var tracks = RecommendationsWrapper.GetTracksReccomendationsBasedOnCustomCriteria(criteria);

            WriteLine(criteria);
            OutputItemsToConsole.PrintRecommendedTracks(tracks);

            var tracksCustom = RecommendationsWrapper.GetCustomTracksReccomendationsBasedOnTrack(testTrackId, 10);

            OutputItemsToConsole.PrintRecommendedTracks(tracksCustom);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: mpxx24/SpotifyHelper
        private static void DisplayRecommendedAlbums(string testTrackId)
        {
            var albums = RecommendationsWrapper.GetAlbumsReccomendationsBasedOnTrack(testTrackId);

            OutputItemsToConsole.PrintRecommendedAlbums(albums);
        }