From 034d0c46e53154a3f2152804b34300e78fecb9ba Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Fri, 25 Nov 2011 15:46:29 -0800 Subject: [PATCH] Updated some logs, removed .vob .ts from video extentions --- NzbDrone.Common/ServiceProvider.cs | 6 +++--- NzbDrone.Core/Providers/DiskScanProvider.cs | 4 ++-- NzbDrone.Core/Providers/SearchProvider.cs | 2 +- NzbDrone.Core/WebTimer.cs | 4 ++-- NzbDrone.Update/Providers/UpdateProvider.cs | 3 +++ 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/NzbDrone.Common/ServiceProvider.cs b/NzbDrone.Common/ServiceProvider.cs index a5a2138e6..788a52a1f 100644 --- a/NzbDrone.Common/ServiceProvider.cs +++ b/NzbDrone.Common/ServiceProvider.cs @@ -12,7 +12,7 @@ namespace NzbDrone.Common { public const string NZBDRONE_SERVICE_NAME = "NzbDrone"; - private static readonly Logger Logger = LogManager.GetLogger("Host.ServiceManager"); + private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); public virtual bool ServiceExist(string name) { @@ -90,7 +90,7 @@ namespace NzbDrone.Common public virtual void Stop(string serviceName) { - Logger.Info("Stopping {0} Service..."); + Logger.Info("Stopping {0} Service...", serviceName); var service = GetService(serviceName); if (service == null) { @@ -108,7 +108,7 @@ namespace NzbDrone.Common service.Refresh(); if (service.Status == ServiceControllerStatus.Stopped) { - Logger.Info("{0} has stopped successfully."); + Logger.Info("{0} has stopped successfully.", serviceName); } else { diff --git a/NzbDrone.Core/Providers/DiskScanProvider.cs b/NzbDrone.Core/Providers/DiskScanProvider.cs index edefc3f69..92838bdba 100644 --- a/NzbDrone.Core/Providers/DiskScanProvider.cs +++ b/NzbDrone.Core/Providers/DiskScanProvider.cs @@ -15,7 +15,7 @@ namespace NzbDrone.Core.Providers public class DiskScanProvider { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - private static readonly string[] MediaExtentions = new[] { ".mkv", ".avi", ".wmv", ".mp4", ".mpg", ".mpeg", ".xvid", ".flv", ".mov", ".vob", ".ts", ".rm", ".rmvb", ".xvid", ".dvr-ms" }; + private static readonly string[] MediaExtentions = new[] { ".mkv", ".avi", ".wmv", ".mp4", ".mpg", ".mpeg", ".xvid", ".flv", ".mov", ".rm", ".rmvb", ".xvid", ".dvr-ms" }; private readonly DiskProvider _diskProvider; private readonly EpisodeProvider _episodeProvider; private readonly MediaFileProvider _mediaFileProvider; @@ -235,7 +235,7 @@ namespace NzbDrone.Core.Providers private List GetVideoFiles(string path) { - Logger.Debug("Scanning '{0}' for episodes", path); + Logger.Debug("Scanning '{0}' for video files", path); var filesOnDisk = _diskProvider.GetFiles(path, SearchOption.AllDirectories); diff --git a/NzbDrone.Core/Providers/SearchProvider.cs b/NzbDrone.Core/Providers/SearchProvider.cs index 9b5f43a21..2c92bfed6 100644 --- a/NzbDrone.Core/Providers/SearchProvider.cs +++ b/NzbDrone.Core/Providers/SearchProvider.cs @@ -157,7 +157,7 @@ namespace NzbDrone.Core.Providers //TODO:fix this so when search returns more than one episode - //TODO:-its populated with more than the original episode. + //its populated with more than the original episode. reports.ForEach(c => { c.Series = series; diff --git a/NzbDrone.Core/WebTimer.cs b/NzbDrone.Core/WebTimer.cs index 9208fb1ee..e865a169d 100644 --- a/NzbDrone.Core/WebTimer.cs +++ b/NzbDrone.Core/WebTimer.cs @@ -22,10 +22,10 @@ namespace NzbDrone.Core _jobProvider = jobProvider; } - //TODO: Make timer doesn't keep running during unit tests. + //TODO: Fix this so the timer doesn't keep running during unit tests. public void StartTimer(int secondInterval) { - _onCacheRemove = new CacheItemRemovedCallback(DoWork); + _onCacheRemove = DoWork; HttpRuntime.Cache.Insert(GetType().ToString(), secondInterval, null, DateTime.Now.AddSeconds(secondInterval), Cache.NoSlidingExpiration, diff --git a/NzbDrone.Update/Providers/UpdateProvider.cs b/NzbDrone.Update/Providers/UpdateProvider.cs index 212380ece..2080f51d1 100644 --- a/NzbDrone.Update/Providers/UpdateProvider.cs +++ b/NzbDrone.Update/Providers/UpdateProvider.cs @@ -60,6 +60,8 @@ namespace NzbDrone.Update.Providers _serviceProvider.Stop(ServiceProvider.NZBDRONE_SERVICE_NAME); } + //TODO:Should be able to restart service if anything beyond this point fails + logger.Info("Killing all running processes"); var processes = _processProvider.GetProcessByName(ProcessProvider.NzbDroneProccessName); foreach (var processInfo in processes) @@ -102,6 +104,7 @@ namespace NzbDrone.Update.Providers private void RollBack(string targetFolder) { + //TODO:this should ignore single file failures. logger.Info("Attempting to rollback upgrade"); _diskProvider.CopyDirectory(_enviromentProvider.GetUpdateBackUpFolder(), targetFolder); }