public void OnUpdateTrackTagsInfoCompleted(TagsForTrackRequest request, List<Song> TagTracks) { if (request.Equals(_lastTrackTagRequest)) { string propertyTags = String.Empty; for (int i = 0; i < TagTracks.Count; i++) { // some tags might be very long - reduce the number of tags then if (propertyTags.Length > 50) { break; } propertyTags += TagTracks[i].Genre + " "; _trackTagsCache.Add(TagTracks[i].Genre); // display 5 items only if (i >= 4) { break; } } GUIPropertyManager.SetProperty("#Play.Current.Lastfm.TrackTags", propertyTags); } else { Log.Warn("NowPlaying.OnUpdateTrackTagsInfoCompleted: unexpected response for request: {0}", request.Type); } }
private void UpdateTrackTagsInfo(string _trackArtist, string _trackTitle) { TagsForTrackRequest request = new TagsForTrackRequest( _trackArtist, _trackTitle, new TagsForTrackRequest.TagsForTrackRequestHandler(OnUpdateTrackTagsInfoCompleted)); _lastTrackTagRequest = request; _trackTagsCache.Clear(); InfoScrobbler.AddRequest(request); }