diff options
Diffstat (limited to 'MediaBrowser.ServerApplication')
| -rw-r--r-- | MediaBrowser.ServerApplication/ApplicationHost.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.ServerApplication/Networking/NetworkManager.cs | 34 |
2 files changed, 33 insertions, 3 deletions
diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 514fbe6c1..fc1319136 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -272,7 +272,7 @@ namespace MediaBrowser.ServerApplication DtoService = new DtoService(Logger, LibraryManager, UserManager, UserDataManager, ItemRepository, ImageProcessor); RegisterSingleInstance(DtoService); - LiveTvManager = new LiveTvManager(ApplicationPaths, FileSystemManager, Logger, ItemRepository, ImageProcessor, LocalizationManager, UserDataManager, DtoService, UserManager); + LiveTvManager = new LiveTvManager(ApplicationPaths, FileSystemManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager); RegisterSingleInstance(LiveTvManager); progress.Report(15); diff --git a/MediaBrowser.ServerApplication/Networking/NetworkManager.cs b/MediaBrowser.ServerApplication/Networking/NetworkManager.cs index 4799dcc72..e80c8ff3f 100644 --- a/MediaBrowser.ServerApplication/Networking/NetworkManager.cs +++ b/MediaBrowser.ServerApplication/Networking/NetworkManager.cs @@ -1,5 +1,8 @@ -using MediaBrowser.Common.Implementations.Networking; +using System.Globalization; +using System.IO; +using MediaBrowser.Common.Implementations.Networking; using MediaBrowser.Common.Net; +using MediaBrowser.Model.IO; using MediaBrowser.Model.Net; using System; using System.Collections.Generic; @@ -79,7 +82,7 @@ namespace MediaBrowser.ServerApplication.Networking /// </summary> /// <returns>Arraylist that represents all the SV_TYPE_WORKSTATION and SV_TYPE_SERVER /// PC's in the Domain</returns> - public IEnumerable<string> GetNetworkDevices() + private IEnumerable<string> GetNetworkDevicesInternal() { //local fields const int MAX_PREFERRED_LENGTH = -1; @@ -131,6 +134,33 @@ namespace MediaBrowser.ServerApplication.Networking NativeMethods.NetApiBufferFree(buffer); } } + + /// <summary> + /// Gets available devices within the domain + /// </summary> + /// <returns>PC's in the Domain</returns> + public IEnumerable<FileSystemEntryInfo> GetNetworkDevices() + { + return GetNetworkDevicesInternal().Select(c => new FileSystemEntryInfo + { + Name = c, + Path = NetworkPrefix + c, + Type = FileSystemEntryType.NetworkComputer + }); + } + + /// <summary> + /// Gets the network prefix. + /// </summary> + /// <value>The network prefix.</value> + private string NetworkPrefix + { + get + { + var separator = Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture); + return separator + separator; + } + } } } |
