public RecommendationView([NotNull] TVDoc doc, UI main, IEnumerable <ShowConfiguration> s) : this(doc, main) { media = MediaConfiguration.MediaType.tv; tvShows = s; movies = new List <MovieConfiguration>(); Scan(); }
public CombinedCodeFinder(string?initialHint, MediaConfiguration.MediaType type, TVDoc.ProviderType source) { Type = type; Source = source; mInternal = false; InitializeComponent(); txtFindThis.Text = initialHint; SetupColumns(); if (!initialHint.HasValue()) { ListViewItem lvi = new ListViewItem(string.Empty); lvi.SubItems.Add(DEFAULT_MESSAGE); lvMatches.Items.Add(lvi); } lvwCodeFinderColumnSorter = new ListViewColumnSorter(new DoubleAsTextSorter(5)) { Order = SortOrder.Descending }; lvMatches.ListViewItemSorter = lvwCodeFinderColumnSorter; label3.Text = GetPromptLabel(Source); }
public CombinedCodeFinder(string?initialHint, MediaConfiguration.MediaType type, TVDoc.ProviderType source) { Type = type; Source = source; mInternal = false; InitializeComponent(); txtFindThis.Text = initialHint; if (string.IsNullOrEmpty(initialHint)) { ListViewItem lvi = new ListViewItem(""); lvi.SubItems.Add("Enter the show's name, and click \"Search\""); lvMatches.Items.Add(lvi); } SetupColumns(); lvwCodeFinderColumnSorter = new ListViewColumnSorter(new DoubleAsTextSorter(5)); lvwCodeFinderColumnSorter.Order = SortOrder.Descending; lvMatches.ListViewItemSorter = lvwCodeFinderColumnSorter; label3.Text = GetPromptLabel(Source); }
public CachedMediaInfo?GetMedia(int code, MediaConfiguration.MediaType type) { return(type switch { MediaConfiguration.MediaType.tv => GetSeries(code), MediaConfiguration.MediaType.movie => GetMovie(code), _ => throw new ArgumentOutOfRangeException(nameof(type), type, null) });
public override void Search(string text, bool showErrorMsgBox, MediaConfiguration.MediaType type, string languageCode) { if (type == MediaConfiguration.MediaType.tv) { List <CachedSeriesInfo>?results = API.ShowSearch(text).ToList(); LOGGER.Info($"Got {results.Count:N0} results searching for {text} on TVMaze"); foreach (CachedSeriesInfo result in results) { LOGGER.Info($" Movie: {result.Name}:{result.TvMazeCode} {result.Popularity}"); AddSeriesToCache(result); } } }
public QuickLocateForm(string hint, MediaConfiguration.MediaType t) { InitializeComponent(); cbDirectory.SuspendLayout(); cbDirectory.Items.Clear(); List <string> folders = (t == MediaConfiguration.MediaType.tv ? TVSettings.Instance.LibraryFolders : TVSettings.Instance.MovieLibraryFolders); foreach (string folder in folders) { cbDirectory.Items.Add(folder.TrimEnd(Path.DirectorySeparatorChar.ToString())); } cbDirectory.SelectedIndex = 0; cbDirectory.ResumeLayout(); txtShowFolder.Text = Path.DirectorySeparatorChar + TVSettings.Instance.FilenameFriendly(FileHelper.MakeValidPath(hint)); }
public Searchers(XElement?settings, MediaConfiguration.MediaType t) : this(t) { if (settings is null) { return; } Clear(); string currentSearchString = settings.ExtractString("Current"); foreach (SearchEngine engine in settings.Descendants("Choice").Select(GenerateSearchEngine).Where(x => x.HasValue).Select(x => x.Value)) { Add(engine); if (engine.Name == currentSearchString) { CurrentSearch = engine; } } }
public RecommendationView([NotNull] TVDoc doc, UI main, MediaConfiguration.MediaType type) : this(doc, main) { media = type; switch (type) { case MediaConfiguration.MediaType.tv: tvShows = doc.TvLibrary.Shows; break; case MediaConfiguration.MediaType.movie: movies = doc.FilmLibrary.Movies; break; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } Scan(); }
public Searchers(MediaConfiguration.MediaType t) { switch (t) { case MediaConfiguration.MediaType.tv: SearchEngine google2 = new SearchEngine { Name = "Google", Url = "https://www.google.com/search?q={ShowName}+S{Season:2}E{Episode}" }; Add(google2); Add(new SearchEngine { Name = "YouTube", Url = "https://www.youtube.com/results?search_query={ShowName}+{EpisodeName}" }); Add(new SearchEngine { Name = "Vimeo", Url = "https://vimeo.com/search?q={ShowName}+{EpisodeName}" }); CurrentSearch = google2; break; case MediaConfiguration.MediaType.movie: SearchEngine google = new SearchEngine { Name = "Google", Url = "https://www.google.com/search?q={ShowName}" }; Add(google); Add(new SearchEngine { Name = "YouTube", Url = "https://www.youtube.com/results?search_query={ShowName}" }); Add(new SearchEngine { Name = "Vimeo", Url = "https://vimeo.com/search?q={ShowName}" }); CurrentSearch = google; break; case MediaConfiguration.MediaType.both: default: throw new ArgumentOutOfRangeException(nameof(t), t, null); } }
public RecommendationRow(RecommendationResult x, MediaConfiguration.MediaType t) { result = x; type = t; switch (t) { case MediaConfiguration.MediaType.tv: cachedSeriesInfo = TMDB.LocalCache.Instance.GetSeries(x.Key); cachedMediaInfo = cachedSeriesInfo; break; case MediaConfiguration.MediaType.movie: cachedMovieInfo = TMDB.LocalCache.Instance.GetMovie(x.Key); cachedMediaInfo = cachedMovieInfo; break; default: throw new ArgumentOutOfRangeException(nameof(t), t, null); } }
public SeriesSpecifier(int tvdb, int tvmaze, int tmdb, bool useCustomLanguage, string?customLanguageCode, string name, TVDoc.ProviderType p, string?imdb, MediaConfiguration.MediaType t) { TvdbSeriesId = tvdb; TvMazeSeriesId = tvmaze; Name = name; ImdbCode = imdb; Provider = p; Type = t; TmdbId = tmdb; if (string.IsNullOrWhiteSpace(customLanguageCode)) { UseCustomLanguage = false; CustomLanguageCode = TVSettings.Instance.PreferredLanguageCode; } else { UseCustomLanguage = useCustomLanguage; CustomLanguageCode = customLanguageCode; } }
public static JObject SearchV4(string text, string defaultLanguageCode, MediaConfiguration.MediaType media) { string uri = TokenProvider.TVDB_API_URL + "/search"; return(media switch { MediaConfiguration.MediaType.tv => JsonHttpGetRequest(uri, new Dictionary <string, string> { { "q", text }, { "type", "series" } }, TokenProvider, defaultLanguageCode, false), MediaConfiguration.MediaType.movie => JsonHttpGetRequest(uri, new Dictionary <string, string> { { "q", text }, { "type", "movie" } }, TokenProvider, defaultLanguageCode, false), MediaConfiguration.MediaType.both => JsonHttpGetRequest(uri, new Dictionary <string, string> { { "q", text } }, TokenProvider, defaultLanguageCode, false), _ => throw new ArgumentOutOfRangeException(nameof(media), media, null) });
public RecommendationView([NotNull] TVDoc doc, UI main, IEnumerable <MovieConfiguration> m) : this(doc, main) { media = MediaConfiguration.MediaType.movie; movies = m; Scan(); }
private int CountDirtyIdsFrom(TVDoc.ProviderType provider, MediaConfiguration.MediaType type) { return(type == MediaConfiguration.MediaType.tv ?downloadIds.Count(s => s.Provider == provider && s.Type == type && (TVDoc.GetMediaCache(provider).GetSeries(s.IdFor(provider))?.Dirty ?? true)) :downloadIds.Count(s => s.Provider == provider && s.Type == type && (TVDoc.GetMediaCache(provider).GetMovie(s.IdFor(provider))?.Dirty ?? true))); }
private int CountIdsFrom(TVDoc.ProviderType provider, MediaConfiguration.MediaType type) { return(downloadIds.Count(s => s.Provider == provider && s.Type == type)); }