protected void AddMultiCategoryMapping(TorznabCategory newznabCategory, params int[] trackerCategories) { foreach (var trackerCat in trackerCategories) { categoryMapping.Add(new CategoryMapping(trackerCat.ToString(), newznabCategory.ID)); } }
protected void AddMultiCategoryMapping(TorznabCategory newznabCategory, params int[] trackerCategories) { foreach (var trackerCat in trackerCategories) { AddCategoryMapping(trackerCat, newznabCategory); } }
protected void AddCategoryMapping(string trackerCategory, TorznabCategory newznabCategory, string trackerCategoryDesc = null) { categoryMapping.Add(new CategoryMapping(trackerCategory, trackerCategoryDesc, newznabCategory.ID)); if (!TorznabCaps.Categories.Contains(newznabCategory)) { TorznabCaps.Categories.Add(newznabCategory); if (TorznabCatType.Movies.Contains(newznabCategory)) { TorznabCaps.MovieSearchAvailable = true; } } // add 1:1 categories if (trackerCategoryDesc != null && trackerCategory != null) { try { var trackerCategoryInt = int.Parse(trackerCategory); var CustomCat = new TorznabCategory(trackerCategoryInt + 100000, trackerCategoryDesc); if (!TorznabCaps.Categories.Contains(CustomCat)) { TorznabCaps.Categories.Add(CustomCat); } } catch (FormatException) { // trackerCategory is not an integer, continue } } }
protected void AddCategoryMapping(string trackerCategory, TorznabCategory newznabCategory) { categoryMapping.Add(new CategoryMapping(trackerCategory, newznabCategory.ID)); if (!TorznabCaps.Categories.Contains(newznabCategory)) { TorznabCaps.Categories.Add(newznabCategory); } }
protected void AddResultCategoryMapping(string trackerCategory, TorznabCategory newznabCategory) { resultMapping.Add(new CategoryMapping(trackerCategory.ToString(), null, newznabCategory.ID)); if (!TorznabCaps.Categories.Contains(newznabCategory)) { TorznabCaps.Categories.Add(newznabCategory); } }
private void AddCategoryMappingAndParent(string trackerCategory, TorznabCategory newznabCategory, TorznabCategory parentCategory = null) { AddCategoryMapping(trackerCategory, newznabCategory); if (parentCategory != null && parentCategory.ID != newznabCategory.ID) { AddCategoryMapping(trackerCategory, parentCategory); } }
protected void AddCategoryMapping(string trackerCategory, TorznabCategory newznabCategory, string trackerCategoryDesc = null) { categoryMapping.Add(new CategoryMapping(trackerCategory, trackerCategoryDesc, newznabCategory.ID)); if (!TorznabCaps.Categories.Contains(newznabCategory)) { TorznabCaps.Categories.Add(newznabCategory); if (TorznabCatType.Movies.Contains(newznabCategory)) { TorznabCaps.MovieSearchAvailable = true; } } }
public void TestConstructors() { // TODO: re-order atrributes in TorznabCapabilities // TODO: tv search should be disabled by default // TODO: TorznabCapabilities(params TorznabCategory[] cats) should re-use TorznabCapabilities // TODO: initialize MusicSearchAvailable var torznabCaps = new TorznabCapabilities(); Assert.True(torznabCaps.SearchAvailable); Assert.True(torznabCaps.TVSearchAvailable); Assert.False(torznabCaps.MovieSearchAvailable); Assert.False(torznabCaps.MusicSearchAvailable); // init Assert.False(torznabCaps.BookSearchAvailable); Assert.False(torznabCaps.SupportsImdbMovieSearch); Assert.False(torznabCaps.SupportsImdbTVSearch); Assert.False(torznabCaps.SupportsTvdbSearch); Assert.False(torznabCaps.SupportsTmdbMovieSearch); Assert.False(torznabCaps.SupportsTVRageSearch); Assert.AreEqual(0, torznabCaps.SupportedMusicSearchParamsList.Count); Assert.AreEqual(0, torznabCaps.Categories.Count); var cats = new TorznabCategory[0]; // empty torznabCaps = new TorznabCapabilities(cats); Assert.True(torznabCaps.SearchAvailable); Assert.True(torznabCaps.TVSearchAvailable); Assert.False(torznabCaps.MovieSearchAvailable); Assert.False(torznabCaps.MusicSearchAvailable); // init Assert.False(torznabCaps.BookSearchAvailable); Assert.False(torznabCaps.SupportsImdbMovieSearch); Assert.False(torznabCaps.SupportsImdbTVSearch); Assert.False(torznabCaps.SupportsTvdbSearch); Assert.False(torznabCaps.SupportsTmdbMovieSearch); Assert.False(torznabCaps.SupportsTVRageSearch); Assert.AreEqual(0, torznabCaps.SupportedMusicSearchParamsList.Count); Assert.AreEqual(0, torznabCaps.Categories.Count); // TODO: movies category enables Movies Search ?? cats = new [] { TorznabCatType.MoviesSD }; torznabCaps = new TorznabCapabilities(cats); Assert.AreEqual(1, torznabCaps.Categories.Count); Assert.AreEqual(TorznabCatType.MoviesSD, torznabCaps.Categories[0]); Assert.True(torznabCaps.MovieSearchAvailable); }
protected void AddCategoryMapping(int trackerCategory, TorznabCategory newznabCategory, string trackerCategoryDesc = null) { AddCategoryMapping(trackerCategory.ToString(), newznabCategory, trackerCategoryDesc); }
public void _AddMultiCategoryMapping(TorznabCategory newznabCategory, params int[] trackerCategories) => AddMultiCategoryMapping(newznabCategory, trackerCategories);
public void _AddCategoryMapping(int trackerCategory, TorznabCategory newznabCategory, string trackerCategoryDesc = null) => AddCategoryMapping(trackerCategory, newznabCategory, trackerCategoryDesc);
protected void AddCategoryMapping(int trackerCategory, TorznabCategory newznabCategory) { AddCategoryMapping(trackerCategory.ToString(), newznabCategory); }
private void AddCategoryMapping(int trackerMediaCategory, int trackerCategory, TorznabCategory newznabCategory, string trackerCategoryDesc = null) { AddCategoryMapping(trackerCategory, newznabCategory, trackerCategoryDesc); if (!_mediaCategoryMapping.ContainsKey(trackerMediaCategory)) { _mediaCategoryMapping.Add(trackerMediaCategory, new List <int>()); } _mediaCategoryMapping[trackerMediaCategory].Add(trackerCategory); }
public void addCategoryMappingByMediaType(string HDCityID, TorznabCategory torznabCategory, String mediaType) { mediaMappings.Add(HDCityID, mediaType); AddCategoryMapping(HDCityID, torznabCategory); }
void AddCat(int cat, TorznabCategory catType, string label) { AddCategoryMapping(cat, catType); categoryLabels.Add(label, cat); }