diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-22 12:22:04 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-22 12:22:04 -0500 |
| commit | 9b370d904feb99fd39ff7a94fe84a13697db31f5 (patch) | |
| tree | 72cacb4ce3a3c8aacd50c88eb69483fcb25badb6 | |
| parent | 529a397b699993839ab93b24af7c7bdd9323f6f5 (diff) | |
add tuner infos to tv service status
3 files changed, 96 insertions, 1 deletions
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs b/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs index cc5107590..4159e5271 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs @@ -1,4 +1,5 @@ using MediaBrowser.Model.LiveTv; +using System.Collections.Generic; namespace MediaBrowser.Controller.LiveTv { @@ -27,5 +28,66 @@ namespace MediaBrowser.Controller.LiveTv /// </summary> /// <value><c>true</c> if this instance has update available; otherwise, <c>false</c>.</value> public bool HasUpdateAvailable { get; set; } + + /// <summary> + /// Gets or sets the tuners. + /// </summary> + /// <value>The tuners.</value> + public List<LiveTvTunerInfo> Tuners { get; set; } + + public LiveTvServiceStatusInfo() + { + Tuners = new List<LiveTvTunerInfo>(); + } + } + + public class LiveTvTunerInfo + { + /// <summary> + /// Gets or sets the type of the source. + /// </summary> + /// <value>The type of the source.</value> + public string SourceType { get; set; } + + /// <summary> + /// Gets or sets the name. + /// </summary> + /// <value>The name.</value> + public string Name { get; set; } + + /// <summary> + /// Gets or sets the identifier. + /// </summary> + /// <value>The identifier.</value> + public string Id { get; set; } + + /// <summary> + /// Gets or sets the status. + /// </summary> + /// <value>The status.</value> + public LiveTvTunerStatus Status { get; set; } + + /// <summary> + /// Gets or sets the channel identifier. + /// </summary> + /// <value>The channel identifier.</value> + public string ChannelId { get; set; } + + /// <summary> + /// Gets or sets the timer identifier. + /// </summary> + /// <value>The timer identifier.</value> + public string TimerId { get; set; } + + /// <summary> + /// Gets or sets the clients. + /// </summary> + /// <value>The clients.</value> + public List<string> Clients { get; set; } + + public LiveTvTunerInfo() + { + Clients = new List<string>(); + } } } diff --git a/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs b/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs index b54369ef5..8597f6720 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs @@ -103,4 +103,12 @@ namespace MediaBrowser.Model.LiveTv Ok = 0, Unavailable = 1 } + + public enum LiveTvTunerStatus + { + Available = 0, + Disabled = 1, + RecordingTv = 2, + LiveTv = 3 + } } diff --git a/MediaBrowser.Server.Implementations/FileOrganization/TvFolderOrganizer.cs b/MediaBrowser.Server.Implementations/FileOrganization/TvFolderOrganizer.cs index ad3208b77..6a413f2f0 100644 --- a/MediaBrowser.Server.Implementations/FileOrganization/TvFolderOrganizer.cs +++ b/MediaBrowser.Server.Implementations/FileOrganization/TvFolderOrganizer.cs @@ -86,7 +86,10 @@ namespace MediaBrowser.Server.Implementations.FileOrganization if (options.DeleteEmptyFolders) { - DeleteEmptyFolders(path); + foreach (var subfolder in GetDirectories(path).ToList()) + { + DeleteEmptyFolders(subfolder); + } } } @@ -100,6 +103,27 @@ namespace MediaBrowser.Server.Implementations.FileOrganization } /// <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> /// <param name="path">The path.</param> @@ -164,6 +188,7 @@ namespace MediaBrowser.Server.Implementations.FileOrganization { try { + _logger.Debug("Deleting empty directory {0}", path); Directory.Delete(path); } catch (UnauthorizedAccessException) { } |
