diff --git a/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs b/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs
index d1ec30210e..a118f7c265 100644
--- a/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs
+++ b/MediaBrowser.Common.Implementations/Updates/GithubUpdater.cs
@@ -33,7 +33,6 @@ namespace MediaBrowser.Common.Implementations.Updates
EnableKeepAlive = false,
CancellationToken = cancellationToken,
UserAgent = "Emby/3.0"
-
};
if (_cacheLength.Ticks > 0)
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
index 63d452bcee..a891a422a5 100644
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
@@ -74,6 +74,8 @@ namespace MediaBrowser.Model.Configuration
/// The metadata path.
public string MetadataPath { get; set; }
+ public string LastVersion { get; set; }
+
///
/// Gets or sets the display name of the season zero.
///
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
index 6332087391..51a53fe211 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -428,8 +428,24 @@ namespace MediaBrowser.Server.Implementations.HttpServer
if (string.Equals(localPath, "/mediabrowser/", StringComparison.OrdinalIgnoreCase) ||
string.Equals(localPath, "/mediabrowser", StringComparison.OrdinalIgnoreCase) ||
- localPath.IndexOf("mediabrowser/web", StringComparison.OrdinalIgnoreCase) != -1 ||
- localPath.IndexOf("dashboard/", StringComparison.OrdinalIgnoreCase) != -1)
+ localPath.IndexOf("mediabrowser/web", StringComparison.OrdinalIgnoreCase) != -1)
+ {
+ httpRes.StatusCode = 200;
+ httpRes.ContentType = "text/html";
+ var newUrl = urlString.Replace("mediabrowser", "emby", StringComparison.OrdinalIgnoreCase)
+ .Replace("/dashboard/", "/web/", StringComparison.OrdinalIgnoreCase);
+
+ if (!string.Equals(newUrl, urlString, StringComparison.OrdinalIgnoreCase))
+ {
+ httpRes.Write("
EmbyPlease update your Emby bookmark to " + newUrl + "");
+
+ httpRes.Close();
+ return;
+ }
+ }
+
+ if (localPath.IndexOf("dashboard/", StringComparison.OrdinalIgnoreCase) != -1 &&
+ localPath.IndexOf("web/dashboard", StringComparison.OrdinalIgnoreCase) == -1)
{
httpRes.StatusCode = 200;
httpRes.ContentType = "text/html";
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
index 8cb1d4f0db..8516e54ee9 100644
--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
@@ -385,6 +385,7 @@ namespace MediaBrowser.Server.Startup.Common
new OmdbEpisodeProviderMigration(ServerConfigurationManager),
new MovieDbEpisodeProviderMigration(ServerConfigurationManager),
new DbMigration(ServerConfigurationManager, TaskManager),
+ new UpdateLevelMigration(ServerConfigurationManager, this, HttpClient, JsonSerializer, _releaseAssetFilename),
new FolderViewSettingMigration(ServerConfigurationManager, UserManager),
new CollectionGroupingMigration(ServerConfigurationManager, UserManager),
new CollectionsViewMigration(ServerConfigurationManager, UserManager)
diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
index 808d25fc9c..979a3a3577 100644
--- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
+++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
@@ -77,6 +77,7 @@
+
diff --git a/MediaBrowser.Server.Startup.Common/Migrations/UpdateLevelMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/UpdateLevelMigration.cs
new file mode 100644
index 0000000000..fa354065c3
--- /dev/null
+++ b/MediaBrowser.Server.Startup.Common/Migrations/UpdateLevelMigration.cs
@@ -0,0 +1,97 @@
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using MediaBrowser.Common.Implementations.Updates;
+using MediaBrowser.Common.Net;
+using MediaBrowser.Controller;
+using MediaBrowser.Controller.Configuration;
+using MediaBrowser.Model.Serialization;
+using MediaBrowser.Model.Updates;
+
+namespace MediaBrowser.Server.Startup.Common.Migrations
+{
+ public class UpdateLevelMigration : IVersionMigration
+ {
+ private readonly IServerConfigurationManager _config;
+ private readonly IServerApplicationHost _appHost;
+ private readonly IHttpClient _httpClient;
+ private readonly IJsonSerializer _jsonSerializer;
+ private readonly string _releaseAssetFilename;
+
+ public UpdateLevelMigration(IServerConfigurationManager config, IServerApplicationHost appHost, IHttpClient httpClient, IJsonSerializer jsonSerializer, string releaseAssetFilename)
+ {
+ _config = config;
+ _appHost = appHost;
+ _httpClient = httpClient;
+ _jsonSerializer = jsonSerializer;
+ _releaseAssetFilename = releaseAssetFilename;
+ }
+
+ public async void Run()
+ {
+ var lastVersion = _config.Configuration.LastVersion;
+ var currentVersion = _appHost.ApplicationVersion;
+
+ if (string.Equals(lastVersion, currentVersion.ToString(), StringComparison.OrdinalIgnoreCase))
+ {
+ return;
+ }
+
+ try
+ {
+ var updateLevel = _config.Configuration.SystemUpdateLevel;
+
+ // Go down a level
+ if (updateLevel == PackageVersionClass.Release)
+ {
+ updateLevel = PackageVersionClass.Beta;
+ }
+ else if (updateLevel == PackageVersionClass.Beta)
+ {
+ updateLevel = PackageVersionClass.Dev;
+ }
+ else if (updateLevel == PackageVersionClass.Dev)
+ {
+ // It's already dev, there's nothing to check
+ return;
+ }
+
+ await CheckVersion(currentVersion, updateLevel, CancellationToken.None).ConfigureAwait(false);
+ }
+ catch
+ {
+
+ }
+ }
+
+ private async Task CheckVersion(Version currentVersion, PackageVersionClass updateLevel, CancellationToken cancellationToken)
+ {
+ var result = await new GithubUpdater(_httpClient, _jsonSerializer, TimeSpan.FromMinutes(5))
+ .CheckForUpdateResult("MediaBrowser", "Emby", currentVersion, PackageVersionClass.Beta, _releaseAssetFilename, "MBServer", "Mbserver.zip",
+ cancellationToken).ConfigureAwait(false);
+
+ if (result != null && result.IsUpdateAvailable)
+ {
+ _config.Configuration.SystemUpdateLevel = updateLevel;
+ _config.SaveConfiguration();
+ return;
+ }
+
+ // Go down a level
+ if (updateLevel == PackageVersionClass.Release)
+ {
+ updateLevel = PackageVersionClass.Beta;
+ }
+ else if (updateLevel == PackageVersionClass.Beta)
+ {
+ updateLevel = PackageVersionClass.Dev;
+ }
+ else
+ {
+ return;
+ }
+
+ await CheckVersion(currentVersion, updateLevel, cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs
index 12e1eb5eaf..aec4632ae8 100644
--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs
+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs
@@ -157,11 +157,21 @@ namespace MediaBrowser.WebDashboard.Api
var creator = GetPackageCreator();
var directory = creator.DashboardUIPath;
- var skipExtensions = GetUndeployedExtensions();
+ var skipExtensions = GetDeployIgnoreExtensions();
+ var skipNames = GetDeployIgnoreFilenames();
return
Directory.GetFiles(directory, "*", SearchOption.AllDirectories)
.Where(i => !skipExtensions.Contains(Path.GetExtension(i) ?? string.Empty, StringComparer.OrdinalIgnoreCase))
+ .Where(i => !skipNames.Any(s =>
+ {
+ if (s.Item2)
+ {
+ return string.Equals(s.Item1, Path.GetFileName(i), StringComparison.OrdinalIgnoreCase);
+ }
+
+ return (Path.GetFileName(i) ?? string.Empty).IndexOf(s.Item1, StringComparison.OrdinalIgnoreCase) != -1;
+ }))
.Select(i => i.Replace(directory, string.Empty, StringComparison.OrdinalIgnoreCase).Replace("\\", "/").TrimStart('/') + "?v=" + _appHost.ApplicationVersion.ToString())
.ToList();
}
@@ -300,7 +310,7 @@ namespace MediaBrowser.WebDashboard.Api
return new PackageCreator(_fileSystem, _localization, Logger, _serverConfigurationManager, _jsonSerializer);
}
- private List GetUndeployedExtensions()
+ private List GetDeployIgnoreExtensions()
{
var list = new List();
@@ -315,6 +325,28 @@ namespace MediaBrowser.WebDashboard.Api
return list;
}
+ private List> GetDeployIgnoreFilenames()
+ {
+ var list = new List>();
+
+ list.Add(new Tuple("copying", true));
+ list.Add(new Tuple("license", true));
+ list.Add(new Tuple("license-mit", true));
+ list.Add(new Tuple("gitignore", false));
+ list.Add(new Tuple("npmignore", false));
+ list.Add(new Tuple("jshintrc", false));
+ list.Add(new Tuple("gruntfile", false));
+ list.Add(new Tuple("bowerrc", false));
+ list.Add(new Tuple("jscsrc", false));
+ list.Add(new Tuple("hero.svg", false));
+ list.Add(new Tuple("travis.yml", false));
+ list.Add(new Tuple("build.js", false));
+ list.Add(new Tuple("editorconfig", false));
+ list.Add(new Tuple("gitattributes", false));
+
+ return list;
+ }
+
public async Task