diff --git a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj index 158e24a14..88db4a0eb 100644 --- a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj +++ b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj @@ -86,7 +86,6 @@ - diff --git a/NzbDrone.Core.Test/RepoTest.cs b/NzbDrone.Core.Test/RepoTest.cs index 42f165b83..8d112ee18 100644 --- a/NzbDrone.Core.Test/RepoTest.cs +++ b/NzbDrone.Core.Test/RepoTest.cs @@ -65,7 +65,6 @@ namespace NzbDrone.Core.Test public void enteties_toString() { Console.WriteLine(new Episode().ToString()); - Console.WriteLine(new EpisodeModel().ToString()); } [Test] diff --git a/NzbDrone.Core.Test/RssProviderTest.cs b/NzbDrone.Core.Test/RssProviderTest.cs deleted file mode 100644 index 003c97d6d..000000000 --- a/NzbDrone.Core.Test/RssProviderTest.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Security.Policy; -using System.Text; -using Gallio.Framework; -using MbUnit.Framework; -using MbUnit.Framework.ContractVerifiers; -using Moq; -using NzbDrone.Core.Model; -using NzbDrone.Core.Providers; -using NzbDrone.Core.Providers.Core; -using Rss; - -namespace NzbDrone.Core.Test -{ - [TestFixture] - public class RssProviderTest - { - [Test] - public void GetFeed() - { - //Setup - var feedInfo = new FeedInfoModel("NzbMatrix", @"Files\Feed.nzbmatrix.com.xml"); - var target = new RssProvider(); - - //Act - var enumerable = target.GetFeed(feedInfo); - var result = new List(); - result.AddRange(enumerable); - - //Assert - Assert.GreaterThan(result.Count, 1); //Assert that the number of Items in the feed is greater than 1 - } - } -} diff --git a/NzbDrone.Core/CentralDispatch.cs b/NzbDrone.Core/CentralDispatch.cs index 62dc42127..0d6fecf9d 100644 --- a/NzbDrone.Core/CentralDispatch.cs +++ b/NzbDrone.Core/CentralDispatch.cs @@ -67,14 +67,10 @@ namespace NzbDrone.Core _kernel.Bind().To(); _kernel.Bind().To(); _kernel.Bind().To(); - _kernel.Bind().To(); _kernel.Bind().To(); _kernel.Bind().To(); _kernel.Bind().To().InSingletonScope(); _kernel.Bind().To().InSingletonScope(); - _kernel.Bind().To().InSingletonScope(); - _kernel.Bind().To().InSingletonScope(); - _kernel.Bind().To().InSingletonScope(); _kernel.Bind().To().InSingletonScope(); _kernel.Bind().To().InSingletonScope(); _kernel.Bind().To().InSingletonScope(); diff --git a/NzbDrone.Core/Libraries/RSS.NET.XML b/NzbDrone.Core/Libraries/RSS.NET.XML deleted file mode 100644 index e60b7797a..000000000 --- a/NzbDrone.Core/Libraries/RSS.NET.XML +++ /dev/null @@ -1,1388 +0,0 @@ - - - - RSS.NET - - - - The contents of a RssFeed - - - Initialize a new instance of the RssFeed class. - - - Initialize a new instance of the RssFeed class with a specified encoding. - - - Returns a string representation of the current Object. - The Url of the feed - - - Reads the specified RSS feed - The url or filename of the RSS feed - The contents of the feed - - - Reads the specified RSS feed - The specified way to connect to the web server - The contents of the feed - - - Reads the specified RSS feed - The cached version of the feed - The current contents of the feed - Will not download the feed if it has not been modified - - - Reads the specified RSS feed - The specified way to connect to the web server - The cached version of the feed - The current contents of the feed - Will not download the feed if it has not been modified - - - Writes the RSS feed to the specified stream. - specified Stream - The Stream cannot be written to. - Feed must contain at least one channel. - Channel must contain at least one item. - - - Writes the RSS feed to the specified file. - The encoding is ISO-8859-1. - The filename is empty, contains only white space, or contains one or more invalid characters. - Access is denied. - The filename is a (null c#, Nothing vb) reference. - The directory to write to is not found. - The filename includes an incorrect or invalid syntax for file name, directory name, or volume label syntax. - The caller does not have the required permission. - specified file (including path) If the file exists, it will be truncated with the new content. - Feed must contain at least one channel. - Channel must contain at least one item. - - - The channels that are contained in the feed. - - - The modules that the feed adhears to. - - - A collection of all exceptions encountered during the reading of the feed. - - - The Version of the feed. - - - The server generated hash of the feed. - - - The server generated last modfified date and time of the feed. - - - Indicates this feed has not been changed on the server, and the local copy was returned. - - - Location of the feed - - - Encoding of the feed - - - Provide information regarding the location of the subject matter of the channel in a taxonomy - - - Base class for all RSS elements - - - Initialize a new instance of the RssElement class - - - Initialize a new instance of the RssCategory class - - - Actual categorization given for this item, within the chosen taxonomy - - - URL of external taxonomy - - - A strongly typed collection of objects - - - Adds a specified channel to this collection. - The channel to add. - The zero-based index of the added channel. - - - Determines whether the RssChannelCollection contains a specific element. - The RssChannel to locate in the RssChannelCollection. - true if the RssChannelCollection contains the specified value; otherwise, false. - - - Copies the entire RssChannelCollection to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional RssChannel Array that is the destination of the elements copied from RssChannelCollection. The Array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - array is multidimensional. -or- index is equal to or greater than the length of array.-or-The number of elements in the source RssChannelCollection is greater than the available space from index to the end of the destination array. - - - Searches for the specified RssChannel and returns the zero-based index of the first occurrence within the entire RssChannelCollection. - The RssChannel to locate in the RssChannelCollection. - The zero-based index of the first occurrence of RssChannel within the entire RssChannelCollection, if found; otherwise, -1. - - - Inserts a channel into this collection at a specified index. - The zero-based index of the collection at which to insert the channel. - The channel to insert into this collection. - - - Removes a specified channel from this collection. - The channel to remove. - - - Gets or sets the channel at a specified index.In C#, this property is the indexer for the class. - The index of the collection to access. - A channel at each valid index. - This method is an indexer that can be used to access the collection. - index is not a valid index. - - - A reference to an attachment to the item - - - Initialize a new instance of the RssEnclosure class. - - - Where the enclosure is located - - - The size of the enclosure, in bytes - -1 represents a null. - - - A standard Multipurpose Internet Mail Extensions (MIME) type - - - Grouping of related content items on a site - - - Initialize a new instance of the RssChannel class. - - - Returns a string representation of the current Object. - The channel's title, description, or "RssChannel" if the title and description are blank. - - - The name of the channel - Maximum length is 100 characters (For RSS 0.91) - - - URL of the website named in the title - Maximum length is 500 characters (For RSS 0.91) - - - Description of the channel - Maximum length is 500 characters (For RSS 0.91) - - - Language the channel is written in - - - A link and description for a graphic icon that represent a channel - - - Copyright notice for content in the channel - Maximum length is 100 (For RSS 0.91) - - - The email address of the managing editor of the channel, the person to contact for editorial inquiries - - Maximum length is 100 (For RSS 0.91) - The suggested format for email addresses in RSS elements is - bull@mancuso.com (Bull Mancuso) - - - - The email address of the webmaster for the channel - - Person to contact if there are technical problems - Maximum length is 100 (For RSS 0.91) - The suggested format for email addresses in RSS elements is - bull@mancuso.com (Bull Mancuso) - - - - The PICS rating for the channel - Maximum length is 500 (For RSS 0.91) - - - The publication date for the content in the channel, expressed as the coordinated universal time (UTC) - - - The date-time the last time the content of the channel changed, expressed as the coordinated universal time (UTC) - - - One or more categories the channel belongs to. - - - A string indicating the program used to generate the channel - - - A URL, points to the documentation for the format used in the RSS file - Maximum length is 500 (For RSS 0.91). - - - Provides information about an HTTP GET feature, typically for a search or subscription - - - Readers should not read the channel during days listed. (UTC) - Days are listed in the array in the following order: - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday - Monday - - - - Readers should not read the channel during hours listed (UTC) - Represents a time in UTC - 1. - - - Allow processes to register with a cloud to be notified of updates to the channel - - - The number of minutes that a channel can be cached. - - - All items within the channel - - - People in a photo - - - A strongly typed collection of objects - - - Adds a specified item to this collection. - The item to add. - The zero-based index of the added item. - - - Determines whether the RssModuleItemCollection contains a specific element. - The RssModuleItem to locate in the RssModuleItemCollection. - true if the RssModuleItemCollection contains the specified value; otherwise, false. - - - Copies the entire RssModuleItemCollection to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional RssModuleItem Array that is the destination of the elements copied from RssModuleItemCollection. The Array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - array is multidimensional. -or- index is equal to or greater than the length of array.-or-The number of elements in the source RssModuleItemCollection is greater than the available space from index to the end of the destination array. - - - Searches for the specified RssModuleItem and returns the zero-based index of the first occurrence within the entire RssModuleItemCollection. - The RssModuleItem to locate in the RssModuleItemCollection. - The zero-based index of the first occurrence of RssModuleItem within the entire RssModuleItemCollection, if found; otherwise, -1. - - - Inserts an item into this collection at a specified index. - The zero-based index of the collection at which to insert the item. - The item to insert into this collection. - - - Removes a specified item from this collection. - The item to remove. - - - Bind a particular item to this module - Hash code of the item - - - Check if a particular item is bound to this module - Hash code of the item - true if this item is bound to this module, otherwise false - - - Gets or sets the item at a specified index.In C#, this property is the indexer for the class. - The index of the collection to access. - An item at each valid index. - This method is an indexer that can be used to access the collection. - index is not a valid index. - - - Initialize a new instance of the RssPhotoAlbumItemPhotoPeople class - - - Initialize a new instance of the RssPhotoAlbumItemPhotoPeople class - Name of person - - - Add a person to the photo - Name of person - The zero-based index of the added item - - - A collection of photos in a category - - - A strongly typed collection of objects - - - Adds a specified item to this collection. - The item to add. - The zero-based index of the added item. - - - Determines whether the RssModuleItemCollectionCollection contains a specific element. - The RssModuleItemCollection to locate in the RssModuleItemCollectionCollection. - true if the RssModuleItemCollectionCollection contains the specified value; otherwise, false. - - - Copies the entire RssModuleItemCollectionCollection to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional RssModuleItemCollection Array that is the destination of the elements copied from RssModuleItemCollectionCollection. The Array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - array is multidimensional. -or- index is equal to or greater than the length of array.-or-The number of elements in the source RssModuleItemCollectionCollection is greater than the available space from index to the end of the destination array. - - - Searches for the specified RssModuleItemCollection and returns the zero-based index of the first occurrence within the entire RssModuleItemCollectionCollection. - The RssModuleItemCollection to locate in the RssModuleItemCollectionCollection. - The zero-based index of the first occurrence of RssModuleItemCollection within the entire RssModuleItemCollectionCollection, if found; otherwise, -1. - - - Inserts an item into this collection at a specified index. - The zero-based index of the collection at which to insert the item. - The item to insert into this collection. - - - Removes a specified item from this collection. - The item to remove. - - - Gets or sets the item at a specified index.In C#, this property is the indexer for the class. - The index of the collection to access. - An item at each valid index. - This method is an indexer that can be used to access the collection. - index is not a valid index. - - - Initialize a new instance of the RssPhotoAlbumItemPhoto class - - - Adds a sepecified photo to this collection. - The photo to add. - The zero-based index of the added item. - - - A photo in the category - - - Initialize a new instance of the RssPhotoAlbumItemPhoto class - Date of the Photo - Description of the photo. - Direct link of the photo. - - - Initialize a new instance of the RssPhotoAlbumItemPhoto class - Date of the Photo - Description of the photo. - People to add to the photo. - Direct link of the photo. - - - Adds a specified item to this collection. - Date of the Photo - Description of the photo. - People to add to the photo. - Direct link of the photo. - The zero-based index of the added item. - - - Adds a specified item to this collection. - Date of the Photo - Description of the photo. - Direct link of the photo. - The zero-based index of the added item. - - - Initialize a new instance of the RssPhotoAlbumItemPhoto class - Date of the Photo - Description of the photo. - Direct link of the photo. - - - Initialize a new instance of the RssPhotoAlbumItemPhoto class - Date of the Photo - Description of the photo. - People to add to the photo. - Direct link of the photo. - - - Adds a specified item to this collection. - Date of the Photo - Description of the photo. - People to add to the photo. - Direct link of the photo. - The zero-based index of the added item. - - - Adds a specified item to this collection. - Date of the Photo - Description of the photo. - Direct link of the photo. - The zero-based index of the added item. - - - A collection of categories in a photo album - - - Initialize a new instance of the RssPhotoAlbumItemPhoto class - - - Adds a sepecified category to this collection. - The category to add. - The zero-based index of the added item. - - - A Photo Album category - - - Initialize a new instance of the RssPhotoAlbumItem class - Name of the category. - Description of the category. - From date of the category. - To date of the category. - Photos of the category. - - - Adds a specified category to this collection. - Name of the category. - Description of the category. - From date of the category. - To date of the category. - Photos of the category. - The zero-based index of the added item. - - - Initialize a new instance of the RssPhotoAlbumItem class - Name of the category. - Description of the category. - From date of the category. - To date of the category. - Photos of the category. - - - Adds a specified category to this collection. - Name of the category. - Description of the category. - From date of the category. - To date of the category. - Photos of the category. - The zero-based index of the added item. - - - Initialize a new instance of the RssPhotoAlbumItem class - Name of the category. - Description of the category. - From date of the category. - To date of the category. - Photos of the category. - - - Adds a specified category to this collection. - Name of the category. - Description of the category. - From date of the category. - To date of the category. - Photos of the category. - The zero-based index of the added item. - - - Initialize a new instance of the RssPhotoAlbumItem class - Name of the category. - Description of the category. - From date of the category. - To date of the category. - Photos of the category. - - - Adds a specified category to this collection. - Name of the category. - Description of the category. - From date of the category. - To date of the category. - Photos of the category. - The zero-based index of the added item. - - - RSS syndication for Robert A. Wlodarczyk's Photo Album application (to be sold by Inno Thinx LLC) - - - Base class for all RSS modules - - - Initialize a new instance of the RssModule class - - - Bind a particular channel to this module - Hash code of the channel - - - Check if a particular channel is bound to this module - Hash code of the channel - true if this channel is bound to this module, otherwise false - - - Collection of RSSModuleItem that are to be placed in the channel - - - Collection of RSSModuleItemCollection that are to be placed in the channel item - - - Prefix for the given module namespace - - - URL for the given module namespace - - - Initialize a new instance of the RssPhotoAlbum class - Link to the Photo Album - The category of the Photo Album to add - - - Initialize a new instance of the RssPhotoAlbum class - Link to the Photo Album - A collection of categories in the Photo Album to add - - - Link element for channel - - - Contains default values and methods for maintaining data consistency - - - Default value for a string in all RSS classes - empty string - If an element in the RSS class library has the value of RssDefault.String, consider the element as "not entered", "null", or empty. - - - Default value for an int in all RSS classes - -1 - If an element in the RSS class library has the value of RssDefault.Int, consider the element as "not entered", "null", or empty. - - - Default value for a DateTime in all RSS classes - DateTime.MinValue - If an element in the RSS class library has the value of RssDefault.DateTime, consider the element as "not entered", "null", or empty. - - - Default value for a Uri in all RSS classes - gopher://rss-net.sf.net - If an element in the RSS class library has the value of RssDefault.Uri, consider the element as "not entered", "null", or empty. - - - Verifies the string passed is not null - string to verify - RssDefault.String if input is null, otherwise input - Method is used in properties to prevent a null value - - - Verifies the int passed is greater than or equal to -1 - int to verify - RssDefault.Int if int is less than -1, else input - Method is used in properties to prevent values less than -1 - - - Verifies the Uri passed is not null - Uri to verify - RssDefault.Uri if input is null, otherwise input - Method is used in all properties to prevent a null value - - - Represents Null, False, and True - Source: Microsoft c# example - - - A DBBool containing 'Null'. - One of three possible DBBool values. - - - A DBBool containing 'False'. - One of three possible DBBool values. - - - A DBBool containing 'True'. - One of three possible DBBool values. - - - Private field that stores –1, 0, 1 for False, Null, True. - - - Private instance constructor. The value parameter must be –1, 0, or 1. - - - Implicit conversion from bool to DBBool. Maps true to DBBool.True and false to DBBool.False. - a DBBool - - - Explicit conversion from DBBool to bool. - The given DBBool is Null - a DBBool - true or false - - - Equality operator. - a DBBool - a DBBool - Returns Null if either operand is Null, otherwise returns True or False. - - - Inequality operator. - a DBBool - a DBBool - Returns Null if either operand is Null, otherwise returns True or False. - - - Logical negation operator. - a DBBool - Returns True if the operand is False, Null if the operand is Null, or False if the operand is True. - - - Logical AND operator. - a DBBool - a DBBool - Returns False if either operand is False, otherwise Null if either operand is Null, otherwise True. - - - Logical OR operator. - a DBBool - a DBBool - Returns True if either operand is True, otherwise Null if either operand is Null, otherwise False. - - - Definitely true operator. - a DBBool - Returns true if the operand is True, false otherwise. - - - Definitely false operator. - a DBBool - Returns true if the operand is False, false otherwise. - - - Determines whether two DBBool instances are equal. - The object to check. - True if the two DBBools are equal. - - - Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. - A hash code for the current DBBool. - - - Returns a string representation of the current Object. - Object has not been initialized. - A string containing DBBool.False, DBBool.Null, or DBBool.True - - - Properties to examine the value of a DBBool. - Return true if this DBBool has the given value, false otherwise. - - - Properties to examine the value of a DBBool. - Return true if this DBBool has the given value, false otherwise. - - - Properties to examine the value of a DBBool. - Return true if this DBBool has the given value, false otherwise. - - - A strongly typed collection of objects - - - Adds a specified item to this collection. - The item to add. - The zero-based index of the added item. - - - Determines whether the RssModuleCollection contains a specific element. - The RssModule to locate in the RssModuleCollection. - true if the RssModuleCollection contains the specified value; otherwise, false. - - - Copies the entire RssModuleCollection to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional RssModule Array that is the destination of the elements copied from RssModuleCollection. The Array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - array is multidimensional. -or- index is equal to or greater than the length of array.-or-The number of elements in the source RssModuleCollection is greater than the available space from index to the end of the destination array. - - - Searches for the specified RssModule and returns the zero-based index of the first occurrence within the entire RssModuleCollection. - The RssModule to locate in the RssModuleCollection. - The zero-based index of the first occurrence of RssModule within the entire RssModuleCollection, if found; otherwise, -1. - - - Inserts an item into this collection at a specified index. - The zero-based index of the collection at which to insert the item. - The item to insert into this collection. - - - Removes a specified item from this collection. - The item to remove. - - - Gets or sets the item at a specified index.In C#, this property is the indexer for the class. - The index of the collection to access. - An item at each valid index. - This method is an indexer that can be used to access the collection. - index is not a valid index. - - - A strongly typed collection of objects - - - Adds a specified item to this collection. - The item to add. - The zero-based index of the added item. - - - Determines whether the RssItemCollection contains a specific element. - The RssItem to locate in the RssItemCollection. - true if the RssItemCollection contains the specified value; otherwise, false. - - - Copies the entire RssItemCollection to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional RssItem Array that is the destination of the elements copied from RssItemCollection. The Array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - array is multidimensional. -or- index is equal to or greater than the length of array.-or-The number of elements in the source RssItemCollection is greater than the available space from index to the end of the destination array. - - - Searches for the specified RssItem and returns the zero-based index of the first occurrence within the entire RssItemCollection. - The RssItem to locate in the RssItemCollection. - The zero-based index of the first occurrence of RssItem within the entire RssItemCollection, if found; otherwise, -1. - - - Inserts an item into this collection at a specified index. - The zero-based index of the collection at which to insert the item. - The item to insert into this collection. - - - Removes a specified item from this collection. - The item to remove. - - - The latest pubDate in the items collection - The latest pubDate -or- RssDefault.DateTime if all item pubDates are not defined - - - The oldest pubDate in the items collection - The oldest pubDate -or- RssDefault.DateTime if all item pubDates are not defined - - - Calculates the oldest and latest pubdates - - - Gets or sets the item at a specified index.In C#, this property is the indexer for the class. - The index of the collection to access. - An item at each valid index. - This method is an indexer that can be used to access the collection. - index is not a valid index. - - - Allow processes to register with a cloud to be notified of updates to the channel. - - - Initialize a new instance of the RssCloud class. - - - Domain name or IP address of the cloud - - - TCP port that the cloud is running on - - - Location of its responder - - - Name of the procedure to call to request notification - - - Protocol used - - - A strongly typed collection of objects - - - Adds a specified feed to this collection. - The feed to add. - The zero-based index of the added feed. - - - Determines whether the RssFeedCollection contains a specific element. - The RssFeed to locate in the RssFeedCollection. - true if the RssFeedCollection contains the specified value; otherwise, false. - - - Copies the entire RssFeedCollection to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional RssFeed Array that is the destination of the elements copied from RssFeedCollection. The Array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - array is multidimensional. -or- index is equal to or greater than the length of array.-or-The number of elements in the source RssFeedCollection is greater than the available space from index to the end of the destination array. - - - Searches for the specified RssFeed and returns the zero-based index of the first occurrence within the entire RssFeedCollection. - The RssFeed to locate in the RssFeedCollection. - The zero-based index of the first occurrence of RssFeed within the entire RssFeedCollection, if found; otherwise, -1. - - - Inserts a feed into this collection at a specified index. - The zero-based index of the collection at which to insert the feed. - The feed to insert into this collection. - - - Removes a specified category from this collection. - The category to remove. - - - Gets or sets the feed at a specified index.In C#, this property is the indexer for the class. - The index of the collection to access. - A feed at each valid index. - This method is an indexer that can be used to access the collection. - index is not a valid index. - - - Gets or sets the feed with the given name.In C#, this property is the indexer for the class. - The url of the feed to access. - A feed at each valid url. If the feed does not exist, null. - This method is an indexer that can be used to access the collection. - - - A RSS module that adds elements at the channel level that are common to weblogs. - - - Initialize a new instance of the - The URL of an OPML file containing the blogroll for the site. - The URL of an OPML file containing the author's RSS subscriptions. - - The URL of a weblog that the author of the weblog is promoting per Mark Pilgrim's description. - "http://diveintomark.org/archives/2002/09/17.html#blink_and_youll_miss_it" - - - The URL of a changes.xml file. When the feed that contains this element updates, it pings a server that updates this file. The presence of this element says to aggregators that they only have to read the changes file to see if this feed has updated. If several feeds point to the same changes file, the aggregator has to do less polling, resulting in better use of server bandwidth, and the Internet as a whole; and resulting in faster scans. Everyone wins. For more technical information, see the howto on the XML-RPC site. - "http://www.xmlrpc.com/weblogsComForRss" - - - - All valid Rss Cloud protocols, including Null - - - Not defined - - - Protocol is not supported - - - xml-rpc - - - soap - - - http-post - - - All RSS versions - - - Not defined - - - Version is not directly supported - - - RDF Site Summary (RSS) 0.9 - - - Rich Site Summary (RSS) 0.91 - - - Rich Site Summary (RSS) 0.92 - - - RDF Site Summary (RSS) 1.0 - - - Really Simple Syndication (RSS) 2.0 - - - Writes an RSS XML file. - Represents a writer that provides a fast, non-cached, forward-only way of generating streams or files containing RSS XML data that conforms to the W3C Extensible Markup Language (XML) 1.0 and the Namespaces in XML recommendations. - - - Creates an instance of the RssWriter class using the specified TextWriter. - specified TextWriter - - - Creates an instance of the RssWriter class using the specified Stream and Encoding. - The encoding is not supported or the stream cannot be written to. - Stream to output to - The encoding to use. If encoding is (null c#, Nothing vb) it writes out the stream as UTF-8. - - - Creates an instance of the RssWriter class using the specified Stream. - The encoding is ISO-8859-1. - The Stream cannot be written to. - specified Stream - - - Creates an instance of the RssWriter class using the specified file and Encoding. - The encoding is not supported; the filename is empty, contains only white space, or contains one or more invalid characters. - Access is denied. - The filename is a (null c#, Nothing vb) reference. - The directory to write to is not found. - The filename includes an incorrect or invalid syntax for file name, directory name, or volume label syntax. - The caller does not have the required permission. - specified file (including path) If the file exists, it will be truncated with the new content. - specified Encoding - - - Creates an instance of the RssWriter class using the specified file. - The encoding is ISO-8859-1. - The filename is empty, contains only white space, or contains one or more invalid characters. - Access is denied. - The filename is a (null c#, Nothing vb) reference. - The directory to write to is not found. - The filename includes an incorrect or invalid syntax for file name, directory name, or volume label syntax. - The caller does not have the required permission. - specified file (including path) If the file exists, it will be truncated with the new content. - - - Writes the begining data to the RSS file - This routine is called from the WriteChannel and WriteItem subs - RDF Site Summary (RSS) 1.0 is not currently supported. - - - Closes instance of RssWriter. - Writes end elements, and releases connections - Occurs if the RssWriter is already closed or the caller is attempting to close before writing a channel. - - - Writes an RSS channel - RssWriter has been closed, and can not be written to. - Channel must be instanciated with data, before calling Write. - RSS channel to write - - - Writes an RSS item - Either the RssWriter has already been closed, or the caller is attempting to write an RSS item before an RSS channel. - Item must be instanciated with data, before calling Write. - RSS item to write - - - Writes an element with the specified local name and value - the localname of the element - the value of the element - boolean that determines if input cannot be null - - - Writes an element with the specified local name and value - the localname of the element - the value of the element - boolean that determines if input cannot be null - - - Writes an element with the specified local name and value - the localname of the element - the value of the element - boolean that determines if input cannot be null - - - Writes an element with the specified local name and value - the localname of the element - the value of the element - boolean that determines if input cannot be null - - - Writes an element with the specified local name and value - the localname of the element - the value of the element - boolean that determines if input cannot be null - - - Writes an attribute with the specified local name and value - the localname of the element - the value of the element - boolean that determines if input cannot be null - - - Writes an attribute with the specified local name and value - the localname of the element - the value of the element - boolean that determines if input cannot be null - - - Writes an attribute with the specified local name and value - the localname of the element - the value of the element - boolean that determines if input cannot be null - - - Writes an attribute with the specified local name and value - the localname of the element - the value of the element - boolean that determines if input cannot be null - - - Writes an attribute with the specified local name and value - the localname of the element - the value of the element - boolean that determines if input cannot be null - - - Gets or sets the RSS version to write. - Can't change version number after data has been written. - - - Gets or sets the of the XML output. - Can't change XML formatting after data has been written. - - - Gets or sets how indentation to write for each level in the hierarchy when XmlFormat is set to - Can't change XML formatting after data has been written. - Setting this property to a negative value. - - - RSS modules - - - Reads an RSS file. - Provides fast, non-cached, forward-only access to RSS data. - - - Initializes a new instance of the RssReader class with the specified URL or filename. - The URL or filename for the file containing the RSS data. - Occures when unable to retrieve file containing the RSS data. - - - Creates an instance of the RssReader class using the specified TextReader. - specified TextReader - Occures when unable to retrieve file containing the RSS data. - - - Creates an instance of the RssReader class using the specified Stream. - Occures when unable to retrieve file containing the RSS data. - Stream to read from - - - Reads the next RssElement from the stream. - An RSS Element - RssReader has been closed, and can not be read. - RSS file not found. - Invalid XML syntax in RSS file. - Unable to read an RssElement. Reached the end of the stream. - - - Closes connection to file. - This method also releases any resources held while reading. - - - A collection of all exceptions the RssReader class has encountered. - - - Gets the RSS version of the stream. - One of the values. - - - Globally unique identifier - - - Initialize a new instance of the RssGuid class. - - - If true, a url that can be opened in a web browser that points to the item - - - Globally unique identifier value - - - A link and description for a graphic that represent a channel - - - Initialize a new instance of the RssImage class. - - - The URL of a GIF, JPEG or PNG image that represents the channel. - Maximum length is 500 (For RSS 0.91). - - - Describes the image, it's used in the ALT attribute of the HTML img tag when the channel is rendered in HTML. - Maximum length is 100 (For RSS 0.91). - - - The URL of the site, when the channel is rendered, the image is a link to the site. - Maximum length is 500 (For RSS 0.91). - - - Contains text that is included in the TITLE attribute of the link formed around the image in the HTML rendering. - - - Width of image in pixels - Maximum value for height is 400 (For RSS 0.91) - - - Height of image in pixels - Maximum value for width is 144 (For RSS 0.91) - - - A module may contain any number of items (either channel-based or item-based). - - - Initialize a new instance of the RssModuleItem class - - - Initialize a new instance of the RssModuleItem class - The name of this RssModuleItem. - - - Initialize a new instance of the RssModuleItem class - The name of this RssModuleItem. - Is text required for this RssModuleItem? - - - Initialize a new instance of the RssModuleItem class - The name of this RssModuleItem. - The text contained within this RssModuleItem. - - - Initialize a new instance of the RssModuleItem class - The name of this RssModuleItem. - Is text required for this RssModuleItem? - The text contained within this RssModuleItem. - - - Initialize a new instance of the RssModuleItem class - The name of this RssModuleItem. - The text contained within this RssModuleItem. - The sub-elements of this RssModuleItem (if any exist). - - - Initialize a new instance of the RssModuleItem class - The name of this RssModuleItem. - Is text required for this RssModuleItem? - The text contained within this RssModuleItem. - The sub-elements of this RssModuleItem (if any exist). - - - Returns a string representation of the current Object. - The item's title, description, or "RssModuleItem" if the title and description are blank. - - - - The name of this RssModuleItem. - - - - - The text contained within this RssModuleItem. - - - - - The sub-elements of this RssModuleItem (if any exist). - - - - - Is text for this element required? - - - - Describes an items source - - - Initialize a new instance of the RssSource class - - - Name of the RSS channel that the item came from - - - URL of the original RSS feed from which the item was republished - - - A strongly typed collection of objects - - - Adds a specified exception to this collection. - The exception to add. - The zero-based index of the added exception -or- -1 if the exception already exists. - - - Determines whether the ExceptionCollection contains a specific element. - The Exception to locate in the ExceptionCollection. - true if the ExceptionCollection contains the specified value; otherwise, false. - - - Copies the entire ExceptionCollection to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional Exception Array that is the destination of the elements copied from ExceptionCollection. The Array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - array is multidimensional. -or- index is equal to or greater than the length of array.-or-The number of elements in the source ExceptionCollection is greater than the available space from index to the end of the destination array. - - - Searches for the specified Exception and returns the zero-based index of the first occurrence within the entire ExceptionCollection. - The Exception to locate in the ExceptionCollection. - The zero-based index of the first occurrence of RssChannel within the entire ExceptionCollection, if found; otherwise, -1. - - - Inserts an Exception into this collection at a specified index. - The zero-based index of the collection at which to insert the Exception. - The Exception to insert into this collection. - - - Removes a specified Exception from this collection. - The Exception to remove. - - - Gets or sets the exception at a specified index.In C#, this property is the indexer for the class. - The index of the collection to access. - A exception at each valid index. - This method is an indexer that can be used to access the collection. - - - Returns the last exception added through the Add method. - The last exception -or- null if no exceptions exist - - - A strongly typed collection of objects - - - Adds a specified category to this collection. - The category to add. - The zero-based index of the added category. - - - Determines whether the RssCategoryCollection contains a specific element. - The RssCategory to locate in the RssCategoryCollection. - true if the RssCategoryCollection contains the specified value; otherwise, false. - - - Copies the entire RssCategoryCollection to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional RssCategory Array that is the destination of the elements copied from RssCategoryCollection. The Array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - array is multidimensional. -or- index is equal to or greater than the length of array.-or-The number of elements in the source RssCategoryCollection is greater than the available space from index to the end of the destination array. - - - Searches for the specified RssCategory and returns the zero-based index of the first occurrence within the entire RssCategoryCollection. - The RssCategory to locate in the RssCategoryCollection. - The zero-based index of the first occurrence of RssCategory within the entire RssCategoryCollection, if found; otherwise, -1. - - - Inserts an category into this collection at a specified index. - The zero-based index of the collection at which to insert the category. - The category to insert into this collection. - - - Removes a specified category from this collection. - The category to remove. - - - Gets or sets the category at a specified index.In C#, this property is the indexer for the class. - The index of the collection to access. - A category at each valid index. - This method is an indexer that can be used to access the collection. - index is not a valid index. - - - A RSS module that adds elements at the channel or item level that specifies which Creative Commons license applies. - - - Initialize a new instance of the - - If present as a sub-element of channel, indicates that the content of the RSS file is available under a license, indicated by a URL, which is the value of the license element. A list of some licenses that may be used in this context is on the Creative Commons website on this page, however the license element may point to licenses not authored by Creative Commons. - You may also use the license element as a sub-element of item. When used this way it applies only to the content of that item. If an item has a license, and the channel does too, the license on the item applies, i.e. the inner license overrides the outer one. - Multiple license elements are allowed, in either context, indicating that the content is available under multiple licenses. - "http://www.creativecommons.org/licenses/" - - If present as a sub-element of channel then true, otherwise false - - - A channel may contain any number of items, each of which links to more information about the item, with an optional description - - - Initialize a new instance of the RssItem class - - - Returns a string representation of the current Object. - The item's title, description, or "RssItem" if the title and description are blank. - - - Title of the item - Maximum length is 100 (For RSS 0.91) - - - URL of the item - Maximum length is 500 (For RSS 0.91) - - - Item synopsis - Maximum length is 500 (For RSS 0.91) - - - Email address of the author of the item - - - Provide information regarding the location of the subject matter of the channel in a taxonomy - - - URL of a page for comments relating to the item - - - Describes an items source - - - A reference to an attachment to the item - - - A string that uniquely identifies the item - - - Indicates when the item was published - - - Multi-purpose channel element for the purpose of allowing users to submit queries back to the publisher's site - Typically for a search or subscription - - - Initialize a new instance of the RssTextInput class - - - The label of the submit button in the text input area - Maximum length is 100 (For RSS 0.91) - - - Explains the text input area - Maximum length is 500 (For RSS 0.91) - - - The name of the text object in the text input area - Maximum length is 20 (For RSS 0.91). - - - The URL of the script that processes text input requests - Maximum length is 500 (For RSS 0.91) - - - diff --git a/NzbDrone.Core/Libraries/RSS.NET.dll b/NzbDrone.Core/Libraries/RSS.NET.dll deleted file mode 100644 index 10dd1f774..000000000 Binary files a/NzbDrone.Core/Libraries/RSS.NET.dll and /dev/null differ diff --git a/NzbDrone.Core/Model/FeedInfoModel.cs b/NzbDrone.Core/Model/FeedInfoModel.cs deleted file mode 100644 index 98c979b6d..000000000 --- a/NzbDrone.Core/Model/FeedInfoModel.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace NzbDrone.Core.Model -{ - public class FeedInfoModel - { - public FeedInfoModel(string name, string url) - { - Name = name ?? "UN-NAMED"; - Url = ParseUrl(url); - } - - public string Name { get; private set; } - public string Url { get; private set; } - - private static string ParseUrl(string url) - { - Uri uri; - if (!Uri.TryCreate(url, UriKind.Absolute, out uri)) - { - uri = new Uri(new Uri(CentralDispatch.ExecutablePath + Path.DirectorySeparatorChar), url); - } - return uri.IsFile ? uri.AbsolutePath.Replace("%20", " ") : uri.AbsoluteUri; - } - - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != typeof(FeedInfoModel)) return false; - return Equals((FeedInfoModel) obj); - } - - public bool Equals(FeedInfoModel other) - { - if (ReferenceEquals(null, other)) return false; - if (ReferenceEquals(this, other)) return true; - return Equals(other.Name, Name) && Equals(other.Url, Url); - } - - public override int GetHashCode() - { - unchecked - { - return ((Name != null ? Name.GetHashCode() : 0)*397) ^ (Url != null ? Url.GetHashCode() : 0); - } - } - } -} diff --git a/NzbDrone.Core/Model/NzbInfoModel.cs b/NzbDrone.Core/Model/NzbInfoModel.cs index aa816e431..7722d3f3b 100644 --- a/NzbDrone.Core/Model/NzbInfoModel.cs +++ b/NzbDrone.Core/Model/NzbInfoModel.cs @@ -10,10 +10,7 @@ namespace NzbDrone.Core.Model public class NzbInfoModel { public string Title { get; set; } - public string TitleFix { get; set; } public Uri Link { get; set; } - public bool Proper { get; set; } - public QualityTypes Quality { get; set; } public bool IsPassworded() { diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index b7d348a57..191738098 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -137,10 +137,6 @@ False Libraries\NLog.Extended.dll - - False - Libraries\RSS.NET.dll - D:\OpenSource\sabscripts\SABSync\References\SubSonic.Core.dll @@ -172,13 +168,11 @@ - - @@ -191,9 +185,7 @@ - - @@ -201,9 +193,6 @@ - - - @@ -280,8 +269,6 @@ - - diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index 37c57621c..df6491f50 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -8,7 +8,6 @@ using NLog; using NzbDrone.Core.Model; using NzbDrone.Core.Providers; using NzbDrone.Core.Repository.Quality; -using Rss; namespace NzbDrone.Core { @@ -38,7 +37,7 @@ namespace NzbDrone.Core { Logger.Trace("Parsing string '{0}'", title); - foreach (var regex in ReportTitleRegex) + foreach (var regex in ReportTitleRegex) { var match = regex.Matches(title); @@ -55,6 +54,7 @@ namespace NzbDrone.Core var parsedEpisode = new EpisodeParseResult { + Proper = title.ToLower().Contains("proper"), SeriesTitle = seriesName, SeasonNumber = Convert.ToInt32(match[0].Groups["season"].Value), Year = year, @@ -256,14 +256,6 @@ namespace NzbDrone.Core return info.FullName.Trim('/', '\\', ' '); } - public static NzbInfoModel ParseNzbInfo(FeedInfoModel feed, RssItem item) - { - - return new NzbInfoModel - { - Title = item.Title, - Link = item.Link - }; - } + } } diff --git a/NzbDrone.Core/Providers/BacklogProvider.cs b/NzbDrone.Core/Providers/BacklogProvider.cs deleted file mode 100644 index 60e2f3078..000000000 --- a/NzbDrone.Core/Providers/BacklogProvider.cs +++ /dev/null @@ -1,280 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading; -using NLog; -using NzbDrone.Core.Helpers; -using NzbDrone.Core.Model; -using NzbDrone.Core.Model.Notification; -using NzbDrone.Core.Providers.Core; -using NzbDrone.Core.Repository; -using Rss; - -namespace NzbDrone.Core.Providers -{ - public class BacklogProvider : IBacklogProvider - { - private readonly ISeriesProvider _seriesProvider; - private readonly INotificationProvider _notificationProvider; - private readonly IConfigProvider _configProvider; - private readonly IIndexerProvider _indexerProvider; - private readonly IRssProvider _rssProvider; - private readonly IRssItemProcessingProvider _rssItemProcessor; - - private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - private List _seriesList; - private Thread _backlogThread; - private ProgressNotification _backlogSearchNotification; - - public BacklogProvider(ISeriesProvider seriesProvider, INotificationProvider notificationProvider, - IConfigProvider configProvider, IIndexerProvider indexerProvider, - IRssProvider rssProvider, IRssItemProcessingProvider _rssItemProcessor) - { - _seriesProvider = seriesProvider; - _notificationProvider = notificationProvider; - _configProvider = configProvider; - _indexerProvider = indexerProvider; - _rssProvider = rssProvider; - - _seriesList = new List(); - } - - #region IBacklogProvider Members - - public bool StartSearch() - { - Logger.Debug("Backlog Search Requested"); - if (_backlogThread == null || !_backlogThread.IsAlive) - { - Logger.Debug("Initializing Backlog Search"); - _backlogThread = new Thread(PerformSearch) - { - Name = "BacklogSearch", - Priority = ThreadPriority.Lowest - }; - - _seriesList.AddRange(_seriesProvider.GetAllSeries()); - _backlogThread.Start(); - } - else - { - Logger.Warn("Backlog Search already in progress. Ignoring request."); - - //return false if backlog search was already running - return false; - } - - //return true if backlog search has started - return true; - } - - public bool StartSearch(int seriesId) - { - //Get the series - //Start new Thread if one isn't already started - - Logger.Debug("Backlog Search Requested"); - if (_backlogThread == null || !_backlogThread.IsAlive) - { - Logger.Debug("Initializing Backlog Search"); - _backlogThread = new Thread(PerformSearch) - { - Name = "BacklogSearch", - Priority = ThreadPriority.Lowest - }; - - var series = _seriesProvider.GetSeries(seriesId); - - if (series == null) - { - Logger.Debug("Invalid Series - Not starting Backlog Search"); - return false; - } - - _seriesList.Add(series); - _backlogThread.Start(); - } - else - { - Logger.Warn("Backlog Search already in progress. Ignoring request."); - - //return false if backlog search was already running - return false; - } - - //return true if backlog search has started - return true; - } - - #endregion - - private void PerformSearch() - { - try - { - using (_backlogSearchNotification = new ProgressNotification("Series Scan")) - { - _notificationProvider.Register(_backlogSearchNotification); - _backlogSearchNotification.CurrentStatus = "Starting Backlog Search"; - _backlogSearchNotification.ProgressMax = _seriesList.Count; - - foreach (var series in _seriesList) - { - BackLogSeries(series); - } - - _backlogSearchNotification.CurrentStatus = "Backlog Search Completed"; - Logger.Info("Backlog Search has successfully completed."); - Thread.Sleep(3000); - _backlogSearchNotification.Status = ProgressNotificationStatus.Completed; - } - } - - catch (Exception ex) - { - Logger.WarnException(ex.Message, ex); - } - } - - private void BackLogSeries(Series series) - { - try - { - //Do the searching here - _backlogSearchNotification.CurrentStatus = String.Format("Backlog Searching For: {0}", series.Title); - - var sceneNames = SceneNameHelper.FindById(series.SeriesId); - - if (sceneNames.Count < 1) - sceneNames.Add(series.Title); - - foreach (var season in series.Seasons) - { - BackLogSeason(sceneNames, season); - } - //Done searching for each episode - } - - catch (Exception ex) - { - Logger.WarnException(ex.Message, ex); - } - - _backlogSearchNotification.ProgressValue++; - } - - private void BackLogSeason(List sceneNames, Season season) - { - var episodesWithoutFiles = season.Episodes.Where(e => e.EpisodeFileId == 0); - - if (season.Episodes.Count() == episodesWithoutFiles.Count()) - { - //Whole season needs to be grabbed, look for the whole season first - //Lookup scene name using seriesId - - foreach (var sceneName in sceneNames) - { - var searchString = String.Format("{0} Season {1}", sceneName, - season.SeasonNumber); - - foreach (var i in _indexerProvider.EnabledIndexers()) - { - //Get the users URL - GetUsersUrl(i, searchString); - - //If the url still contains '{' & '}' the user probably hasn't configured the indexer settings - if (i.ApiUrl.Contains("{") && i.ApiUrl.Contains("}")) - { - Logger.Debug("Unable to Sync {0}. User Information has not been configured.", i.IndexerName); - continue; //Skip this indexer - } - - var indexer = new FeedInfoModel(i.IndexerName, i.ApiUrl); - - var feedItems = _rssProvider.GetFeed(indexer); - - if (feedItems.Count() == 0) - { - Logger.Debug("Failed to download Backlog Search URL: {0}", indexer.Name); - continue; //No need to process anything else - } - - foreach (RssItem item in feedItems) - { - NzbInfoModel nzb = Parser.ParseNzbInfo(indexer, item); - QueueSeasonIfWanted(nzb, i); - } - - } - } - } - } - - private void GetUsersUrl(Indexer indexer, string searchString) - { - if (indexer.IndexerName == "NzbMatrix") - { - var nzbMatrixUsername = _configProvider.GetValue("NzbMatrixUsername", String.Empty, false); - var nzbMatrixApiKey = _configProvider.GetValue("NzbMatrixApiKey", String.Empty, false); - var retention = Convert.ToInt32(_configProvider.GetValue("Retention", String.Empty, false)); - - if (!String.IsNullOrEmpty(nzbMatrixUsername) && !String.IsNullOrEmpty(nzbMatrixApiKey)) - indexer.ApiUrl = indexer.ApiUrl.Replace("{USERNAME}", nzbMatrixUsername).Replace("{APIKEY}", nzbMatrixApiKey).Replace("{AGE}", retention.ToString()).Replace("{TERM}", searchString); - - //Todo: Perform validation at the config level so a user is unable to enable a provider until user details are provided - return; - } - - if (indexer.IndexerName == "NzbsOrg") - { - var nzbsOrgUId = _configProvider.GetValue("NzbsOrgUId", String.Empty, false); - var nzbsOrgHash = _configProvider.GetValue("NzbsOrgHash", String.Empty, false); - - if (!String.IsNullOrEmpty(nzbsOrgUId) && !String.IsNullOrEmpty(nzbsOrgHash)) - indexer.RssUrl = indexer.RssUrl.Replace("{UID}", nzbsOrgUId).Replace("{HASH}", nzbsOrgHash); - - //Todo: Perform validation at the config level so a user is unable to enable a provider until user details are provided - return; - } - - if (indexer.IndexerName == "NzbsOrg") - { - var nzbsrusUId = _configProvider.GetValue("NzbsrusUId", String.Empty, false); - var nzbsrusHash = _configProvider.GetValue("NzbsrusHash", String.Empty, false); - - if (!String.IsNullOrEmpty(nzbsrusUId) && !String.IsNullOrEmpty(nzbsrusHash)) - indexer.RssUrl = indexer.RssUrl.Replace("{UID}", nzbsrusUId).Replace("{HASH}", nzbsrusHash); - - //Todo: Perform validation at the config level so a user is unable to enable a provider until user details are provided - return; - } - - return; //Currently other providers do not require user information to be substituted, simply return - } - - private void QueueSeasonIfWanted(NzbInfoModel nzb, Indexer indexer) - { - //Do we want this item? - try - { - if (nzb.IsPassworded()) - { - Logger.Debug("Skipping Passworded Report {0}", nzb.Title); - return; - } - - //Need to get REGEX that will handle "Show Name Season 1 quality" - nzb.TitleFix = String.Empty; - nzb.TitleFix = String.Format("{0} [{1}]", nzb.TitleFix, nzb.Quality); //Add Quality to the titleFix - - } - - catch (Exception ex) - { - Logger.DebugException(ex.Message, ex); - } - } - } -} diff --git a/NzbDrone.Core/Providers/Core/IRssProvider.cs b/NzbDrone.Core/Providers/Core/IRssProvider.cs deleted file mode 100644 index 45da1442e..000000000 --- a/NzbDrone.Core/Providers/Core/IRssProvider.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; -using NzbDrone.Core.Model; -using Rss; - -namespace NzbDrone.Core.Providers.Core -{ - public interface IRssProvider - { - IEnumerable GetFeed(FeedInfoModel feedInfo); - } -} diff --git a/NzbDrone.Core/Providers/Core/RssProvider.cs b/NzbDrone.Core/Providers/Core/RssProvider.cs deleted file mode 100644 index 017c26630..000000000 --- a/NzbDrone.Core/Providers/Core/RssProvider.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NLog; -using NzbDrone.Core.Model; -using Rss; - -namespace NzbDrone.Core.Providers.Core -{ - public class RssProvider : IRssProvider - { - private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - - #region IRssProvider Members - public IEnumerable GetFeed(FeedInfoModel feedInfo) - { - RssFeed feed = null; - try - { - Logger.Info("INFO: Downloading feed {0} from {1}", feedInfo.Name, feedInfo.Url); - feed = RssFeed.Read(feedInfo.Url); - } - catch (Exception e) - { - Logger.ErrorException(String.Format("ERROR: Could not download feed {0} from {1}", feedInfo.Name, feedInfo.Url), e); - } - if (feed == null || feed.Channels == null || feed.Channels.Count == 0) - return Enumerable.Empty(); - return feed.Channels[0].Items.Cast(); - } - #endregion - } -} diff --git a/NzbDrone.Core/Providers/IRssItemProcessingProvider.cs b/NzbDrone.Core/Providers/IRssItemProcessingProvider.cs deleted file mode 100644 index bf596d348..000000000 --- a/NzbDrone.Core/Providers/IRssItemProcessingProvider.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NzbDrone.Core.Model; -using NzbDrone.Core.Repository; - -namespace NzbDrone.Core.Providers -{ - public interface IRssItemProcessingProvider - { - //This interface will contain methods to process individual RSS Feed Items (Queue if wanted) - - void DownloadIfWanted(NzbInfoModel nzb, Indexer indexer); - string GetTitleFix(EpisodeParseResult episodes); - } -} diff --git a/NzbDrone.Core/Providers/RssItemProcessingProvider.cs b/NzbDrone.Core/Providers/RssItemProcessingProvider.cs deleted file mode 100644 index 9d5b8a611..000000000 --- a/NzbDrone.Core/Providers/RssItemProcessingProvider.cs +++ /dev/null @@ -1,337 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using NLog; -using NzbDrone.Core.Helpers; -using NzbDrone.Core.Model; -using NzbDrone.Core.Providers.Core; -using NzbDrone.Core.Repository; - -namespace NzbDrone.Core.Providers -{ - public class RssItemProcessingProvider : IRssItemProcessingProvider - { - private ISeriesProvider _seriesProvider; - private ISeasonProvider _seasonProvider; - private IEpisodeProvider _episodeProvider; - private IHistoryProvider _historyProvider; - private IDownloadProvider _sabProvider; - private IConfigProvider _configProvider; - private IHttpProvider _httpProvider; - private IDiskProvider _diskProvider; - - private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - - public RssItemProcessingProvider(ISeriesProvider seriesProvider, ISeasonProvider seasonProvider, - IEpisodeProvider episodeProvider, IHistoryProvider historyProvider, - IDownloadProvider sabProvider, IConfigProvider configProvider, - IHttpProvider httpProvider, IDiskProvider diskProvider) - { - _seriesProvider = seriesProvider; - _seasonProvider = seasonProvider; - _episodeProvider = episodeProvider; - _historyProvider = historyProvider; - _sabProvider = sabProvider; - _configProvider = configProvider; - _httpProvider = httpProvider; - _diskProvider = diskProvider; - } - - #region IRssItemProcessingProvider Members - - public void DownloadIfWanted(NzbInfoModel nzb, Indexer indexer) - { - //Do we want this item? - try - { - if (nzb.IsPassworded()) - { - Logger.Debug("Skipping Passworded Report {0}", nzb.Title); - return; - } - - var episodeParseResults = Parser.ParseEpisodeInfo(nzb.Title); - - if (episodeParseResults.Episodes.Count() > 0) - { - ProcessStandardItem(nzb, indexer, episodeParseResults); - return; - } - - //Handles Full Season NZBs - var seasonParseResult = Parser.ParseSeasonInfo(nzb.Title); - - if (seasonParseResult != null) - { - ProcessFullSeasonItem(nzb, indexer, seasonParseResult); - return; - } - - Logger.Debug("Unsupported Title: {0}", nzb.Title); - } - - catch (Exception ex) - { - Logger.Error("Unsupported Title: {0}", nzb.Title); - Logger.ErrorException("Error Parsing/Processing NZB: " + ex.Message, ex); - } - } - - public string GetTitleFix(EpisodeParseResult episodes) - { - int seasonNumber = 0; - string episodeNumbers = String.Empty; - string episodeTitles = String.Empty; - - foreach (var episode in episodes.Episodes) - { - var episodeInDb = _episodeProvider.GetEpisode(episodes.SeriesId, episodes.SeasonNumber, episode); - - if (episodeInDb == null) - { - //Todo: Handle this some other way? - Logger.Debug("Episode Not found in Database, Fake it..."); - //return String.Format("{0} - {1:00}x{2}", series.Title, episode.SeasonNumber, episode.EpisodeNumber); - episodeInDb = new Episode { EpisodeNumber = episode, Title = "TBA" }; - } - - seasonNumber = episodes.SeasonNumber; - episodeNumbers = String.Format("{0}x{1:00}", episodeNumbers, episodeInDb.EpisodeNumber); - episodeTitles = String.Format("{0} + {1}", episodeTitles, episodeInDb.Title); - } - - episodeTitles = episodeTitles.Trim(' ', '+'); - - return String.Format("{0} - {1}{2} - {3}", episodes.SeriesTitle, seasonNumber, episodeNumbers, episodeTitles); - } - - #endregion - - private void ProcessStandardItem(NzbInfoModel nzb, Indexer indexer, EpisodeParseResult episodeParseResults) - { - //Will try to match via NormalizeTitle, if that fails it will look for a scene name and do a lookup for your shows - var series = _seriesProvider.FindSeries(episodeParseResults.SeriesTitle); - - if (series == null) - { - //If we weren't able to find a title using the clean name, lets try again looking for a scene name - - var sceneId = SceneNameHelper.FindByName(episodeParseResults.SeriesTitle); - - if (sceneId != 0) - series = _seriesProvider.GetSeries(sceneId); - - if (series == null) - { - Logger.Debug("Show is not being watched: {0}", episodeParseResults.SeriesTitle); - return; - } - } - - Logger.Debug("Show is being watched: {0}", series.Title); - - nzb.Proper = Parser.ParseProper(nzb.Title); - nzb.Quality = episodeParseResults.Quality; - - //Loop through the list of the episodeParseResults to ensure that all the episodes are needed - foreach (var episode in episodeParseResults.Episodes) - { - - if (!_episodeProvider.IsNeeded(episodeParseResults)) - return; - - var titleFix = GetTitleFix(episodeParseResults); - titleFix = String.Format("{0} [{1}]", titleFix, nzb.Quality); //Add Quality to the titleFix - - //If it is a PROPER we want to put PROPER in the titleFix - if (nzb.Proper) - titleFix = String.Format("{0} [PROPER]", titleFix); - - if (!Convert.ToBoolean(_configProvider.GetValue("UseBlackhole", true, true))) - if (_sabProvider.IsInQueue(titleFix)) - return; - } - - nzb.TitleFix = GetTitleFix(episodeParseResults); //Get the TitleFix so we can use it later - nzb.TitleFix = String.Format("{0} [{1}]", nzb.TitleFix, nzb.Quality); //Add Quality to the titleFix - - //If it is a PROPER we want to put PROPER in the titleFix - if (nzb.Proper) - nzb.TitleFix = String.Format("{0} [PROPER]", nzb.TitleFix); - - if (Convert.ToBoolean(_configProvider.GetValue("UseBlackHole", true, true))) - { - //if (DownloadNzb(nzb)) - //AddToHistory(episodeParseResults, nzb, indexer); - } - - //Send it to SABnzbd - else - { - //Only need to do this check if it contains more than one episode (because we already checked individually before) - if (episodeParseResults.Episodes.Count > 1) - { - if (_sabProvider.IsInQueue(nzb.TitleFix)) - return; - } - - if (indexer.IndexerName != "Newzbin") - { - //if (_sabProvider.AddByUrl(nzb.Link.ToString(), nzb.TitleFix)) - //AddToHistory(_episodeProvider.GetEpisode(episodeParseResults.), series, nzb, indexer); - } - - - } - } - - private void ProcessFullSeasonItem(NzbInfoModel nzb, Indexer indexer, SeasonParseResult seasonParseResult) - { - //Will try to match via NormalizeTitle, if that fails it will look for a scene name and do a lookup for your shows - var series = _seriesProvider.FindSeries(seasonParseResult.SeriesTitle); - - if (series == null) - { - //If we weren't able to find a title using the clean name, lets try again looking for a scene name - - var sceneId = SceneNameHelper.FindByName(seasonParseResult.SeriesTitle); - - if (sceneId != 0) - series = _seriesProvider.GetSeries(sceneId); - - if (series == null) - { - Logger.Debug("Show is not being watched: {0}", seasonParseResult.SeriesTitle); - return; - } - } - - Logger.Debug("Show is being watched: {0}", series.Title); - - nzb.Proper = Parser.ParseProper(nzb.Title); - nzb.Quality = seasonParseResult.Quality; - - if (!_seriesProvider.QualityWanted(series.SeriesId, nzb.Quality)) - { - Logger.Info("Quality [{0}] is not wanted for: {1}", nzb.Quality, series.Title); - return; - } - - var season = _seasonProvider.GetSeason(series.SeriesId, seasonParseResult.SeasonNumber); - - if (season == null) - return; - - if (_seasonProvider.IsIgnored(season.SeriesId)) - return; - - //Check to see if this is an upgrade for all our files - - var episodesWithoutFiles = season.Episodes.Where(e => e.EpisodeFileId == 0); - - var downloadWholeSeason = false; - - if (season.Episodes.Count() == episodesWithoutFiles.Count()) - { - //We don't have any episodes for this season, so as it stands right now we need the entire NZB - //Download! - downloadWholeSeason = true; - } - - else - { - var episodesNeeded = season.Episodes.Count; - - foreach (var episode in season.Episodes) - { - - //if (!_episodeProvider.IsNeeded(episode)) - { - downloadWholeSeason = false; - episodesNeeded--; //Decrement the number of downloads we need, used if we want to replace all existing episodes if this will upgrade over X% of files - break; //We only want to download this NZB if ALL episodes can be upgraded by this Season NZB - } - downloadWholeSeason = true; - } - } - - if (downloadWholeSeason) - { - //Do the final check to ensure we should download this NZB - - if (Convert.ToBoolean(_configProvider.GetValue("UseBlackHole", true, true))) - { - if (DownloadNzb(nzb)) - { - AddToHistory(season.Episodes, nzb, indexer); - } - } - - //Send it to SABnzbd - else - { - if (_sabProvider.IsInQueue(nzb.TitleFix)) - return; - - if (indexer.IndexerName != "Newzbin") - { - if (_sabProvider.AddByUrl(nzb.Link.ToString(), nzb.TitleFix)) - { - AddToHistory(season.Episodes, nzb, indexer); - } - - } - - } - } - - //Possibly grab the whole season if a certain % of the season is missing, rather than for 1 or 2 episodes - } - - private void AddToHistory(IEnumerable episodes, NzbInfoModel nzb, Indexer indexer) - { - //Set episode status to grabbed - //episode.Status = EpisodeStatusType.Grabbed; - - //Add to History - - foreach (var episode in episodes) - { - var history = new History(); - history.Date = DateTime.Now; - history.EpisodeId = episode.EpisodeId; - history.IndexerId = indexer.IndexerId; - history.IsProper = nzb.Proper; - history.Quality = nzb.Quality; - history.NzbTitle = nzb.Title; - - _historyProvider.Insert(history); - } - } - - private bool DownloadNzb(NzbInfoModel nzb) - { - var path = _configProvider.GetValue("BlackholeDirectory", String.Empty, true); - - if (String.IsNullOrEmpty(path)) - { - //Use the NZBDrone root Directory + /NZBs - path = CentralDispatch.StartupPath + "NZBs"; - //path = @"C:\Test\NZBs"; - } - - if (_diskProvider.FolderExists(path)) - { - var filename = path + Path.DirectorySeparatorChar + nzb.TitleFix + ".nzb"; - - if (_httpProvider.DownloadFile(nzb.Link.ToString(), filename)) - return true; - } - - Logger.Error("Blackhole Directory doesn't exist, not saving NZB: '{0}'", path); - return false; - } - } -} diff --git a/NzbDrone.Core/Providers/RssSyncProvider.cs b/NzbDrone.Core/Providers/RssSyncProvider.cs deleted file mode 100644 index 43858b834..000000000 --- a/NzbDrone.Core/Providers/RssSyncProvider.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using NLog; -using NzbDrone.Core.Helpers; -using NzbDrone.Core.Model; -using NzbDrone.Core.Model.Notification; -using NzbDrone.Core.Providers.Core; -using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Quality; -using Rss; - -namespace NzbDrone.Core.Providers -{ - public class RssSyncProvider : IRssSyncProvider - { - //Sync with RSS feeds to download files as needed - - private Thread _rssSyncThread; - private IIndexerProvider _indexerProvider; - private IRssProvider _rss; - private ISeriesProvider _series; - private ISeasonProvider _season; - private IEpisodeProvider _episode; - private IHistoryProvider _history; - private IDownloadProvider _sab; - private IConfigProvider _configProvider; - private IRssItemProcessingProvider _rssItemProcessor; - private readonly INotificationProvider _notificationProvider; - - private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - - private ProgressNotification _rssSyncNotification; - - public RssSyncProvider(IIndexerProvider indexerProvider, IRssProvider rss, - ISeriesProvider series, ISeasonProvider season, - IEpisodeProvider episode, IHistoryProvider history, - IDownloadProvider sab, INotificationProvider notificationProvider, - IConfigProvider configProvider, IRssItemProcessingProvider rssItemProcessor) - { - _indexerProvider = indexerProvider; - _rss = rss; - _series = series; - _season = season; - _episode = episode; - _history = history; - _sab = sab; - _notificationProvider = notificationProvider; - _configProvider = configProvider; - _rssItemProcessor = rssItemProcessor; - } - - #region IRssSyncProvider Members - - public void Begin() - { - Logger.Debug("RSS Sync Starting"); - if (_rssSyncThread == null || !_rssSyncThread.IsAlive) - { - Logger.Debug("Initializing background sync of RSS Feeds."); - _rssSyncThread = new Thread(SyncWithRss) - { - Name = "RssSync", - Priority = ThreadPriority.Lowest - }; - - _rssSyncThread.Start(); - } - else - { - Logger.Warn("RSS Sync already in progress. Ignoring request."); - } - - } - - #endregion - - private void SyncWithRss() - { - //Get all enabled RSS providers - //Download Feeds - - var indexers = _indexerProvider.EnabledIndexers(); - - using (_rssSyncNotification = new ProgressNotification("RSS Sync")) - { - _notificationProvider.Register(_rssSyncNotification); - _rssSyncNotification.CurrentStatus = "Starting Scan"; - _rssSyncNotification.ProgressMax = indexers.Count(); - - foreach (var i in indexers) - { - Logger.Info("Starting RSS Sync for: {0}", i.IndexerName); - //Need to insert the users information in the the URL before trying to use it - GetUsersUrl(i); //Get the new users specific url (with their information) to use for the Sync - - //If the url still contains '{' & '}' the user probably hasn't configured the indexer settings - if (i.RssUrl.Contains("{") && i.RssUrl.Contains("}")) - { - Logger.Debug("Unable to Sync {0}. User Information has not been configured.", i.IndexerName); - continue; //Skip this indexer - } - - _rssSyncNotification.CurrentStatus = String.Format("Syncing with RSS Feed: {0}", i.IndexerName); - - var indexer = new FeedInfoModel(i.IndexerName, i.RssUrl); - - var feedItems = _rss.GetFeed(indexer); - - if (feedItems.Count() == 0) - { - _rssSyncNotification.CurrentStatus = String.Format("Failed to download RSS Feed: {0}", // - i.IndexerName); - continue; //No need to process anything else - } - - foreach (RssItem item in feedItems) - { - NzbInfoModel nzb = Parser.ParseNzbInfo(indexer, item); - _rssItemProcessor.DownloadIfWanted(nzb, i); - } - } - _rssSyncNotification.CurrentStatus = "RSS Sync Completed"; - Logger.Info("RSS Sync has successfully completed."); - Thread.Sleep(3000); - _rssSyncNotification.Status = ProgressNotificationStatus.Completed; - } - } - - private void GetUsersUrl(Indexer indexer) - { - if (indexer.IndexerName == "NzbMatrix") - { - var nzbMatrixUsername = _configProvider.GetValue("NzbMatrixUsername", String.Empty, false); - var nzbMatrixApiKey = _configProvider.GetValue("NzbMatrixApiKey", String.Empty, false); - - if (!String.IsNullOrEmpty(nzbMatrixUsername) && !String.IsNullOrEmpty(nzbMatrixApiKey)) - indexer.RssUrl = indexer.RssUrl.Replace("{USERNAME}", nzbMatrixUsername).Replace("{APIKEY}", nzbMatrixApiKey); - - //Todo: Perform validation at the config level so a user is unable to enable a provider until user details are provided - return; - } - - if (indexer.IndexerName == "NzbsOrg") - { - var nzbsOrgUId = _configProvider.GetValue("NzbsOrgUId", String.Empty, false); - var nzbsOrgHash = _configProvider.GetValue("NzbsOrgHash", String.Empty, false); - - if (!String.IsNullOrEmpty(nzbsOrgUId) && !String.IsNullOrEmpty(nzbsOrgHash)) - indexer.RssUrl = indexer.RssUrl.Replace("{UID}", nzbsOrgUId).Replace("{HASH}", nzbsOrgHash); - - //Todo: Perform validation at the config level so a user is unable to enable a provider until user details are provided - return; - } - - if (indexer.IndexerName == "NzbsOrg") - { - var nzbsrusUId = _configProvider.GetValue("NzbsrusUId", String.Empty, false); - var nzbsrusHash = _configProvider.GetValue("NzbsrusHash", String.Empty, false); - - if (!String.IsNullOrEmpty(nzbsrusUId) && !String.IsNullOrEmpty(nzbsrusHash)) - indexer.RssUrl = indexer.RssUrl.Replace("{UID}", nzbsrusUId).Replace("{HASH}", nzbsrusHash); - - //Todo: Perform validation at the config level so a user is unable to enable a provider until user details are provided - return; - } - - return; //Currently other providers do not require user information to be substituted, simply return - } - } -}