/// <summary> /// null mean no select. /// </summary> /// <param name="window"></param> /// <returns></returns> public async Task <bool?> LoadFromImdbIdAsync(Window window) { if (string.IsNullOrWhiteSpace(this.ImdbId)) { return(false); } var url = WebImageSelectorWindow.StartSelectByImdbId(window, this.ImdbId); if (string.IsNullOrWhiteSpace(url)) { return(null); } this.Uri = url; return(await this.LoadFromUrlAsync()); }
public async Task <bool?> StartSelect(Window window) { var parameters = new List <RemoteId>(); var imdbId = this.videoViewer.InfoView.Source.GetValidImdbId(); if (imdbId != null) { parameters.Add(new RemoteId(RemoteIdType.Imdb, imdbId)); } var theTVDBId = this.videoViewer.InfoView.SeriesView.Source.TheTVDBId; if (!theTVDBId.IsNullOrWhiteSpace()) { parameters.Add(new RemoteId(RemoteIdType.TheTVDB, theTVDBId)); } imdbId = this.videoViewer.InfoView.SeriesView.Source.GetValidImdbId(); if (imdbId != null) { parameters.Add(new RemoteId(RemoteIdType.Imdb, imdbId)); } var url = WebImageSelectorWindow.StartSelectFanartByImdbId(window, this.videoViewer.InfoView.Source.Index.ToString(), parameters.ToArray()); if (string.IsNullOrWhiteSpace(url)) { return(null); } var builder = CoverBuilder.CreateBackground(this.videoViewer.InfoView.Source); builder.Uri.Add(url); await this.GetManagers().CoverManager.BuildCoverAsync(builder); this.RefreshProperties(); return(false); }