From d3f6c685cd980e53dfe4ab07eb66a78d78462a2a Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 18 Dec 2011 16:24:29 -0800 Subject: [PATCH] Cleaned up some unused code and a bit more exception handling for GetDirectories. --- NzbDrone.Web/Controllers/DirectoryController.cs | 6 ++++-- NzbDrone.Web/Controllers/SeriesController.cs | 8 -------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/NzbDrone.Web/Controllers/DirectoryController.cs b/NzbDrone.Web/Controllers/DirectoryController.cs index c3dbc5140..b4c711171 100644 --- a/NzbDrone.Web/Controllers/DirectoryController.cs +++ b/NzbDrone.Web/Controllers/DirectoryController.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Web.Mvc; using NzbDrone.Common; @@ -48,8 +49,9 @@ namespace NzbDrone.Web.Controllers dirs = _diskProvider.GetDirectories(term.Substring(0, index + 1)); } } - catch + catch (Exception ex) { + return Json(new List(), JsonRequestBehavior.AllowGet); //Swallow the exceptions so proper JSON is returned to the client (Empty results) } diff --git a/NzbDrone.Web/Controllers/SeriesController.cs b/NzbDrone.Web/Controllers/SeriesController.cs index 4a461565a..dfa2a3d6f 100644 --- a/NzbDrone.Web/Controllers/SeriesController.cs +++ b/NzbDrone.Web/Controllers/SeriesController.cs @@ -213,13 +213,5 @@ namespace NzbDrone.Web.Controllers return episodes; } - - private string GetSeasonString(int seasonNumber) - { - if (seasonNumber == 0) - return "Specials"; - - return String.Format("Season #{0}", seasonNumber); - } } } \ No newline at end of file