diff --git a/NzbDrone.Core.Test/DbConfigControllerTest.cs b/NzbDrone.Core.Test/DbConfigControllerTest.cs index 97d34264f..911003abb 100644 --- a/NzbDrone.Core.Test/DbConfigControllerTest.cs +++ b/NzbDrone.Core.Test/DbConfigControllerTest.cs @@ -6,8 +6,8 @@ using log4net; using MbUnit.Framework; using MbUnit.Framework.ContractVerifiers; using Moq; +using NzbDrone.Core.Entities; using NzbDrone.Core.Providers; -using NzbDrone.Core.Repository; using SubSonic.Repository; namespace NzbDrone.Core.Test diff --git a/NzbDrone.Core.Test/Libs/Moq.dll b/NzbDrone.Core.Test/Libs/Moq.dll index 3d3b8ccd0..1dd95aa8e 100644 Binary files a/NzbDrone.Core.Test/Libs/Moq.dll and b/NzbDrone.Core.Test/Libs/Moq.dll differ diff --git a/NzbDrone.Core.Test/Libs/Moq.xml b/NzbDrone.Core.Test/Libs/Moq.xml index a0be31ce5..13b8804b5 100644 --- a/NzbDrone.Core.Test/Libs/Moq.xml +++ b/NzbDrone.Core.Test/Libs/Moq.xml @@ -3011,654 +3011,6 @@ Implements the fluent API. - - - Encapsulates a method that has five parameters and does not return a value. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - - - - Encapsulates a method that has five parameters and returns a value of the type specified by the parameter. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has six parameters and does not return a value. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - - - - Encapsulates a method that has six parameters and returns a value of the type specified by the parameter. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has seven parameters and does not return a value. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - - - - Encapsulates a method that has seven parameters and returns a value of the type specified by the parameter. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has eight parameters and does not return a value. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - - - - Encapsulates a method that has eight parameters and returns a value of the type specified by the parameter. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has nine parameters and does not return a value. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - - - - Encapsulates a method that has nine parameters and returns a value of the type specified by the parameter. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has ten parameters and does not return a value. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - - - - Encapsulates a method that has ten parameters and returns a value of the type specified by the parameter. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has eleven parameters and does not return a value. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - - - - Encapsulates a method that has eleven parameters and returns a value of the type specified by the parameter. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has twelve parameters and does not return a value. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - - - - Encapsulates a method that has twelve parameters and returns a value of the type specified by the parameter. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has thirteen parameters and does not return a value. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - - - - Encapsulates a method that has thirteen parameters and returns a value of the type specified by the parameter. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has fourteen parameters and does not return a value. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the fourteenth parameter of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The fourteenth parameter of the method that this delegate encapsulates. - - - - Encapsulates a method that has fourteen parameters and returns a value of the type specified by the parameter. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the fourteenth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The fourteenth parameter of the method that this delegate encapsulates. - The return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has fifteen parameters and does not return a value. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the fourteenth parameter of the method that this delegate encapsulates. - The type of the fifteenth parameter of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The fourteenth parameter of the method that this delegate encapsulates. - The fifteenth parameter of the method that this delegate encapsulates. - - - - Encapsulates a method that has fifteen parameters and returns a value of the type specified by the parameter. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the fourteenth parameter of the method that this delegate encapsulates. - The type of the fifteenth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The fourteenth parameter of the method that this delegate encapsulates. - The fifteenth parameter of the method that this delegate encapsulates. - The return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has sixteen parameters and does not return a value. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the fourteenth parameter of the method that this delegate encapsulates. - The type of the fifteenth parameter of the method that this delegate encapsulates. - The type of the sixteenth parameter of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The fourteenth parameter of the method that this delegate encapsulates. - The fifteenth parameter of the method that this delegate encapsulates. - The sixteenth parameter of the method that this delegate encapsulates. - - - - Encapsulates a method that has sixteen parameters and returns a value of the type specified by the parameter. - - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the nineth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the fourteenth parameter of the method that this delegate encapsulates. - The type of the fifteenth parameter of the method that this delegate encapsulates. - The type of the sixteenth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The nineth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The fourteenth parameter of the method that this delegate encapsulates. - The fifteenth parameter of the method that this delegate encapsulates. - The sixteenth parameter of the method that this delegate encapsulates. - The return value of the method that this delegate encapsulates. - Helper class to setup a full trace between many mocks diff --git a/NzbDrone.Core.Test/QualityProfileTest.cs b/NzbDrone.Core.Test/QualityProfileTest.cs index 921162da2..04ec44b91 100644 --- a/NzbDrone.Core.Test/QualityProfileTest.cs +++ b/NzbDrone.Core.Test/QualityProfileTest.cs @@ -1,8 +1,7 @@ using System.Collections.Generic; using System.IO; using MbUnit.Framework; -using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Quality; +using NzbDrone.Core.Entities.Quality; namespace NzbDrone.Core.Test { diff --git a/NzbDrone.Core.Test/RepoTest.cs b/NzbDrone.Core.Test/RepoTest.cs index f5a0d742c..26b937592 100644 --- a/NzbDrone.Core.Test/RepoTest.cs +++ b/NzbDrone.Core.Test/RepoTest.cs @@ -6,8 +6,8 @@ using FizzWare.NBuilder; using Gallio.Framework; using MbUnit.Framework; using MbUnit.Framework.ContractVerifiers; -using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Episode; +using NzbDrone.Core.Entities; +using NzbDrone.Core.Entities.Episode; namespace NzbDrone.Core.Test { diff --git a/NzbDrone.Core.Test/SabControllerTest.cs b/NzbDrone.Core.Test/SabControllerTest.cs index f7525eac8..0dad5d3b0 100644 --- a/NzbDrone.Core.Test/SabControllerTest.cs +++ b/NzbDrone.Core.Test/SabControllerTest.cs @@ -8,7 +8,6 @@ using MbUnit.Framework; using MbUnit.Framework.ContractVerifiers; using Moq; using NzbDrone.Core.Providers; -using NzbDrone.Core.Repository; using SubSonic.Repository; namespace NzbDrone.Core.Test diff --git a/NzbDrone.Core.Test/SeriesProviderTest.cs b/NzbDrone.Core.Test/SeriesProviderTest.cs index 1249e75ba..8ef28b900 100644 --- a/NzbDrone.Core.Test/SeriesProviderTest.cs +++ b/NzbDrone.Core.Test/SeriesProviderTest.cs @@ -10,9 +10,8 @@ using MbUnit.Framework.ContractVerifiers; using Moq; using Ninject; using Ninject.Moq; +using NzbDrone.Core.Entities; using NzbDrone.Core.Providers; -using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Episode; using SubSonic.Repository; using TvdbLib.Data; using System.Linq; diff --git a/NzbDrone.Core/CentralDispatch.cs b/NzbDrone.Core/CentralDispatch.cs index c5e63cc3e..6f51f9304 100644 --- a/NzbDrone.Core/CentralDispatch.cs +++ b/NzbDrone.Core/CentralDispatch.cs @@ -3,11 +3,10 @@ using System.IO; using System.Web; using Ninject; using NLog.Config; -using NLog.Layouts; using NLog.Targets; +using NzbDrone.Core.Entities; +using NzbDrone.Core.Entities.Episode; using NzbDrone.Core.Providers; -using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Episode; using SubSonic.DataProviders; using SubSonic.Repository; using NLog; @@ -16,19 +15,21 @@ namespace NzbDrone.Core { public static class CentralDispatch { - private static readonly Logger Logger = LogManager.GetLogger("DB"); public static void BindKernel(IKernel kernel) { string connectionString = String.Format("Data Source={0};Version=3;", Path.Combine(AppPath, "nzbdrone.db")); var provider = ProviderFactory.GetProvider(connectionString, "System.Data.SQLite"); provider.Log = new SonicTrace(); - kernel.Bind().To(); + provider.LogParams = true; + + kernel.Bind().To().InSingletonScope(); kernel.Bind().To(); kernel.Bind().To(); kernel.Bind().To(); kernel.Bind().To(); kernel.Bind().To().InSingletonScope(); + kernel.Bind().To().InSingletonScope(); kernel.Bind().ToMethod(c => new SimpleRepository(provider, SimpleRepositoryOptions.RunMigrations)).InSingletonScope(); ForceMigration(kernel.Get()); @@ -79,12 +80,9 @@ namespace NzbDrone.Core //config.AddTarget("file", fileTarget); // Step 3. Set target properties - - - // Step 4. Define rules + //LoggingRule fileRule = new LoggingRule("*", LogLevel.Trace, fileTarget); LoggingRule debugRule = new LoggingRule("*", LogLevel.Trace, debuggerTarget); - LoggingRule fileRule = new LoggingRule("*", LogLevel.Trace, fileTarget); LoggingRule consoleRule = new LoggingRule("*", LogLevel.Trace, consoleTarget); //config.LoggingRules.Add(fileRule); diff --git a/NzbDrone.Core/Repository/Config.cs b/NzbDrone.Core/Entities/Config.cs similarity index 86% rename from NzbDrone.Core/Repository/Config.cs rename to NzbDrone.Core/Entities/Config.cs index 898b69cf5..bd65a1a57 100644 --- a/NzbDrone.Core/Repository/Config.cs +++ b/NzbDrone.Core/Entities/Config.cs @@ -1,6 +1,6 @@ using SubSonic.SqlGeneration.Schema; -namespace NzbDrone.Core.Repository +namespace NzbDrone.Core.Entities { [SubSonicTableNameOverride("Config")] public class Config diff --git a/NzbDrone.Core/Repository/Episode/Episode.cs b/NzbDrone.Core/Entities/Episode/BasicEpisode.cs similarity index 63% rename from NzbDrone.Core/Repository/Episode/Episode.cs rename to NzbDrone.Core/Entities/Episode/BasicEpisode.cs index 49e9f8ae7..0b093c0d0 100644 --- a/NzbDrone.Core/Repository/Episode/Episode.cs +++ b/NzbDrone.Core/Entities/Episode/BasicEpisode.cs @@ -1,10 +1,8 @@ -using System; -using NzbDrone.Core.Repository.Quality; -using SubSonic.SqlGeneration.Schema; +using SubSonic.SqlGeneration.Schema; -namespace NzbDrone.Core.Repository.Episode +namespace NzbDrone.Core.Entities.Episode { - public class Episode + public class BasicEpisode { public virtual int SeriesId { get; set; } public int SeasonNumber { get; set; } diff --git a/NzbDrone.Core/Repository/Episode/EpisodeInfo.cs b/NzbDrone.Core/Entities/Episode/EpisodeInfo.cs similarity index 78% rename from NzbDrone.Core/Repository/Episode/EpisodeInfo.cs rename to NzbDrone.Core/Entities/Episode/EpisodeInfo.cs index 806ddf359..f759d016b 100644 --- a/NzbDrone.Core/Repository/Episode/EpisodeInfo.cs +++ b/NzbDrone.Core/Entities/Episode/EpisodeInfo.cs @@ -1,13 +1,10 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using SubSonic.SqlGeneration.Schema; -namespace NzbDrone.Core.Repository.Episode +namespace NzbDrone.Core.Entities.Episode { [SubSonicTableNameOverride("EpisodeInfo")] - public class EpisodeInfo : Episode + public class EpisodeInfo : BasicEpisode { [SubSonicPrimaryKey(false)] public virtual int EpisodeId { get; set; } diff --git a/NzbDrone.Core/Entities/Episode/RemoteEpisode.cs b/NzbDrone.Core/Entities/Episode/RemoteEpisode.cs new file mode 100644 index 000000000..6e40440a6 --- /dev/null +++ b/NzbDrone.Core/Entities/Episode/RemoteEpisode.cs @@ -0,0 +1,12 @@ +using System.ServiceModel.Syndication; +using NzbDrone.Core.Entities.Quality; + +namespace NzbDrone.Core.Entities.Episode +{ + public class RemoteEpisode : BasicEpisode + { + public QualityTypes Quality { get; set; } + public SyndicationItem Feed { get; set; } + public bool Proper { get; set; } + } +} diff --git a/NzbDrone.Core/Entities/Notification/BasicNotification.cs b/NzbDrone.Core/Entities/Notification/BasicNotification.cs new file mode 100644 index 000000000..ce256c7e8 --- /dev/null +++ b/NzbDrone.Core/Entities/Notification/BasicNotification.cs @@ -0,0 +1,28 @@ +using System; + +namespace NzbDrone.Core.Entities.Notification +{ + public class BasicNotification + { + public BasicNotification() + { + Id = Guid.Empty; + } + + /// + /// Gets or sets the unique id. + /// + /// The Id. + public Guid Id { get; private set; } + + public String Title { get; set; } + + public NotificationType Type { get; set; } + + /// + /// Gets or sets a value indicating whether or not this message should be automatically dismissed after a period of time. + /// + /// true if [auto dismiss]; otherwise, false. + public bool AutoDismiss { get; set; } + } +} \ No newline at end of file diff --git a/NzbDrone.Core/Entities/Notification/NotificationStatus.cs b/NzbDrone.Core/Entities/Notification/NotificationStatus.cs new file mode 100644 index 000000000..d9e791143 --- /dev/null +++ b/NzbDrone.Core/Entities/Notification/NotificationStatus.cs @@ -0,0 +1,9 @@ +namespace NzbDrone.Core.Entities.Notification +{ + public enum NotificationStatus + { + InProgress = 0, + Completed = 1, + Failed = 2 + } +} \ No newline at end of file diff --git a/NzbDrone.Core/Entities/Notification/NotificationType.cs b/NzbDrone.Core/Entities/Notification/NotificationType.cs new file mode 100644 index 000000000..845b55691 --- /dev/null +++ b/NzbDrone.Core/Entities/Notification/NotificationType.cs @@ -0,0 +1,9 @@ +namespace NzbDrone.Core.Entities.Notification +{ + public enum NotificationType + { + Info = 0, + Warrning = 1, + Error = 2 + } +} \ No newline at end of file diff --git a/NzbDrone.Core/Entities/Notification/ProgressNotification.cs b/NzbDrone.Core/Entities/Notification/ProgressNotification.cs new file mode 100644 index 000000000..8e1ce6182 --- /dev/null +++ b/NzbDrone.Core/Entities/Notification/ProgressNotification.cs @@ -0,0 +1,76 @@ +using System; +using NLog; + +namespace NzbDrone.Core.Entities.Notification +{ + public class ProgressNotification : IDisposable + { + private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); + + public ProgressNotification(string title) + { + Title = title; + Id = Guid.NewGuid(); + ProgressMax = 100; + ProgressValue = 0; + } + + + /// + /// Gets or sets the unique id. + /// + /// The Id. + public Guid Id { get; private set; } + + /// + /// Gets or sets the title for this notification. + /// + /// The title. + public String Title { get; set; } + + /// + /// Gets or sets the current status of this task. this field could be use to show the currently processing item in a long running task. + /// + /// The current status. + public String CurrentStatus { get; set; } + + /// + /// Gets or sets the completion status in percent. + /// + /// The percent complete. + public int PercentComplete + { + get + { + return Convert.ToInt32(Convert.ToDouble(ProgressValue) / Convert.ToDouble(ProgressMax) * 100); + } + } + + /// + /// Gets or sets the total number of items that need to be completed + /// + /// The progress max. + public int ProgressMax { get; set; } + + /// + /// Gets or sets the number of items successfully completed. + /// + /// The progress value. + public int ProgressValue { get; set; } + + /// + /// Gets or sets the status. + /// + /// The status. + public NotificationStatus Status { get; set; } + + public void Dispose() + { + if (Status == NotificationStatus.InProgress) + { + Logger.Error("Progress notification '{0}' was unexpectedly abandoned. ID:{1} Status:{2} CurrentStatus:{3} PercentComplete:{4}", Title, Id, Status, CurrentStatus, PercentComplete); + Status = NotificationStatus.Failed; + } + } + } +} \ No newline at end of file diff --git a/NzbDrone.Core/Repository/Quality/AllowedQuality.cs b/NzbDrone.Core/Entities/Quality/AllowedQuality.cs similarity index 79% rename from NzbDrone.Core/Repository/Quality/AllowedQuality.cs rename to NzbDrone.Core/Entities/Quality/AllowedQuality.cs index 3ff1663f2..ad32a134b 100644 --- a/NzbDrone.Core/Repository/Quality/AllowedQuality.cs +++ b/NzbDrone.Core/Entities/Quality/AllowedQuality.cs @@ -1,4 +1,4 @@ -namespace NzbDrone.Core.Repository.Quality +namespace NzbDrone.Core.Entities.Quality { public class AllowedQuality { diff --git a/NzbDrone.Core/Repository/Quality/QualityProfile.cs b/NzbDrone.Core/Entities/Quality/QualityProfile.cs similarity index 95% rename from NzbDrone.Core/Repository/Quality/QualityProfile.cs rename to NzbDrone.Core/Entities/Quality/QualityProfile.cs index 20e666170..325ae7d81 100644 --- a/NzbDrone.Core/Repository/Quality/QualityProfile.cs +++ b/NzbDrone.Core/Entities/Quality/QualityProfile.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.ComponentModel; using SubSonic.SqlGeneration.Schema; -namespace NzbDrone.Core.Repository.Quality +namespace NzbDrone.Core.Entities.Quality { public class QualityProfile { diff --git a/NzbDrone.Core/Repository/Quality/QualityTypes.cs b/NzbDrone.Core/Entities/Quality/QualityTypes.cs similarity index 94% rename from NzbDrone.Core/Repository/Quality/QualityTypes.cs rename to NzbDrone.Core/Entities/Quality/QualityTypes.cs index a328b671a..c27c77d1e 100644 --- a/NzbDrone.Core/Repository/Quality/QualityTypes.cs +++ b/NzbDrone.Core/Entities/Quality/QualityTypes.cs @@ -1,4 +1,4 @@ -namespace NzbDrone.Core.Repository.Quality +namespace NzbDrone.Core.Entities.Quality { // ReSharper disable InconsistentNaming /// diff --git a/NzbDrone.Core/Repository/Season.cs b/NzbDrone.Core/Entities/Season.cs similarity index 71% rename from NzbDrone.Core/Repository/Season.cs rename to NzbDrone.Core/Entities/Season.cs index e20331001..dc343ce3d 100644 --- a/NzbDrone.Core/Repository/Season.cs +++ b/NzbDrone.Core/Entities/Season.cs @@ -1,9 +1,7 @@ -using System; -using System.Collections.Generic; -using System.ServiceModel.Syndication; +using System.Collections.Generic; using SubSonic.SqlGeneration.Schema; -namespace NzbDrone.Core.Repository +namespace NzbDrone.Core.Entities { public class Season { @@ -15,7 +13,7 @@ namespace NzbDrone.Core.Repository public string Folder { get; set; } [SubSonicToManyRelation] - public virtual List Episodes { get; private set; } + public virtual List Episodes { get; private set; } [SubSonicToOneRelation(ThisClassContainsJoinKey = true)] public virtual Series Series { get; private set; } diff --git a/NzbDrone.Core/Repository/Series.cs b/NzbDrone.Core/Entities/Series.cs similarity index 91% rename from NzbDrone.Core/Repository/Series.cs rename to NzbDrone.Core/Entities/Series.cs index 2bb2e56a8..304ba27d7 100644 --- a/NzbDrone.Core/Repository/Series.cs +++ b/NzbDrone.Core/Entities/Series.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; -using NzbDrone.Core.Repository.Episode; +using NzbDrone.Core.Entities.Episode; using SubSonic.SqlGeneration.Schema; -namespace NzbDrone.Core.Repository +namespace NzbDrone.Core.Entities { public class Series { diff --git a/NzbDrone.Core/Libraries/SubSonic.Core.dll b/NzbDrone.Core/Libraries/SubSonic.Core.dll index 528c2adfe..cc2b515f6 100644 Binary files a/NzbDrone.Core/Libraries/SubSonic.Core.dll and b/NzbDrone.Core/Libraries/SubSonic.Core.dll differ diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 8a951de46..59f8397dd 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -131,9 +131,8 @@ False Libraries\NLog.Extended.dll - - False - Libraries\SubSonic.Core.dll + + D:\OpenSource\sabscripts\SABSync\References\SubSonic.Core.dll @@ -146,6 +145,12 @@ + + + + + + @@ -158,15 +163,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/NzbDrone.Core/Providers/ConfigProvider.cs b/NzbDrone.Core/Providers/ConfigProvider.cs index 748cc06f2..d6e7531e9 100644 --- a/NzbDrone.Core/Providers/ConfigProvider.cs +++ b/NzbDrone.Core/Providers/ConfigProvider.cs @@ -1,6 +1,6 @@ using System; using NLog; -using NzbDrone.Core.Repository; +using NzbDrone.Core.Entities; using SubSonic.Repository; namespace NzbDrone.Core.Providers diff --git a/NzbDrone.Core/Providers/EpisodeProvider.cs b/NzbDrone.Core/Providers/EpisodeProvider.cs index 05a18a409..a7ef2f8a4 100644 --- a/NzbDrone.Core/Providers/EpisodeProvider.cs +++ b/NzbDrone.Core/Providers/EpisodeProvider.cs @@ -2,9 +2,8 @@ using System; using System.Collections.Generic; using System.Text.RegularExpressions; using NLog; -using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Episode; -using NzbDrone.Core.Repository.Quality; +using NzbDrone.Core.Entities.Episode; +using NzbDrone.Core.Entities.Quality; using SubSonic.Repository; namespace NzbDrone.Core.Providers @@ -44,27 +43,27 @@ namespace NzbDrone.Core.Providers } - public Episode GetEpisode(long id) + public BasicEpisode GetEpisode(long id) { throw new NotImplementedException(); } - public Episode UpdateEpisode(Episode episode) + public BasicEpisode UpdateEpisode(BasicEpisode episode) { throw new NotImplementedException(); } - public IList GetEpisodesBySeason(long seasonId) + public IList GetEpisodesBySeason(long seasonId) { throw new NotImplementedException(); } - public IList GetEpisodeBySeries(long seriesId) + public IList GetEpisodeBySeries(long seriesId) { throw new NotImplementedException(); } - public String GetSabTitle(Episode episode) + public String GetSabTitle(BasicEpisode episode) { var series = _series.GetSeries(episode.SeriesId); if (series == null) throw new ArgumentException("Unknown series. ID: " + episode.SeriesId); @@ -79,7 +78,7 @@ namespace NzbDrone.Core.Providers /// /// Episode that needs to be checked /// - public bool IsNeeded(Episode episode) + public bool IsNeeded(BasicEpisode episode) { throw new NotImplementedException(); } diff --git a/NzbDrone.Core/Providers/IEpisodeProvider.cs b/NzbDrone.Core/Providers/IEpisodeProvider.cs index 4c55ea803..c658195bc 100644 --- a/NzbDrone.Core/Providers/IEpisodeProvider.cs +++ b/NzbDrone.Core/Providers/IEpisodeProvider.cs @@ -1,24 +1,23 @@ using System; using System.Collections.Generic; -using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Episode; +using NzbDrone.Core.Entities.Episode; namespace NzbDrone.Core.Providers { public interface IEpisodeProvider { - Episode GetEpisode(long id); - Episode UpdateEpisode(Episode episode); - IList GetEpisodesBySeason(long seasonId); - IList GetEpisodeBySeries(long seriesId); - String GetSabTitle(Episode episode); + BasicEpisode GetEpisode(long id); + BasicEpisode UpdateEpisode(BasicEpisode episode); + IList GetEpisodesBySeason(long seasonId); + IList GetEpisodeBySeries(long seriesId); + String GetSabTitle(BasicEpisode episode); /// /// Comprehensive check on whether or not this episode is needed. /// /// Episode that needs to be checked /// - bool IsNeeded(Episode episode); + bool IsNeeded(BasicEpisode episode); void RefreshSeries(int seriesId); } diff --git a/NzbDrone.Core/Providers/INotificationProvider.cs b/NzbDrone.Core/Providers/INotificationProvider.cs new file mode 100644 index 000000000..f9b097699 --- /dev/null +++ b/NzbDrone.Core/Providers/INotificationProvider.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using NzbDrone.Core.Entities.Notification; + +namespace NzbDrone.Core.Providers +{ + public interface INotificationProvider + { + void Register(ProgressNotification notification); + void Register(BasicNotification notification); + + List BasicNotifications { get; } + List ProgressNotifications { get; } + + /// + /// Dismisses a notification based on its ID. + /// + /// notification id. + void Dismiss(Guid notificationId); + + } +} diff --git a/NzbDrone.Core/Providers/ISeasonProvider.cs b/NzbDrone.Core/Providers/ISeasonProvider.cs index 6edc04892..811147863 100644 --- a/NzbDrone.Core/Providers/ISeasonProvider.cs +++ b/NzbDrone.Core/Providers/ISeasonProvider.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using NzbDrone.Core.Repository; +using NzbDrone.Core.Entities; namespace NzbDrone.Core.Providers { diff --git a/NzbDrone.Core/Providers/ISeriesProvider.cs b/NzbDrone.Core/Providers/ISeriesProvider.cs index 9fbbe3468..e6145d755 100644 --- a/NzbDrone.Core/Providers/ISeriesProvider.cs +++ b/NzbDrone.Core/Providers/ISeriesProvider.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using NzbDrone.Core.Repository; +using NzbDrone.Core.Entities; using TvdbLib.Data; namespace NzbDrone.Core.Providers diff --git a/NzbDrone.Core/Providers/NotificationProvider.cs b/NzbDrone.Core/Providers/NotificationProvider.cs new file mode 100644 index 000000000..771bbf306 --- /dev/null +++ b/NzbDrone.Core/Providers/NotificationProvider.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using NzbDrone.Core.Entities.Notification; + +namespace NzbDrone.Core.Providers +{ + class NotificationProvider : INotificationProvider + { + private readonly Dictionary _basicNotifications = new Dictionary(); + private readonly Dictionary _progressNotification = new Dictionary(); + private readonly Object _lock = new object(); + + public void Register(ProgressNotification notification) + { + _progressNotification.Add(notification.Id, notification); + } + + public void Register(BasicNotification notification) + { + _basicNotifications.Add(notification.Id, notification); + } + + public List BasicNotifications + { + get { return new List(_basicNotifications.Values); } + } + + public List ProgressNotifications + { + get { return new List(_progressNotification.Values); } + } + + public void Dismiss(Guid notificationId) + { + lock (_lock) + { + if (_basicNotifications.ContainsKey(notificationId)) + { + _basicNotifications.Remove(notificationId); + } + else if (_progressNotification.ContainsKey(notificationId)) + { + _progressNotification.Remove(notificationId); + } + } + } + } +} \ No newline at end of file diff --git a/NzbDrone.Core/Providers/SeasonProvider.cs b/NzbDrone.Core/Providers/SeasonProvider.cs index a48c440f8..989502fd9 100644 --- a/NzbDrone.Core/Providers/SeasonProvider.cs +++ b/NzbDrone.Core/Providers/SeasonProvider.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using NLog; -using NzbDrone.Core.Repository; +using NzbDrone.Core.Entities; using SubSonic.Repository; namespace NzbDrone.Core.Providers diff --git a/NzbDrone.Core/Providers/SeriesProvider.cs b/NzbDrone.Core/Providers/SeriesProvider.cs index 34c279aa1..2a7c58493 100644 --- a/NzbDrone.Core/Providers/SeriesProvider.cs +++ b/NzbDrone.Core/Providers/SeriesProvider.cs @@ -4,7 +4,8 @@ using System.IO; using System.Linq; using System.Text.RegularExpressions; using NLog; -using NzbDrone.Core.Repository; +using NzbDrone.Core.Entities; +using NzbDrone.Core.Entities.Notification; using SubSonic.Repository; using TvdbLib.Data; @@ -32,7 +33,7 @@ namespace NzbDrone.Core.Providers )", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace); - + private readonly INotificationProvider _notificationProvider; private readonly IConfigProvider _config; private readonly IDiskProvider _diskProvider; private readonly IRepository _sonioRepo; @@ -40,8 +41,11 @@ namespace NzbDrone.Core.Providers private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly Regex CleanUpRegex = new Regex(@"((\s|^)the(\s|$))|((\s|^)and(\s|$))|[^a-z]", RegexOptions.IgnoreCase | RegexOptions.Compiled); - public SeriesProvider(IDiskProvider diskProvider, IConfigProvider configProvider, IRepository dataRepository, ITvDbProvider tvDbProvider) + private ProgressNotification _progress; + + public SeriesProvider(INotificationProvider notificationProvider, IDiskProvider diskProvider, IConfigProvider configProvider, IRepository dataRepository, ITvDbProvider tvDbProvider) { + _notificationProvider = notificationProvider; _diskProvider = diskProvider; _config = configProvider; _sonioRepo = dataRepository; @@ -87,31 +91,45 @@ namespace NzbDrone.Core.Providers public void SyncSeriesWithDisk() { + if (_progress != null && _progress.Status == NotificationStatus.InProgress) + throw new InvalidOperationException("Another Task is already in progress. " + _progress.Title); + if (String.IsNullOrEmpty(_config.SeriesRoot)) throw new InvalidOperationException("TV Series folder is not configured yet."); - foreach (string seriesFolder in GetUnmappedFolders()) + using (_progress = new ProgressNotification("Updating Series From Disk")) { - Logger.Info("Folder '{0}' isn't mapped to a series in the database. Trying to map it.'", seriesFolder); - var mappedSeries = MapPathToSeries(seriesFolder); + _notificationProvider.Register(_progress); - if (mappedSeries == null) - { - Logger.Warn("Unable to find a matching series for '{0}'", seriesFolder); - } - else - { + var unmappedFolders = GetUnmappedFolders(); + _progress.ProgressMax = unmappedFolders.Count; - if (!_sonioRepo.Exists(s => s.SeriesId == mappedSeries.Id)) + foreach (string seriesFolder in unmappedFolders) + { + _progress.CurrentStatus = String.Format("Mapping folder {0}", seriesFolder); + + Logger.Info("Folder '{0}' isn't mapped to a series in the database. Trying to map it.'", seriesFolder); + var mappedSeries = MapPathToSeries(seriesFolder); + + if (mappedSeries == null) { - RegisterSeries(seriesFolder, mappedSeries); + Logger.Warn("Unable to find a matching series for '{0}'", seriesFolder); } else { - Logger.Warn("Folder '{0}' mapped to '{1}' which is already another folder assigned to it.'", seriesFolder, mappedSeries.SeriesName); + if (!_sonioRepo.Exists(s => s.SeriesId == mappedSeries.Id)) + { + RegisterSeries(seriesFolder, mappedSeries); + } + else + { + Logger.Warn("Folder '{0}' mapped to '{1}' which is already another folder assigned to it.'", seriesFolder, mappedSeries.SeriesName); + } } + _progress.ProgressValue++; } + _progress.Status = NotificationStatus.Completed; } } diff --git a/NzbDrone.Core/Repository/Episode/RemoteEpisode.cs b/NzbDrone.Core/Repository/Episode/RemoteEpisode.cs deleted file mode 100644 index ee09e806c..000000000 --- a/NzbDrone.Core/Repository/Episode/RemoteEpisode.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.ServiceModel.Syndication; -using System.Text; -using NzbDrone.Core.Repository.Quality; -using SubSonic.SqlGeneration.Schema; - -namespace NzbDrone.Core.Repository.Episode -{ - public class RemoteEpisode : Episode - { - public QualityTypes Quality { get; set; } - public SyndicationItem Feed { get; set; } - public bool Proper { get; set; } - } -} diff --git a/NzbDrone.Web/Controllers/NotificationController.cs b/NzbDrone.Web/Controllers/NotificationController.cs new file mode 100644 index 000000000..42496772f --- /dev/null +++ b/NzbDrone.Web/Controllers/NotificationController.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using NzbDrone.Core.Providers; + +namespace NzbDrone.Web.Controllers +{ + public class NotificationController : Controller + { + private readonly INotificationProvider _notifications; + // + // GET: /Notification/ + + public NotificationController(INotificationProvider notificationProvider) + { + _notifications = notificationProvider; + } + + [HttpGet] + public JsonResult Index() + { + return Json(_notifications.ProgressNotifications, JsonRequestBehavior.AllowGet); + } + + } +} diff --git a/NzbDrone.Web/Controllers/SeriesController.cs b/NzbDrone.Web/Controllers/SeriesController.cs index 76bec605e..002f7d7d9 100644 --- a/NzbDrone.Web/Controllers/SeriesController.cs +++ b/NzbDrone.Web/Controllers/SeriesController.cs @@ -7,6 +7,7 @@ using NzbDrone.Core.Providers; namespace NzbDrone.Web.Controllers { + [HandleError] public class SeriesController : Controller { private readonly ISeriesProvider _seriesProvider; diff --git a/NzbDrone.Web/Controllers/SettingsController.cs b/NzbDrone.Web/Controllers/SettingsController.cs index 37679c56a..dde13a1ea 100644 --- a/NzbDrone.Web/Controllers/SettingsController.cs +++ b/NzbDrone.Web/Controllers/SettingsController.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; using System.Web; using System.Web.Mvc; using NzbDrone.Core.Providers; @@ -8,6 +9,7 @@ using NzbDrone.Web.Models; namespace NzbDrone.Web.Controllers { + [HandleError] public class SettingsController : Controller { // diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index f34ba84e3..a1cdcf7b7 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -79,6 +79,7 @@ + diff --git a/NzbDrone.Web/Views/Series/Details.aspx b/NzbDrone.Web/Views/Series/Details.aspx index 0052d81ce..2f0f12f6c 100644 --- a/NzbDrone.Web/Views/Series/Details.aspx +++ b/NzbDrone.Web/Views/Series/Details.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> +<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> <%@ Import Namespace="Telerik.Web.Mvc.UI" %> diff --git a/NzbDrone.Web/Views/Series/index.aspx b/NzbDrone.Web/Views/Series/index.aspx index 1b09b0726..f5bea6042 100644 --- a/NzbDrone.Web/Views/Series/index.aspx +++ b/NzbDrone.Web/Views/Series/index.aspx @@ -1,7 +1,6 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage>" %> +<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage>" %> <%@ Import Namespace="Telerik.Web.Mvc.UI" %> -<%@ Import Namespace="NzbDrone.Core.Repository" %> Series diff --git a/NzbDrone.Web/Views/Shared/Error.aspx b/NzbDrone.Web/Views/Shared/Error.aspx index 144df3f5c..1df0032b0 100644 --- a/NzbDrone.Web/Views/Shared/Error.aspx +++ b/NzbDrone.Web/Views/Shared/Error.aspx @@ -1,11 +1,25 @@ <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> +<%@ Import Namespace="NLog" %> - Error + EPIC FAIL!!! -

- Sorry, an error occurred while processing your request. + <%:Model.Exception.Message%>

+
+ <%:Model.Exception.ToString()%>
+ diff --git a/NzbDrone.Web/Web.config b/NzbDrone.Web/Web.config index 3aebb9248..e9d6a10bc 100644 --- a/NzbDrone.Web/Web.config +++ b/NzbDrone.Web/Web.config @@ -21,6 +21,7 @@ +