From e8be045d1267d137e574ece006cdae4f3a8e3f07 Mon Sep 17 00:00:00 2001
From: Mark McDowall <markus.mcd5@gmail.com>
Date: Wed, 29 Feb 2012 12:16:41 -0800
Subject: [PATCH] Fix: Newzbin will no longer include Full DVD releases, or
 other non-standard formats.

---
 .../Files/RSS/newzbin_full_dvd.xml            | 78 -------------------
 NzbDrone.Core.Test/IndexerTests.cs            | 16 ----
 NzbDrone.Core.Test/NzbDrone.Core.Test.csproj  |  3 -
 NzbDrone.Core/Providers/Indexer/Newzbin.cs    |  8 +-
 4 files changed, 1 insertion(+), 104 deletions(-)
 delete mode 100644 NzbDrone.Core.Test/Files/RSS/newzbin_full_dvd.xml

diff --git a/NzbDrone.Core.Test/Files/RSS/newzbin_full_dvd.xml b/NzbDrone.Core.Test/Files/RSS/newzbin_full_dvd.xml
deleted file mode 100644
index 5abdb2e95..000000000
--- a/NzbDrone.Core.Test/Files/RSS/newzbin_full_dvd.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<rss version="2.0" xml:lang="en-GB"
-xmlns:report="http://www.newzbin.com/DTD/2007/feeds/report/">
-  <channel>
-    <title>www.newzbin.com (reports)</title>
-    <link>http://www.newzbin.com/browse/category/p/tv/</link>
-    <description>Newzbin Reports Feed</description>
-    <pubDate>Mon, 25 Apr 2011 16:08:24 GMT</pubDate>
-    <ttl>42</ttl>
-    <generator>www.newzbin.com - Usenet Search</generator>
-    <copyright>Copyright (c) 2002 - 2007 Newzbin Limited. All Rights Reserved.</copyright>
-    <image>
-      <url>http://www.newzbin.com/m/i/logo/newzbinv3.png</url>
-      <link>http://www.newzbin.com/browse/category/p/tv/</link>
-      <title>www.newzbin.com</title>
-      <description>Visit Newzbin.com - The Ultimate In Usenet Indexing</description>
-    </image>
-    <item>
-      <title>Last Man Standing - Season 1 [DVD 1]</title>
-      <guid isPermaLink="true">https://newzbin2.es/browse/post/6514817/</guid>
-      <link>https://newzbin2.es/browse/post/6514817/</link>
-      <comments>https://newzbin2.es/browse/post/6514817/#CommentsPH</comments>
-      <description>
-        <![CDATA[
-			<ul>
-			<li>
-			ID: <a href="https://newzbin2.es/browse/post/6514817">6514817</a>
-			(<a
-			href="https://newzbin2.es/account/bookmarks/add/?ps_id=6514817">Bookmark</a>)
-			(<a href="https://newzbin2.es/browse/post/6514817/nzb/">NZB</a>)
-			(NFO)
-			(<a href="http://tvrage.com/Last_Man_Standing/episode_list/1">More Info</a>)
-			(Size: 5,056.7MiB)
-			</li>
-			<li>
-				Attributes:
-				Category - TV
-				|  Region System - NTSC |  Video Source - DVD |  Video Format - DVD |  Video Genre - Comedy |  Language - English |  Subtitled Language - Dutch
-			</li>
-			<li>Groups:  alt.binaries.boneless</li>
-			<li>Poster: CPP-gebruiker@domein.nl (Darkling)</li>
-			<li>PostDate: Saturday 25 Feb 2012, 06:57AM PST</li>
-			</ul>			]]>
-      </description>
-      <report:id>6514817</report:id>
-      <report:category>TV</report:category>
-      <report:attributes>
-        <report:attribute type="Region">NTSC</report:attribute>
-        <report:attribute type="Source">DVD</report:attribute>
-        <report:attribute type="Video Fmt">DVD</report:attribute>
-        <report:attribute type="Video Genre">Comedy</report:attribute>
-        <report:attribute type="Language">English</report:attribute>
-        <report:attribute type="Subtitles">Dutch</report:attribute>
-      </report:attributes>
-      <report:groups>
-        <report:group>alt.binaries.boneless</report:group>
-      </report:groups>
-      <report:progress value="1">Report is complete</report:progress>
-      <report:moreinfo>http://tvrage.com/Last_Man_Standing/episode_list/1</report:moreinfo>
-      <report:nfo>
-        <report:fileid>0</report:fileid>
-        <report:filename></report:filename>
-        <report:link></report:link>
-      </report:nfo>
-      <report:nzb>https://newzbin2.es/browse/post/6514817/nzb/</report:nzb>
-      <report:poster>CPP-gebruiker@domein.nl (Darkling)</report:poster>
-      <report:size type="bytes">5302349730</report:size>
-      <report:postdate>Sat, 25 Feb 2012 14:57:21 GMT</report:postdate>
-      <report:stats>
-        <report:views>3</report:views>
-        <report:comments>0</report:comments>
-      </report:stats>
-      <enclosure url="https://newzbin2.es/browse/post/6514817/nzb/"
-				length="5302349730" type="application/x-nzb" />
-      <pubDate>Mon, 27 Feb 2012 17:42:50 GMT</pubDate>
-    </item>
-  </channel>
-</rss>
\ No newline at end of file
diff --git a/NzbDrone.Core.Test/IndexerTests.cs b/NzbDrone.Core.Test/IndexerTests.cs
index ac1ccdfae..05e0fc562 100644
--- a/NzbDrone.Core.Test/IndexerTests.cs
+++ b/NzbDrone.Core.Test/IndexerTests.cs
@@ -458,22 +458,6 @@ namespace NzbDrone.Core.Test
             parseResults[0].Age.Should().Be(expectedAge);
         }
 
-        [Test]
-        public void newzbin_should_mark_full_dvd_report_as_unknown()
-        {
-            WithConfiguredIndexers();
-
-            Mocker.GetMock<HttpProvider>()
-                          .Setup(h => h.DownloadStream(It.IsAny<String>(), It.IsAny<NetworkCredential>()))
-                          .Returns(File.OpenRead(".\\Files\\Rss\\newzbin_full_dvd.xml"));
-
-            //Act
-            var parseResults = Mocker.Resolve<Newzbin>().FetchRss();
-
-            parseResults.Should().HaveCount(1);
-            parseResults[0].Quality.QualityType.Should().Be(QualityTypes.Unknown);
-        }
-
         private static void Mark500Inconclusive()
         {
             ExceptionVerification.MarkInconclusive(typeof(WebException));
diff --git a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj
index 79f973958..dbdf1a558 100644
--- a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj
+++ b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj
@@ -205,9 +205,6 @@
     <Content Include="Files\HistoryEmpty.txt">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
-    <Content Include="Files\RSS\newzbin_full_dvd.xml">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </Content>
     <Content Include="Files\Queue.txt">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
diff --git a/NzbDrone.Core/Providers/Indexer/Newzbin.cs b/NzbDrone.Core/Providers/Indexer/Newzbin.cs
index faa88df3d..74101a75b 100644
--- a/NzbDrone.Core/Providers/Indexer/Newzbin.cs
+++ b/NzbDrone.Core/Providers/Indexer/Newzbin.cs
@@ -22,7 +22,7 @@ namespace NzbDrone.Core.Providers.Indexer
         {
         }
 
-        private const string URL_PARAMS = "feed=rss&hauth=1&ps_rb_language=4096";
+        private const string URL_PARAMS = "feed=rss&hauth=1&ps_rb_language=4096&ps_rb_video_format=3082257";
 
         protected override string[] Urls
         {
@@ -108,12 +108,6 @@ namespace NzbDrone.Core.Providers.Indexer
                 var quality = Parser.ParseQuality(item.Summary.Text);
                 currentResult.Quality = quality;
 
-                if (Regex.IsMatch(item.Summary.Text, @"\|\s+Video Format - DVD\s+\|", RegexOptions.Compiled | RegexOptions.IgnoreCase))
-                {
-                    _logger.Trace("Report is a full DVD, setting Quality to False");
-                    currentResult.Quality = new Quality(QualityTypes.Unknown, false);
-                }
-
                 var languageString = Regex.Match(item.Summary.Text, @"Language - \w*", RegexOptions.IgnoreCase).Value;
                 currentResult.Language = Parser.ParseLanguage(languageString);