Removed all warnings

pull/7/merge
kay.one 14 years ago
parent a853f80f9e
commit 8b484601f6

@ -166,7 +166,7 @@ namespace Migrator.Providers
public virtual string Default(object defaultValue) public virtual string Default(object defaultValue)
{ {
if (defaultValue is String && defaultValue == String.Empty) if (defaultValue is String && defaultValue.ToString() == String.Empty)
{ {
defaultValue = "''"; defaultValue = "''";
} }

@ -18,7 +18,6 @@ namespace NzbDrone.Core.Test
private Episode tomorrow; private Episode tomorrow;
private Episode twoDays; private Episode twoDays;
private Episode sevenDays; private Episode sevenDays;
private Episode eightDays;
[SetUp] [SetUp]
public new void Setup() public new void Setup()

@ -211,7 +211,7 @@ namespace NzbDrone.Core.Test
[Test] [Test]
public void get_season_count_x5000() public void get_season_count_x500()
{ {
var mocker = new AutoMoqer(); var mocker = new AutoMoqer();
mocker.SetConstant(db); mocker.SetConstant(db);
@ -225,7 +225,7 @@ namespace NzbDrone.Core.Test
Console.WriteLine("Starting Test"); Console.WriteLine("Starting Test");
var sw = Stopwatch.StartNew(); var sw = Stopwatch.StartNew();
for (int i = 0; i < 5000; i++) for (int i = 0; i < 500; i++)
{ {
provider.GetSeasons(random.Next(1, 10)).Should().HaveSameCount(seasonsNumbers); provider.GetSeasons(random.Next(1, 10)).Should().HaveSameCount(seasonsNumbers);
} }

@ -85,5 +85,31 @@ namespace NzbDrone.Core.Model
return result; return result;
} }
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hash = 17;
hash = hash * 23 + Proper.GetHashCode();
hash = hash * 23 + QualityType.GetHashCode();
return hash;
}
}
public bool Equals(Quality other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Equals(other.QualityType, QualityType) && other.Proper.Equals(Proper);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != typeof (Quality)) return false;
return Equals((Quality) obj);
}
} }
} }

@ -139,7 +139,7 @@ namespace NzbDrone.Web.Controllers
return new JsonResult { Data = "ok" }; return new JsonResult { Data = "ok" };
} }
catch (Exception ex) catch (Exception)
{ {
return new JsonResult { Data = "failed" }; return new JsonResult { Data = "failed" };
} }

@ -50,7 +50,7 @@ namespace NzbDrone.Web.Controllers
return new SelectList(dirs, dirs.FirstOrDefault()); return new SelectList(dirs, dirs.FirstOrDefault());
} }
} }
catch(Exception ex) catch
{ {
//Swallow the exceptions so proper JSON is returned to the client (Empty results) //Swallow the exceptions so proper JSON is returned to the client (Empty results)
} }

@ -45,10 +45,6 @@
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Castle.Core, Version=2.5.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Libraries\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\Libraries\MVC3\Microsoft.Web.Infrastructure.dll</HintPath> <HintPath>..\Libraries\MVC3\Microsoft.Web.Infrastructure.dll</HintPath>

@ -91,8 +91,7 @@
Loading...</span> Loading...</span>
</div> </div>
} }
@{var specialSeason = Model.Seasons.Where(s => s == 0).FirstOrDefault();} @if (Model.Seasons.Any(s => s == 0))
@if (specialSeason != null)
{ {
<br /> <br />
@ -127,7 +126,7 @@
.DataBinding( .DataBinding(
d => d =>
d.Ajax().Select("_AjaxSeasonGrid", "Series", d.Ajax().Select("_AjaxSeasonGrid", "Series",
new RouteValueDictionary { { "seriesId", Model.SeriesId }, { "seasonNumber", specialSeason } } new RouteValueDictionary { { "seriesId", Model.SeriesId }, { "seasonNumber", 0 } }
)).Render(); } )).Render(); }
<span class="grid-loader"> <span class="grid-loader">
<img src="@Url.Content("~/Content/Images/Loading.gif")" alt="Loading"/> <img src="@Url.Content("~/Content/Images/Loading.gif")" alt="Loading"/>

Loading…
Cancel
Save