protected override void GetAlbumInfoWithTimer() { log.Debug("Discogs: Looking up Album on Discogs"); Albums.Clear(); try { var query = new SearchQuery { Artist = ArtistName, ReleaseTitle = AlbumName, Type = SearchItemType.Master }; var searchresults = _discogs.Search(query); // Look for the Master Release only foreach (var result in searchresults.Results) { if (result.Type == SearchItemType.Master) { var album = GetRelease(result.Id); Albums.Add(album); } } log.Debug("Discogs: Found {0} albums", Albums.Count); } catch (Exception ex) { log.Debug("Discogs: Exception receiving Album Information. {0} {1}", ex.Message, ex.StackTrace); } }
public SearchResults Search(SearchQuery query, PaginationRequest paginationRequest = null) { Tuple<SearchQuery, PaginationRequest> key = new Tuple<SearchQuery, PaginationRequest>(query, paginationRequest); if (searchCache.ContainsKey(key)) { return searchCache[key]; } return searchCache[key] = this.discogs.Search(query, paginationRequest); }