private void Process(RecommendedArtist artist)
        {
            var search = new EventsByArtistSearch();

            search.GetResultsPage(new Banshee.SongKick.Search.Query(null, artist.Name));
            AddSongKickInfo(artist, search.ResultsPage);
        }
コード例 #2
0
        public IEnumerable<RecommendedArtist> GetRecommendations()
        {
            var command = new HyenaSqliteCommand (topArtistsQuery);

            using (IDataReader reader = ServiceManager.DbConnection.Query (command)) {
                while (reader.Read ()) {
                    var artistName = reader.Get<string> (0);
                    var artistMusicBrainzId = reader.Get<string> (1);

                    var artist = new RecommendedArtist (artistName, artistMusicBrainzId);

                    yield return artist;
                }
            }
        }
        public IEnumerable <RecommendedArtist> GetRecommendations()
        {
            var command = new HyenaSqliteCommand(topArtistsQuery);

            using (IDataReader reader = ServiceManager.DbConnection.Query(command)) {
                while (reader.Read())
                {
                    var artistName          = reader.Get <string> (0);
                    var artistMusicBrainzId = reader.Get <string> (1);

                    var artist = new RecommendedArtist(artistName, artistMusicBrainzId);

                    yield return(artist);
                }
            }
        }
 private void ProcessAllOneThread()
 {
     try {
         while (artist_queue.Count > 0)
         {
             RecommendedArtist artist = null;
             lock (artist_queue) {
                 if (artist_queue.Count > 0)
                 {
                     artist = artist_queue.Dequeue();
                 }
             }
             if (artist != null)
             {
                 Process(artist);
             }
         }
     } catch (InvalidOperationException e) { // this exception should never be thrown by Dequeue() thanks to lock
         Hyena.Log.Error(e);
     }
 }
コード例 #5
0
 private void Process(RecommendedArtist artist)
 {
     var search = new EventsByArtistSearch ();
     search.GetResultsPage (new Banshee.SongKick.Search.Query (null, artist.Name));
     AddSongKickInfo (artist, search.ResultsPage);
 }
コード例 #6
0
        private void FillAdditionalInfo(RecommendedArtist artist, 
            ResultsPage<Banshee.SongKick.Recommendations.Event> songKickFirstArtistEvents)
        {
            artist.NumberOfConcerts = 0;

            if (songKickFirstArtistEvents.IsStatusOk) {
                artist.NumberOfConcerts = songKickFirstArtistEvents.results.Count;
            }

            ThreadAssist.ProxyToMain (() => {
                recommended_artist_model.Reload ();
                recommended_artist_search_view.OnUpdated ();
            });
        }