public SubtitleSearchResultCollection SearchSubtitles(params SearchQuery[] query) { CheckSession(); var options = new SearchOptions { Limit = SearchLimit }; var result = proxy.SearchSubtitles( session.Token, query, options); if (!result.IsSuccess) { throw new OSDbException( $"Subtitle search failed: {result.Status}"); } return result; }
public async Task<SubtitleSearchResultCollection> SearchSubtitlesAsync(params SearchQuery[] query) { CheckSession(); var options = new SearchOptions { Limit = SearchLimit }; var task = Task.Factory.FromAsync( (callback, state) => proxy.BeginSearchSubtitles(session.Token, query, options, callback), proxy.EndSearchSubtitles, null); var result = await task.WithTimeout(Timeout); if (!result.IsSuccess) { throw new OSDbException(result); } return result; }