add tuner infos to tv service status

This commit is contained in:
Luke Pulverenti
2014-01-22 12:22:04 -05:00
parent 529a397b69
commit 9b370d904f
3 changed files with 96 additions and 1 deletions

View File

@@ -86,7 +86,10 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
if (options.DeleteEmptyFolders)
{
DeleteEmptyFolders(path);
foreach (var subfolder in GetDirectories(path).ToList())
{
DeleteEmptyFolders(subfolder);
}
}
}
@@ -99,6 +102,27 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
progress.Report(100);
}
/// <summary>
/// Gets the directories.
/// </summary>
/// <param name="path">The path.</param>
/// <returns>IEnumerable{System.String}.</returns>
private IEnumerable<string> GetDirectories(string path)
{
try
{
return Directory
.EnumerateDirectories(path, "*", SearchOption.TopDirectoryOnly)
.ToList();
}
catch (IOException ex)
{
_logger.ErrorException("Error getting files from {0}", ex, path);
return new List<string>();
}
}
/// <summary>
/// Gets the files to organize.
/// </summary>
@@ -164,6 +188,7 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
{
try
{
_logger.Debug("Deleting empty directory {0}", path);
Directory.Delete(path);
}
catch (UnauthorizedAccessException) { }