Import will only delete folder if files were imported

pull/4/head
Mark McDowall 11 years ago
parent d5ca1259b2
commit e92b273d75

@ -2,346 +2,398 @@
<Id>
<u:Value>1</u:Value>
</Id>
<DefaultLogLevel z:Id="2" i:type="LogLevelSurrogated">
<LevelName z:Id="3">ALL</LevelName>
</DefaultLogLevel>
<Data z:Id="2">
<Id>
<u:Value>2</u:Value>
</Id>
<Version>17</Version>
<_receivers z:Id="3" z:Size="1">
<ReceiverConfig z:Id="4" i:type="n:NetReceiverConfig">
<Id>
<u:Value>16</u:Value>
</Id>
<BackColor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4293654015</b:value>
</BackColor>
<BufferSize>500000</BufferSize>
<Encoding z:Id="5">Windows-1252</Encoding>
<LevelFilter z:Id="6" i:type="LogLevelSurrogated">
<LevelName z:Id="7">ALL</LevelName>
</LevelFilter>
<LoggingFrameworkId z:Id="8">Log4net</LoggingFrameworkId>
<Name z:Id="9">NzbDrone</Name>
<ParserType>XML</ParserType>
<ReadAdjacentMessages>0</ReadAdjacentMessages>
<ReadFrom>0001-01-01T00:00:00</ReadFrom>
<ReadUntil>0001-01-01T00:00:00</ReadUntil>
<SourceId>0</SourceId>
<TimeOffset>0</TimeOffset>
<TimeZone z:Id="10">Pacific Standard Time</TimeZone>
<UseFilter>false</UseFilter>
<Window>18</Window>
<n:HostName z:Id="11">localhost</n:HostName>
<n:Port>20480</n:Port>
<n:Protocol>Udp</n:Protocol>
</ReceiverConfig>
</_receivers>
<_sources z:Id="12" z:Size="0" />
</Data>
<Presentation z:Id="13">
<Id>
<u:Value>3</u:Value>
</Id>
<DefaultLogLevel z:Ref="6" i:nil="true" />
<ShowCodeDetails>false</ShowCodeDetails>
<ShowMessageDetails>true</ShowMessageDetails>
<ShowMultiField>true</ShowMultiField>
<ShowOutputOnDebug>true</ShowOutputOnDebug>
<ShowProcessDetails>false</ShowProcessDetails>
<ToolTipLogLevel z:Id="4" i:type="LogLevelSurrogated">
<LevelName z:Id="5">OFF</LevelName>
<ToolTipLogLevel z:Id="14" i:type="LogLevelSurrogated">
<LevelName z:Id="15">OFF</LevelName>
</ToolTipLogLevel>
<Version>15</Version>
<_charts z:Id="6" z:Size="0" />
<_columns z:Id="7" z:Size="28">
<ColumnConfig z:Id="8">
<Version>17</Version>
<_charts z:Id="16" z:Size="0" />
<_columns z:Id="17" z:Size="29">
<ColumnConfig z:Id="18">
<Id>
<u:Value>46</u:Value>
<u:Value>78</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="9">Id</FieldName>
<Name z:Ref="9" i:nil="true" />
<FieldName z:Id="19">Id</FieldName>
<Name z:Ref="19" i:nil="true" />
<Position>-1</Position>
<Width>45</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="10">
<ColumnConfig z:Id="20">
<Id>
<u:Value>47</u:Value>
<u:Value>79</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="11">OriginalTime</FieldName>
<Name z:Ref="11" i:nil="true" />
<FieldName z:Id="21">OriginalTime</FieldName>
<Name z:Ref="21" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="12">
<ColumnConfig z:Id="22">
<Id>
<u:Value>48</u:Value>
<u:Value>80</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="13">Time</FieldName>
<Name z:Ref="13" i:nil="true" />
<FieldName z:Id="23">Time</FieldName>
<Name z:Ref="23" i:nil="true" />
<Position>1</Position>
<Width>80</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="14">
<ColumnConfig z:Id="24">
<Id>
<u:Value>49</u:Value>
<u:Value>81</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="15">LocalTime</FieldName>
<Name z:Ref="15" i:nil="true" />
<FieldName z:Id="25">LocalTime</FieldName>
<Name z:Ref="25" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="16">
<ColumnConfig z:Id="26">
<Id>
<u:Value>50</u:Value>
<u:Value>82</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="17">UtcTime</FieldName>
<Name z:Ref="17" i:nil="true" />
<FieldName z:Id="27">UtcTime</FieldName>
<Name z:Ref="27" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="18">
<ColumnConfig z:Id="28">
<Id>
<u:Value>51</u:Value>
<u:Value>83</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="19">Key</FieldName>
<Name z:Ref="19" i:nil="true" />
<FieldName z:Id="29">Date</FieldName>
<Name z:Ref="29" i:nil="true" />
<Position>-1</Position>
<Width>70</Width>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="30">
<Id>
<u:Value>84</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="31">Key</FieldName>
<Name z:Ref="31" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="20">
<ColumnConfig z:Id="32">
<Id>
<u:Value>52</u:Value>
<u:Value>85</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="21">Level</FieldName>
<Name z:Ref="21" i:nil="true" />
<FieldName z:Id="33">Level</FieldName>
<Name z:Ref="33" i:nil="true" />
<Position>-1</Position>
<Width>85</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="22">
<ColumnConfig z:Id="34">
<Id>
<u:Value>53</u:Value>
<u:Value>86</u:Value>
</Id>
<ClipMode>ClipMiddle</ClipMode>
<FieldName z:Id="23">Logger</FieldName>
<Name z:Ref="23" i:nil="true" />
<FieldName z:Id="35">Logger</FieldName>
<Name z:Ref="35" i:nil="true" />
<Position>2</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="24">
<ColumnConfig z:Id="36">
<Id>
<u:Value>54</u:Value>
<u:Value>87</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="25">Source</FieldName>
<Name z:Ref="25" i:nil="true" />
<FieldName z:Id="37">Source</FieldName>
<Name z:Ref="37" i:nil="true" />
<Position>-1</Position>
<Width>90</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="26">
<ColumnConfig z:Id="38">
<Id>
<u:Value>55</u:Value>
<u:Value>88</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="27">Message</FieldName>
<Name z:Ref="27" i:nil="true" />
<FieldName z:Id="39">Message</FieldName>
<Name z:Ref="39" i:nil="true" />
<Position>3</Position>
<Width>320</Width>
<WindowId>16</WindowId>
<Width>874</Width>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="28">
<ColumnConfig z:Id="40">
<Id>
<u:Value>56</u:Value>
<u:Value>89</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="29">Thread</FieldName>
<Name z:Ref="29" i:nil="true" />
<FieldName z:Id="41">Thread</FieldName>
<Name z:Ref="41" i:nil="true" />
<Position>-1</Position>
<Width>95</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="30">
<ColumnConfig z:Id="42">
<Id>
<u:Value>57</u:Value>
<u:Value>90</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="31">Host</FieldName>
<Name z:Ref="31" i:nil="true" />
<FieldName z:Id="43">Host</FieldName>
<Name z:Ref="43" i:nil="true" />
<Position>-1</Position>
<Width>90</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="32">
<ColumnConfig z:Id="44">
<Id>
<u:Value>58</u:Value>
<u:Value>91</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="33">Exception</FieldName>
<Name z:Ref="33" i:nil="true" />
<FieldName z:Id="45">Exception</FieldName>
<Name z:Ref="45" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="34">
<ColumnConfig z:Id="46">
<Id>
<u:Value>59</u:Value>
<u:Value>92</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="35">Domain</FieldName>
<Name z:Ref="35" i:nil="true" />
<FieldName z:Id="47">Domain</FieldName>
<Name z:Ref="47" i:nil="true" />
<Position>-1</Position>
<Width>90</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="36">
<ColumnConfig z:Id="48">
<Id>
<u:Value>60</u:Value>
<u:Value>93</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="37">Identity</FieldName>
<Name z:Ref="37" i:nil="true" />
<FieldName z:Id="49">Identity</FieldName>
<Name z:Ref="49" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="38">
<ColumnConfig z:Id="50">
<Id>
<u:Value>61</u:Value>
<u:Value>94</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="39">User</FieldName>
<Name z:Ref="39" i:nil="true" />
<FieldName z:Id="51">User</FieldName>
<Name z:Ref="51" i:nil="true" />
<Position>-1</Position>
<Width>90</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="40">
<ColumnConfig z:Id="52">
<Id>
<u:Value>62</u:Value>
<u:Value>95</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="41">Class</FieldName>
<Name z:Ref="41" i:nil="true" />
<FieldName z:Id="53">Class</FieldName>
<Name z:Ref="53" i:nil="true" />
<Position>-1</Position>
<Width>90</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="42">
<ColumnConfig z:Id="54">
<Id>
<u:Value>63</u:Value>
<u:Value>96</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="43">Method</FieldName>
<Name z:Ref="43" i:nil="true" />
<FieldName z:Id="55">Method</FieldName>
<Name z:Ref="55" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="44">
<ColumnConfig z:Id="56">
<Id>
<u:Value>64</u:Value>
<u:Value>97</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="45">File</FieldName>
<Name z:Ref="45" i:nil="true" />
<FieldName z:Id="57">File</FieldName>
<Name z:Ref="57" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="46">
<ColumnConfig z:Id="58">
<Id>
<u:Value>65</u:Value>
<u:Value>98</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="47">Line</FieldName>
<Name z:Ref="47" i:nil="true" />
<FieldName z:Id="59">Line</FieldName>
<Name z:Ref="59" i:nil="true" />
<Position>-1</Position>
<Width>45</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="48">
<ColumnConfig z:Id="60">
<Id>
<u:Value>66</u:Value>
<u:Value>99</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="49">NDC</FieldName>
<Name z:Ref="49" i:nil="true" />
<FieldName z:Id="61">NDC</FieldName>
<Name z:Ref="61" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="50">
<ColumnConfig z:Id="62">
<Id>
<u:Value>67</u:Value>
<u:Value>100</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="51">MDC</FieldName>
<Name z:Ref="51" i:nil="true" />
<FieldName z:Id="63">MDC</FieldName>
<Name z:Ref="63" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="52">
<ColumnConfig z:Id="64">
<Id>
<u:Value>68</u:Value>
<u:Value>101</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="53">Comment</FieldName>
<Name z:Ref="53" i:nil="true" />
<FieldName z:Id="65">Comment</FieldName>
<Name z:Ref="65" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="54">
<ColumnConfig z:Id="66">
<Id>
<u:Value>69</u:Value>
<u:Value>102</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="55">StackTrace</FieldName>
<Name z:Ref="55" i:nil="true" />
<FieldName z:Id="67">StackTrace</FieldName>
<Name z:Ref="67" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="56">
<ColumnConfig z:Id="68">
<Id>
<u:Value>70</u:Value>
<u:Value>103</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="57">ProcessId</FieldName>
<Name z:Ref="57" i:nil="true" />
<FieldName z:Id="69">ProcessId</FieldName>
<Name z:Ref="69" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="58">
<ColumnConfig z:Id="70">
<Id>
<u:Value>71</u:Value>
<u:Value>104</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="59">ThreadId</FieldName>
<Name z:Ref="59" i:nil="true" />
<FieldName z:Id="71">ThreadId</FieldName>
<Name z:Ref="71" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="60">
<ColumnConfig z:Id="72">
<Id>
<u:Value>72</u:Value>
<u:Value>105</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="61">Date</FieldName>
<Name z:Ref="61" i:nil="true" />
<FieldName z:Id="73">CallStack</FieldName>
<Name z:Ref="73" i:nil="true" />
<Position>-1</Position>
<Width>70</Width>
<WindowId>16</WindowId>
<Width>120</Width>
<WindowId>18</WindowId>
</ColumnConfig>
<ColumnConfig z:Id="62">
<ColumnConfig z:Id="74">
<Id>
<u:Value>73</u:Value>
<u:Value>106</u:Value>
</Id>
<ClipMode>ClipRight</ClipMode>
<FieldName z:Id="63">CallStack</FieldName>
<Name z:Ref="63" i:nil="true" />
<FieldName z:Id="75">assembly</FieldName>
<Name z:Ref="75" i:nil="true" />
<Position>-1</Position>
<Width>120</Width>
<WindowId>16</WindowId>
<WindowId>18</WindowId>
</ColumnConfig>
</_columns>
<_filters z:Id="64" z:Size="0" />
<_formats z:Id="65" z:Size="1">
<FormatConfig z:Id="66">
<_filters z:Id="76" z:Size="0" />
<_formats z:Id="77" z:Size="1">
<FormatConfig z:Id="78">
<Id>
<u:Value>0</u:Value>
</Id>
<ConditionFieldName z:Id="67">Message</ConditionFieldName>
<ConditionRelation z:Id="68"></ConditionRelation>
<ConditionText z:Ref="68" i:nil="true" />
<Formats z:Id="69" z:Size="12">
<ConditionFieldName z:Ref="39" i:nil="true" />
<ConditionRelation z:Id="79"></ConditionRelation>
<ConditionText z:Ref="79" i:nil="true" />
<Formats z:Id="80" z:Size="12">
<a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:Key z:Id="70" i:type="LogLevelSurrogated">
<LevelName z:Id="71">VERBOSE</LevelName>
<a:Key z:Id="81" i:type="LogLevelSurrogated">
<LevelName z:Id="82">VERBOSE</LevelName>
</a:Key>
<a:Value z:Id="72">
<a:Value z:Id="83">
<Id>
<u:Value>2</u:Value>
<u:Value>4</u:Value>
</Id>
<Backcolor>
<b:knownColor>0</b:knownColor>
@ -349,25 +401,25 @@
<b:state>0</b:state>
<b:value>0</b:value>
</Backcolor>
<FontName z:Id="73">Tahoma</FontName>
<FontName z:Id="84">Tahoma</FontName>
<Forecolor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4290032820</b:value>
</Forecolor>
<Loglevel z:Ref="70" i:nil="true" />
<Loglevel z:Ref="81" i:nil="true" />
<Size>8.25</Size>
<Style>Regular</Style>
</a:Value>
</a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:Key z:Id="74" i:type="LogLevelSurrogated">
<LevelName z:Id="75">TRACE</LevelName>
<a:Key z:Id="85" i:type="LogLevelSurrogated">
<LevelName z:Id="86">TRACE</LevelName>
</a:Key>
<a:Value z:Id="76">
<a:Value z:Id="87">
<Id>
<u:Value>3</u:Value>
<u:Value>5</u:Value>
</Id>
<Backcolor>
<b:knownColor>0</b:knownColor>
@ -375,25 +427,25 @@
<b:state>0</b:state>
<b:value>0</b:value>
</Backcolor>
<FontName z:Id="77">Tahoma</FontName>
<FontName z:Id="88">Tahoma</FontName>
<Forecolor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4288716960</b:value>
</Forecolor>
<Loglevel z:Ref="74" i:nil="true" />
<Loglevel z:Ref="85" i:nil="true" />
<Size>8.25</Size>
<Style>Regular</Style>
</a:Value>
</a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:Key z:Id="78" i:type="LogLevelSurrogated">
<LevelName z:Id="79">DEBUG</LevelName>
<a:Key z:Id="89" i:type="LogLevelSurrogated">
<LevelName z:Id="90">DEBUG</LevelName>
</a:Key>
<a:Value z:Id="80">
<a:Value z:Id="91">
<Id>
<u:Value>4</u:Value>
<u:Value>6</u:Value>
</Id>
<Backcolor>
<b:knownColor>0</b:knownColor>
@ -401,25 +453,25 @@
<b:state>0</b:state>
<b:value>0</b:value>
</Backcolor>
<FontName z:Id="81">Tahoma</FontName>
<FontName z:Id="92">Tahoma</FontName>
<Forecolor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4286743170</b:value>
</Forecolor>
<Loglevel z:Ref="78" i:nil="true" />
<Loglevel z:Ref="89" i:nil="true" />
<Size>8.25</Size>
<Style>Regular</Style>
</a:Value>
</a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:Key z:Id="82" i:type="LogLevelSurrogated">
<LevelName z:Id="83">INFO</LevelName>
<a:Key z:Id="93" i:type="LogLevelSurrogated">
<LevelName z:Id="94">INFO</LevelName>
</a:Key>
<a:Value z:Id="84">
<a:Value z:Id="95">
<Id>
<u:Value>5</u:Value>
<u:Value>7</u:Value>
</Id>
<Backcolor>
<b:knownColor>0</b:knownColor>
@ -427,25 +479,25 @@
<b:state>0</b:state>
<b:value>0</b:value>
</Backcolor>
<FontName z:Id="85">Tahoma</FontName>
<FontName z:Id="96">Tahoma</FontName>
<Forecolor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4278190080</b:value>
</Forecolor>
<Loglevel z:Ref="82" i:nil="true" />
<Loglevel z:Ref="93" i:nil="true" />
<Size>8.25</Size>
<Style>Regular</Style>
</a:Value>
</a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:Key z:Id="86" i:type="LogLevelSurrogated">
<LevelName z:Id="87">NOTICE</LevelName>
<a:Key z:Id="97" i:type="LogLevelSurrogated">
<LevelName z:Id="98">NOTICE</LevelName>
</a:Key>
<a:Value z:Id="88">
<a:Value z:Id="99">
<Id>
<u:Value>6</u:Value>
<u:Value>8</u:Value>
</Id>
<Backcolor>
<b:knownColor>0</b:knownColor>
@ -453,25 +505,25 @@
<b:state>0</b:state>
<b:value>0</b:value>
</Backcolor>
<FontName z:Id="89">Tahoma</FontName>
<FontName z:Id="100">Tahoma</FontName>
<Forecolor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4281957177</b:value>
</Forecolor>
<Loglevel z:Ref="86" i:nil="true" />
<Loglevel z:Ref="97" i:nil="true" />
<Size>8.25</Size>
<Style>Regular</Style>
</a:Value>
</a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:Key z:Id="90" i:type="LogLevelSurrogated">
<LevelName z:Id="91">WARN</LevelName>
<a:Key z:Id="101" i:type="LogLevelSurrogated">
<LevelName z:Id="102">WARN</LevelName>
</a:Key>
<a:Value z:Id="92">
<a:Value z:Id="103">
<Id>
<u:Value>7</u:Value>
<u:Value>9</u:Value>
</Id>
<Backcolor>
<b:knownColor>0</b:knownColor>
@ -479,25 +531,25 @@
<b:state>0</b:state>
<b:value>0</b:value>
</Backcolor>
<FontName z:Id="93">Tahoma</FontName>
<FontName z:Id="104">Tahoma</FontName>
<Forecolor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4294934528</b:value>
</Forecolor>
<Loglevel z:Ref="90" i:nil="true" />
<Loglevel z:Ref="101" i:nil="true" />
<Size>8.25</Size>
<Style>Regular</Style>
</a:Value>
</a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:Key z:Id="94" i:type="LogLevelSurrogated">
<LevelName z:Id="95">ERROR</LevelName>
<a:Key z:Id="105" i:type="LogLevelSurrogated">
<LevelName z:Id="106">ERROR</LevelName>
</a:Key>
<a:Value z:Id="96">
<a:Value z:Id="107">
<Id>
<u:Value>8</u:Value>
<u:Value>10</u:Value>
</Id>
<Backcolor>
<b:knownColor>0</b:knownColor>
@ -505,25 +557,25 @@
<b:state>0</b:state>
<b:value>0</b:value>
</Backcolor>
<FontName z:Id="97">Tahoma</FontName>
<FontName z:Id="108">Tahoma</FontName>
<Forecolor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4294901760</b:value>
</Forecolor>
<Loglevel z:Ref="94" i:nil="true" />
<Loglevel z:Ref="105" i:nil="true" />
<Size>8.25</Size>
<Style>Regular</Style>
</a:Value>
</a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:Key z:Id="98" i:type="LogLevelSurrogated">
<LevelName z:Id="99">SEVERE</LevelName>
<a:Key z:Id="109" i:type="LogLevelSurrogated">
<LevelName z:Id="110">SEVERE</LevelName>
</a:Key>
<a:Value z:Id="100">
<a:Value z:Id="111">
<Id>
<u:Value>9</u:Value>
<u:Value>11</u:Value>
</Id>
<Backcolor>
<b:knownColor>0</b:knownColor>
@ -531,25 +583,25 @@
<b:state>0</b:state>
<b:value>0</b:value>
</Backcolor>
<FontName z:Id="101">Tahoma</FontName>
<FontName z:Id="112">Tahoma</FontName>
<Forecolor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4293067295</b:value>
</Forecolor>
<Loglevel z:Ref="98" i:nil="true" />
<Loglevel z:Ref="109" i:nil="true" />
<Size>8.25</Size>
<Style>Regular</Style>
</a:Value>
</a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:Key z:Id="102" i:type="LogLevelSurrogated">
<LevelName z:Id="103">CRITICAL</LevelName>
<a:Key z:Id="113" i:type="LogLevelSurrogated">
<LevelName z:Id="114">CRITICAL</LevelName>
</a:Key>
<a:Value z:Id="104">
<a:Value z:Id="115">
<Id>
<u:Value>10</u:Value>
<u:Value>12</u:Value>
</Id>
<Backcolor>
<b:knownColor>0</b:knownColor>
@ -557,25 +609,25 @@
<b:state>0</b:state>
<b:value>0</b:value>
</Backcolor>
<FontName z:Id="105">Tahoma</FontName>
<FontName z:Id="116">Tahoma</FontName>
<Forecolor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4289400377</b:value>
</Forecolor>
<Loglevel z:Ref="102" i:nil="true" />
<Loglevel z:Ref="113" i:nil="true" />
<Size>8.25</Size>
<Style>Regular</Style>
</a:Value>
</a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:Key z:Id="106" i:type="LogLevelSurrogated">
<LevelName z:Id="107">ALERT</LevelName>
<a:Key z:Id="117" i:type="LogLevelSurrogated">
<LevelName z:Id="118">ALERT</LevelName>
</a:Key>
<a:Value z:Id="108">
<a:Value z:Id="119">
<Id>
<u:Value>11</u:Value>
<u:Value>13</u:Value>
</Id>
<Backcolor>
<b:knownColor>0</b:knownColor>
@ -583,25 +635,25 @@
<b:state>0</b:state>
<b:value>0</b:value>
</Backcolor>
<FontName z:Id="109">Tahoma</FontName>
<FontName z:Id="120">Tahoma</FontName>
<Forecolor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4294902015</b:value>
</Forecolor>
<Loglevel z:Ref="106" i:nil="true" />
<Loglevel z:Ref="117" i:nil="true" />
<Size>8.25</Size>
<Style>Regular</Style>
</a:Value>
</a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:Key z:Id="110" i:type="LogLevelSurrogated">
<LevelName z:Id="111">FATAL</LevelName>
<a:Key z:Id="121" i:type="LogLevelSurrogated">
<LevelName z:Id="122">FATAL</LevelName>
</a:Key>
<a:Value z:Id="112">
<a:Value z:Id="123">
<Id>
<u:Value>12</u:Value>
<u:Value>14</u:Value>
</Id>
<Backcolor>
<b:knownColor>0</b:knownColor>
@ -609,25 +661,25 @@
<b:state>0</b:state>
<b:value>0</b:value>
</Backcolor>
<FontName z:Id="113">Tahoma</FontName>
<FontName z:Id="124">Tahoma</FontName>
<Forecolor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4287309977</b:value>
</Forecolor>
<Loglevel z:Ref="110" i:nil="true" />
<Loglevel z:Ref="121" i:nil="true" />
<Size>8.25</Size>
<Style>Regular</Style>
</a:Value>
</a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
<a:Key z:Id="114" i:type="LogLevelSurrogated">
<LevelName z:Id="115">EMERGENCY</LevelName>
<a:Key z:Id="125" i:type="LogLevelSurrogated">
<LevelName z:Id="126">EMERGENCY</LevelName>
</a:Key>
<a:Value z:Id="116">
<a:Value z:Id="127">
<Id>
<u:Value>13</u:Value>
<u:Value>15</u:Value>
</Id>
<Backcolor>
<b:knownColor>0</b:knownColor>
@ -635,62 +687,34 @@
<b:state>0</b:state>
<b:value>0</b:value>
</Backcolor>
<FontName z:Id="117">Tahoma</FontName>
<FontName z:Id="128">Tahoma</FontName>
<Forecolor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4285932413</b:value>
</Forecolor>
<Loglevel z:Ref="114" i:nil="true" />
<Loglevel z:Ref="125" i:nil="true" />
<Size>8.25</Size>
<Style>Regular</Style>
</a:Value>
</a:KeyValueOfLogLevelLoggerFormatConfigxIppDzWS>
</Formats>
<IgnoreCase>false</IgnoreCase>
<Name z:Id="118">Default Format Settings</Name>
<Name z:Id="129">Default Format Settings</Name>
</FormatConfig>
</_formats>
<_logLevels z:Id="119" z:Size="0" />
<_loggers z:Id="120" z:Size="1">
<LoggerConfig z:Id="121">
<_logLevels z:Id="130" z:Size="0" />
<_loggers z:Id="131" z:Size="1">
<LoggerConfig z:Id="132">
<Id>
<u:Value>45</u:Value>
<u:Value>77</u:Value>
</Id>
<LogLevel z:Ref="2" i:nil="true" />
<LoggerPath z:Ref="68" i:nil="true" />
<ReceiverId>14</ReceiverId>
<LogLevel z:Ref="6" i:nil="true" />
<LoggerPath z:Ref="79" i:nil="true" />
<ReceiverId>16</ReceiverId>
</LoggerConfig>
</_loggers>
<_receivers z:Id="122" z:Size="1">
<ReceiverConfig z:Id="123" i:type="n:UdpReceiverConfig">
<Id>
<u:Value>14</u:Value>
</Id>
<BackColor>
<b:knownColor>0</b:knownColor>
<b:name i:nil="true" />
<b:state>2</b:state>
<b:value>4293654015</b:value>
</BackColor>
<BufferSize>500000</BufferSize>
<Encoding z:Id="124">Windows-1252</Encoding>
<LevelFilter z:Ref="2" i:nil="true" />
<LoggingFrameworkId z:Id="125">Log4net</LoggingFrameworkId>
<Name z:Id="126">NzbDrone Reciver</Name>
<ParserType>XML</ParserType>
<ReadAdjacentMessages>0</ReadAdjacentMessages>
<ReadFrom>0001-01-01T00:00:00</ReadFrom>
<ReadUntil>0001-01-01T00:00:00</ReadUntil>
<SourceId>0</SourceId>
<TimeOffset>0</TimeOffset>
<TimeZone z:Id="127">Pacific Standard Time</TimeZone>
<UseFilter>false</UseFilter>
<Window>16</Window>
<n:HostName z:Id="128">localhost</n:HostName>
<n:Port>20480</n:Port>
</ReceiverConfig>
</_receivers>
<_sources z:Id="129" z:Size="0" />
</Presentation>
<Version>17</Version>
</Config>

@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using FizzWare.NBuilder;
using Moq;
using NUnit.Framework;
@ -9,7 +11,9 @@ using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.Commands;
using NzbDrone.Core.MediaFiles.EpisodeImport;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.MediaFileTests
@ -33,22 +37,22 @@ namespace NzbDrone.Core.Test.MediaFileTests
Mocker.GetMock<IDiskProvider>().Setup(c => c.GetDirectories(It.IsAny<string>()))
.Returns(_subFolders);
Mocker.GetMock<IDiskProvider>().Setup(c => c.FolderExists(It.IsAny<string>()))
.Returns(true);
Mocker.GetMock<IConfigService>().SetupGet(c => c.DownloadedEpisodesFolder)
.Returns("c:\\drop\\");
Mocker.GetMock<IImportApprovedEpisodes>()
.Setup(s => s.Import(It.IsAny<List<ImportDecision>>(), true))
.Returns(new List<ImportDecision>());
}
[Test]
public void should_import_file()
private void GivenValidSeries()
{
Subject.Execute(new DownloadedEpisodesScanCommand());
VerifyImport();
Mocker.GetMock<IParsingService>()
.Setup(s => s.GetSeries(It.IsAny<String>()))
.Returns(Builder<Series>.CreateNew().Build());
}
[Test]
@ -84,6 +88,60 @@ namespace NzbDrone.Core.Test.MediaFileTests
VerifyNoImport();
}
[Test]
public void should_not_import_if_folder_is_a_series_path()
{
Mocker.GetMock<ISeriesService>()
.Setup(s => s.SeriesPathExists(It.IsAny<String>()))
.Returns(true);
Mocker.GetMock<IDiskScanService>()
.Setup(c => c.GetVideoFiles(It.IsAny<string>(), It.IsAny<bool>()))
.Returns(new string[0]);
Subject.Execute(new DownloadedEpisodesScanCommand());
Mocker.GetMock<IParsingService>()
.Verify(v => v.GetSeries(It.IsAny<String>()), Times.Never());
}
[Test]
public void should_not_delete_folder_if_no_files_were_imported()
{
Mocker.GetMock<IImportApprovedEpisodes>()
.Setup(s => s.Import(It.IsAny<List<ImportDecision>>(), false))
.Returns(new List<ImportDecision>());
Subject.Execute(new DownloadedEpisodesScanCommand());
Mocker.GetMock<DiskProvider>()
.Verify(v => v.GetFolderSize(It.IsAny<String>()), Times.Never());
}
[Test]
public void should_delete_folder_if_files_were_imported()
{
GivenValidSeries();
var localEpisode = new LocalEpisode();
var imported = new List<ImportDecision>();
imported.Add(new ImportDecision(localEpisode));
Mocker.GetMock<IMakeImportDecision>()
.Setup(s => s.GetImportDecisions(It.IsAny<IEnumerable<String>>(), It.IsAny<Series>()))
.Returns(imported);
Mocker.GetMock<IImportApprovedEpisodes>()
.Setup(s => s.Import(It.IsAny<List<ImportDecision>>(), true))
.Returns(imported);
Subject.Execute(new DownloadedEpisodesScanCommand());
Mocker.GetMock<IDiskProvider>()
.Verify(v => v.DeleteFolder(It.IsAny<String>(), true), Times.Once());
}
private void VerifyNoImport()
{
Mocker.GetMock<IImportApprovedEpisodes>().Verify(c => c.Import(It.IsAny<List<ImportDecision>>(), true),

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Messaging;
@ -64,11 +65,15 @@ namespace NzbDrone.Core.MediaFiles
{
try
{
if (!_seriesService.SeriesPathExists(subFolder))
if (_seriesService.SeriesPathExists(subFolder))
{
ProcessSubFolder(new DirectoryInfo(subFolder));
continue;
}
var importedFiles = ProcessSubFolder(new DirectoryInfo(subFolder));
//Todo: We should make sure the file(s) are actually imported
if (importedFiles.Any())
{
if (_diskProvider.GetFolderSize(subFolder) < NotSampleSpecification.SampleSizeLimit)
{
_diskProvider.DeleteFolder(subFolder, true);
@ -85,14 +90,7 @@ namespace NzbDrone.Core.MediaFiles
{
try
{
var series = _parsingService.GetSeries(Path.GetFileNameWithoutExtension(videoFile));
if (series == null)
{
_logger.Debug("Unknown Series for file: {0}", videoFile);
}
ProcessVideoFile(videoFile, series);
ProcessVideoFile(videoFile);
}
catch (Exception ex)
{
@ -101,23 +99,31 @@ namespace NzbDrone.Core.MediaFiles
}
}
private void ProcessSubFolder(DirectoryInfo subfolderInfo)
private List<ImportDecision> ProcessSubFolder(DirectoryInfo subfolderInfo)
{
var series = _parsingService.GetSeries(subfolderInfo.Name);
if (series == null)
{
_logger.Debug("Unknown Series {0}", subfolderInfo.Name);
return;
return new List<ImportDecision>();
}
var videoFiles = _diskScanService.GetVideoFiles(subfolderInfo.FullName);
ProcessFiles(videoFiles, series);
return ProcessFiles(videoFiles, series);
}
private void ProcessVideoFile(string videoFile, Series series)
private void ProcessVideoFile(string videoFile)
{
var series = _parsingService.GetSeries(Path.GetFileNameWithoutExtension(videoFile));
if (series == null)
{
_logger.Debug("Unknown Series for file: {0}", videoFile);
return;
}
if (_diskProvider.IsFileLocked(new FileInfo(videoFile)))
{
_logger.Debug("[{0}] is currently locked by another process, skipping", videoFile);
@ -127,10 +133,10 @@ namespace NzbDrone.Core.MediaFiles
ProcessFiles(new[] { videoFile }, series);
}
private void ProcessFiles(IEnumerable<string> videoFiles, Series series)
private List<ImportDecision> ProcessFiles(IEnumerable<string> videoFiles, Series series)
{
var decisions = _importDecisionMaker.GetImportDecisions(videoFiles, series);
_importApprovedEpisodes.Import(decisions, true);
return _importApprovedEpisodes.Import(decisions, true);
}
public void Execute(DownloadedEpisodesScanCommand message)

Loading…
Cancel
Save