forked from Prowlarr/Prowlarr
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add manga specific capabilities (#15)
* Remove existing categories except for some books and other * Return other for ParseTvShowQuality * Disable capabilities test fixture * Set default sync capabilities for Sonarr * Add option to CreateTorrentInfo to pass categories * Add method for indexers to define capabilities
- Loading branch information
1 parent
ba929a2
commit 8a90996
Showing
6 changed files
with
145 additions
and
436 deletions.
There are no files selected for viewing
174 changes: 87 additions & 87 deletions
174
src/NzbDrone.Core.Test/IndexerTests/IndexerCapabilitiesCategoriesFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,87 @@ | ||
using System.Linq; | ||
using FluentAssertions; | ||
using NUnit.Framework; | ||
using NzbDrone.Core.Indexers; | ||
using NzbDrone.Core.Test.Framework; | ||
|
||
namespace NzbDrone.Core.Test.IndexerTests | ||
{ | ||
[TestFixture] | ||
public class IndexerCapabilitiesCategoriesFixture : CoreTest<IndexerCapabilitiesCategories> | ||
{ | ||
[Test] | ||
public void should_support_parent_if_child_mapping() | ||
{ | ||
Subject.AddCategoryMapping(1, NewznabStandardCategory.MoviesSD, "Filme SD"); | ||
|
||
var categories = new int[] { 2000 }; | ||
|
||
var supported = Subject.SupportedCategories(categories); | ||
|
||
supported.Should().HaveCount(1); | ||
} | ||
|
||
[Test] | ||
public void should_support_category_if_mapped() | ||
{ | ||
Subject.AddCategoryMapping(1, NewznabStandardCategory.MoviesSD, "Filme SD"); | ||
|
||
var categories = new int[] { 2030 }; | ||
|
||
var supported = Subject.SupportedCategories(categories); | ||
|
||
supported.Should().HaveCount(1); | ||
} | ||
|
||
[Test] | ||
public void should_not_support_category_if_not_mapped() | ||
{ | ||
Subject.AddCategoryMapping(1, NewznabStandardCategory.MoviesSD, "Filme SD"); | ||
|
||
var categories = new int[] { 2040 }; | ||
|
||
var supported = Subject.SupportedCategories(categories); | ||
|
||
supported.Should().HaveCount(0); | ||
} | ||
|
||
[Test] | ||
public void should_get_tracker_category_list() | ||
{ | ||
Subject.AddCategoryMapping(1, NewznabStandardCategory.MoviesSD, "Filme SD"); | ||
Subject.AddCategoryMapping(2, NewznabStandardCategory.MoviesHD, "Filme HD"); | ||
|
||
var supported = Subject.GetTrackerCategories(); | ||
|
||
supported.Should().HaveCount(2); | ||
supported.First().Should().NotBeNull(); | ||
supported.First().Should().Be("1"); | ||
} | ||
|
||
[Test] | ||
public void should_get_category_by_tracker_id() | ||
{ | ||
Subject.AddCategoryMapping(1, NewznabStandardCategory.MoviesSD, "Filme SD"); | ||
Subject.AddCategoryMapping(2, NewznabStandardCategory.MoviesHD, "Filme HD"); | ||
|
||
var supported = Subject.MapTrackerCatToNewznab(2.ToString()); | ||
|
||
supported.Should().HaveCount(2); | ||
supported.First().Should().NotBeNull(); | ||
supported.First().Id.Should().Be(NewznabStandardCategory.MoviesHD.Id); | ||
} | ||
|
||
[Test] | ||
public void should_get_category_by_tracker_desc() | ||
{ | ||
Subject.AddCategoryMapping(1, NewznabStandardCategory.MoviesSD, "Filme SD"); | ||
Subject.AddCategoryMapping(2, NewznabStandardCategory.MoviesHD, "Filme HD"); | ||
|
||
var supported = Subject.MapTrackerCatDescToNewznab("Filme HD"); | ||
|
||
supported.Should().HaveCount(2); | ||
supported.First().Should().NotBeNull(); | ||
supported.First().Id.Should().Be(NewznabStandardCategory.MoviesHD.Id); | ||
} | ||
} | ||
} | ||
// using System.Linq; | ||
// using FluentAssertions; | ||
// using NUnit.Framework; | ||
// using NzbDrone.Core.Indexers; | ||
// using NzbDrone.Core.Test.Framework; | ||
// | ||
// namespace NzbDrone.Core.Test.IndexerTests | ||
// { | ||
// [TestFixture] | ||
// public class IndexerCapabilitiesCategoriesFixture : CoreTest<IndexerCapabilitiesCategories> | ||
// { | ||
// [Test] | ||
// public void should_support_parent_if_child_mapping() | ||
// { | ||
// Subject.AddCategoryMapping(1, NewznabStandardCategory.MoviesSD, "Filme SD"); | ||
// | ||
// var categories = new int[] { 2000 }; | ||
// | ||
// var supported = Subject.SupportedCategories(categories); | ||
// | ||
// supported.Should().HaveCount(1); | ||
// } | ||
// | ||
// [Test] | ||
// public void should_support_category_if_mapped() | ||
// { | ||
// Subject.AddCategoryMapping(1, NewznabStandardCategory.MoviesSD, "Filme SD"); | ||
// | ||
// var categories = new int[] { 2030 }; | ||
// | ||
// var supported = Subject.SupportedCategories(categories); | ||
// | ||
// supported.Should().HaveCount(1); | ||
// } | ||
// | ||
// [Test] | ||
// public void should_not_support_category_if_not_mapped() | ||
// { | ||
// Subject.AddCategoryMapping(1, NewznabStandardCategory.MoviesSD, "Filme SD"); | ||
// | ||
// var categories = new int[] { 2040 }; | ||
// | ||
// var supported = Subject.SupportedCategories(categories); | ||
// | ||
// supported.Should().HaveCount(0); | ||
// } | ||
// | ||
// [Test] | ||
// public void should_get_tracker_category_list() | ||
// { | ||
// Subject.AddCategoryMapping(1, NewznabStandardCategory.MoviesSD, "Filme SD"); | ||
// Subject.AddCategoryMapping(2, NewznabStandardCategory.MoviesHD, "Filme HD"); | ||
// | ||
// var supported = Subject.GetTrackerCategories(); | ||
// | ||
// supported.Should().HaveCount(2); | ||
// supported.First().Should().NotBeNull(); | ||
// supported.First().Should().Be("1"); | ||
// } | ||
// | ||
// [Test] | ||
// public void should_get_category_by_tracker_id() | ||
// { | ||
// Subject.AddCategoryMapping(1, NewznabStandardCategory.MoviesSD, "Filme SD"); | ||
// Subject.AddCategoryMapping(2, NewznabStandardCategory.MoviesHD, "Filme HD"); | ||
// | ||
// var supported = Subject.MapTrackerCatToNewznab(2.ToString()); | ||
// | ||
// supported.Should().HaveCount(2); | ||
// supported.First().Should().NotBeNull(); | ||
// supported.First().Id.Should().Be(NewznabStandardCategory.MoviesHD.Id); | ||
// } | ||
// | ||
// [Test] | ||
// public void should_get_category_by_tracker_desc() | ||
// { | ||
// Subject.AddCategoryMapping(1, NewznabStandardCategory.MoviesSD, "Filme SD"); | ||
// Subject.AddCategoryMapping(2, NewznabStandardCategory.MoviesHD, "Filme HD"); | ||
// | ||
// var supported = Subject.MapTrackerCatDescToNewznab("Filme HD"); | ||
// | ||
// supported.Should().HaveCount(2); | ||
// supported.First().Should().NotBeNull(); | ||
// supported.First().Id.Should().Be(NewznabStandardCategory.MoviesHD.Id); | ||
// } | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.