diff options
Diffstat (limited to 'MediaBrowser.ServerApplication/ApplicationHost.cs')
| -rw-r--r-- | MediaBrowser.ServerApplication/ApplicationHost.cs | 63 |
1 files changed, 60 insertions, 3 deletions
diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 73f99cda1..479e07ee6 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -336,6 +336,51 @@ namespace MediaBrowser.ServerApplication { // Not there, no big deal } + + try + { + Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "fanart-movies"), true); + } + catch (IOException) + { + // Not there, no big deal + } + + try + { + Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "fanart-music"), true); + } + catch (IOException) + { + // Not there, no big deal + } + + try + { + Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "fanart-tv"), true); + } + catch (IOException) + { + // Not there, no big deal + } + + try + { + Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "tmdb-people"), true); + } + catch (IOException) + { + // Not there, no big deal + } + + try + { + Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "tvdb-v3"), true); + } + catch (IOException) + { + // Not there, no big deal + } }); } @@ -812,18 +857,30 @@ namespace MediaBrowser.ServerApplication HasUpdateAvailable = _hasUpdateAvailable, SupportsAutoRunAtStartup = SupportsAutoRunAtStartup, TranscodingTempPath = ApplicationPaths.TranscodingTempPath, - IsRunningAsService = IsRunningAsService + IsRunningAsService = IsRunningAsService, + ServerName = string.IsNullOrWhiteSpace(ServerConfigurationManager.Configuration.ServerName) ? Environment.MachineName : ServerConfigurationManager.Configuration.ServerName }; } private readonly CultureInfo _usCulture = new CultureInfo("en-US"); private string GetWanAddress() { - var ip = WanAddressEntryPoint.WanAddress; + var ip = ServerConfigurationManager.Configuration.WanDdns; + + if (string.IsNullOrWhiteSpace(ip)) + { + ip = WanAddressEntryPoint.WanAddress; + } if (!string.IsNullOrEmpty(ip)) { - return "http://" + ip + ":" + ServerConfigurationManager.Configuration.HttpServerPortNumber.ToString(_usCulture); + if (!ip.StartsWith("http://", StringComparison.OrdinalIgnoreCase) && + !ip.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) + { + ip = "http://" + ip; + } + + return ip + ":" + ServerConfigurationManager.Configuration.HttpServerPortNumber.ToString(_usCulture); } return null; |
