From 579b507f7fa322fdf8a746b6e787015d0567e2a6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 30 Oct 2013 19:15:58 -0400 Subject: use IFileSystem interface to get creation time --- MediaBrowser.Controller/IO/FileSystem.cs | 21 --------------------- MediaBrowser.Controller/IO/IFileSystem.cs | 10 +++++++++- 2 files changed, 9 insertions(+), 22 deletions(-) (limited to 'MediaBrowser.Controller/IO') diff --git a/MediaBrowser.Controller/IO/FileSystem.cs b/MediaBrowser.Controller/IO/FileSystem.cs index f31fc53de..b08e8da27 100644 --- a/MediaBrowser.Controller/IO/FileSystem.cs +++ b/MediaBrowser.Controller/IO/FileSystem.cs @@ -30,27 +30,6 @@ namespace MediaBrowser.Controller.IO } } - /// - /// Gets the creation time UTC. - /// - /// The info. - /// The logger. - /// DateTime. - public static DateTime GetCreationTimeUtc(FileSystemInfo info, ILogger logger) - { - // This could throw an error on some file systems that have dates out of range - - try - { - return info.CreationTimeUtc; - } - catch (Exception ex) - { - logger.ErrorException("Error determining CreationTimeUtc for {0}", ex, info.FullName); - return DateTime.MinValue; - } - } - /// /// Copies all. /// diff --git a/MediaBrowser.Controller/IO/IFileSystem.cs b/MediaBrowser.Controller/IO/IFileSystem.cs index 2654c3235..cbc5c7bf3 100644 --- a/MediaBrowser.Controller/IO/IFileSystem.cs +++ b/MediaBrowser.Controller/IO/IFileSystem.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; namespace MediaBrowser.Controller.IO { @@ -41,5 +42,12 @@ namespace MediaBrowser.Controller.IO /// The filename. /// System.String. string GetValidFilename(string filename); + + /// + /// Gets the creation time UTC. + /// + /// The info. + /// DateTime. + DateTime GetCreationTimeUtc(FileSystemInfo info); } } -- cgit v1.2.3