Removed remaining self-update code
This commit is contained in:
parent
395072239d
commit
77a5617774
|
@ -11,101 +11,81 @@ namespace Emby.Notifications
|
||||||
public class CoreNotificationTypes : INotificationTypeFactory
|
public class CoreNotificationTypes : INotificationTypeFactory
|
||||||
{
|
{
|
||||||
private readonly ILocalizationManager _localization;
|
private readonly ILocalizationManager _localization;
|
||||||
private readonly IServerApplicationHost _appHost;
|
|
||||||
|
|
||||||
public CoreNotificationTypes(ILocalizationManager localization, IServerApplicationHost appHost)
|
public CoreNotificationTypes(ILocalizationManager localization)
|
||||||
{
|
{
|
||||||
_localization = localization;
|
_localization = localization;
|
||||||
_appHost = appHost;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<NotificationTypeInfo> GetNotificationTypes()
|
public IEnumerable<NotificationTypeInfo> GetNotificationTypes()
|
||||||
{
|
{
|
||||||
var knownTypes = new List<NotificationTypeInfo>
|
var knownTypes = new NotificationTypeInfo[]
|
||||||
{
|
{
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.ApplicationUpdateInstalled.ToString()
|
Type = NotificationType.ApplicationUpdateInstalled.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.InstallationFailed.ToString()
|
Type = NotificationType.InstallationFailed.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.PluginInstalled.ToString()
|
Type = NotificationType.PluginInstalled.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.PluginError.ToString()
|
Type = NotificationType.PluginError.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.PluginUninstalled.ToString()
|
Type = NotificationType.PluginUninstalled.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.PluginUpdateInstalled.ToString()
|
Type = NotificationType.PluginUpdateInstalled.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.ServerRestartRequired.ToString()
|
Type = NotificationType.ServerRestartRequired.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.TaskFailed.ToString()
|
Type = NotificationType.TaskFailed.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.NewLibraryContent.ToString()
|
Type = NotificationType.NewLibraryContent.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.AudioPlayback.ToString()
|
Type = NotificationType.AudioPlayback.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.VideoPlayback.ToString()
|
Type = NotificationType.VideoPlayback.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.AudioPlaybackStopped.ToString()
|
Type = NotificationType.AudioPlaybackStopped.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.VideoPlaybackStopped.ToString()
|
Type = NotificationType.VideoPlaybackStopped.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.CameraImageUploaded.ToString()
|
Type = NotificationType.CameraImageUploaded.ToString()
|
||||||
},
|
},
|
||||||
|
|
||||||
new NotificationTypeInfo
|
new NotificationTypeInfo
|
||||||
{
|
{
|
||||||
Type = NotificationType.UserLockedOut.ToString()
|
Type = NotificationType.UserLockedOut.ToString()
|
||||||
}
|
},
|
||||||
};
|
new NotificationTypeInfo
|
||||||
|
|
||||||
if (!_appHost.CanSelfUpdate)
|
|
||||||
{
|
|
||||||
knownTypes.Add(new NotificationTypeInfo
|
|
||||||
{
|
{
|
||||||
Type = NotificationType.ApplicationUpdateAvailable.ToString()
|
Type = NotificationType.ApplicationUpdateAvailable.ToString()
|
||||||
});
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
foreach (var type in knownTypes)
|
foreach (var type in knownTypes)
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace Emby.Notifications
|
||||||
_localization = localization;
|
_localization = localization;
|
||||||
_activityManager = activityManager;
|
_activityManager = activityManager;
|
||||||
|
|
||||||
_coreNotificationTypes = new CoreNotificationTypes(localization, appHost).GetNotificationTypes().Select(i => i.Type).ToArray();
|
_coreNotificationTypes = new CoreNotificationTypes(localization).GetNotificationTypes().Select(i => i.Type).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task RunAsync()
|
public Task RunAsync()
|
||||||
|
@ -127,7 +127,7 @@ namespace Emby.Notifications
|
||||||
async void _appHost_HasUpdateAvailableChanged(object sender, EventArgs e)
|
async void _appHost_HasUpdateAvailableChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
// This notification is for users who can't auto-update (aka running as service)
|
// This notification is for users who can't auto-update (aka running as service)
|
||||||
if (!_appHost.HasUpdateAvailable || _appHost.CanSelfUpdate)
|
if (!_appHost.HasUpdateAvailable)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,12 +72,6 @@ namespace Emby.Server.Implementations.AppBase
|
||||||
/// <value>The plugin configurations path.</value>
|
/// <value>The plugin configurations path.</value>
|
||||||
public string PluginConfigurationsPath => Path.Combine(PluginsPath, "configurations");
|
public string PluginConfigurationsPath => Path.Combine(PluginsPath, "configurations");
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the path to where temporary update files will be stored
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The plugin configurations path.</value>
|
|
||||||
public string TempUpdatePath => Path.Combine(ProgramDataPath, "updates");
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the path to the log directory
|
/// Gets the path to the log directory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -123,12 +123,6 @@ namespace Emby.Server.Implementations
|
||||||
/// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
|
/// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
|
||||||
public abstract bool CanSelfRestart { get; }
|
public abstract bool CanSelfRestart { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets a value indicating whether this instance can self update.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
|
|
||||||
public virtual bool CanSelfUpdate => false;
|
|
||||||
|
|
||||||
public virtual bool CanLaunchWebBrowser
|
public virtual bool CanLaunchWebBrowser
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -1458,7 +1452,6 @@ namespace Emby.Server.Implementations
|
||||||
OperatingSystem = EnvironmentInfo.OperatingSystem.ToString(),
|
OperatingSystem = EnvironmentInfo.OperatingSystem.ToString(),
|
||||||
OperatingSystemDisplayName = EnvironmentInfo.OperatingSystemName,
|
OperatingSystemDisplayName = EnvironmentInfo.OperatingSystemName,
|
||||||
CanSelfRestart = CanSelfRestart,
|
CanSelfRestart = CanSelfRestart,
|
||||||
CanSelfUpdate = CanSelfUpdate,
|
|
||||||
CanLaunchWebBrowser = CanLaunchWebBrowser,
|
CanLaunchWebBrowser = CanLaunchWebBrowser,
|
||||||
WanAddress = wanAddress,
|
WanAddress = wanAddress,
|
||||||
HasUpdateAvailable = HasUpdateAvailable,
|
HasUpdateAvailable = HasUpdateAvailable,
|
||||||
|
@ -1757,21 +1750,6 @@ namespace Emby.Server.Implementations
|
||||||
Plugins = list.ToArray();
|
Plugins = list.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates the application.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="package">The package that contains the update</param>
|
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
|
||||||
/// <param name="progress">The progress.</param>
|
|
||||||
public async Task UpdateApplication(PackageVersionInfo package, CancellationToken cancellationToken, IProgress<double> progress)
|
|
||||||
{
|
|
||||||
await InstallationManager.InstallPackage(package, false, progress, cancellationToken).ConfigureAwait(false);
|
|
||||||
|
|
||||||
HasUpdateAvailable = false;
|
|
||||||
|
|
||||||
OnApplicationUpdated(package);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This returns localhost in the case of no external dns, and the hostname if the
|
/// This returns localhost in the case of no external dns, and the hostname if the
|
||||||
/// dns is prefixed with a valid Uri prefix.
|
/// dns is prefixed with a valid Uri prefix.
|
||||||
|
|
|
@ -41,12 +41,6 @@ namespace MediaBrowser.Common.Configuration
|
||||||
/// <value>The plugin configurations path.</value>
|
/// <value>The plugin configurations path.</value>
|
||||||
string PluginConfigurationsPath { get; }
|
string PluginConfigurationsPath { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the path to where temporary update files will be stored
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The plugin configurations path.</value>
|
|
||||||
string TempUpdatePath { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the path to the log directory
|
/// Gets the path to the log directory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -72,12 +72,6 @@ namespace MediaBrowser.Common
|
||||||
/// <value>The application user agent.</value>
|
/// <value>The application user agent.</value>
|
||||||
string ApplicationUserAgent { get; }
|
string ApplicationUserAgent { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets a value indicating whether this instance can self update.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
|
|
||||||
bool CanSelfUpdate { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the exports.
|
/// Gets the exports.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -86,12 +80,6 @@ namespace MediaBrowser.Common
|
||||||
/// <returns>IEnumerable{``0}.</returns>
|
/// <returns>IEnumerable{``0}.</returns>
|
||||||
IEnumerable<T> GetExports<T>(bool manageLifetime = true);
|
IEnumerable<T> GetExports<T>(bool manageLifetime = true);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates the application.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Task.</returns>
|
|
||||||
Task UpdateApplication(PackageVersionInfo package, CancellationToken cancellationToken, IProgress<double> progress);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resolves this instance.
|
/// Resolves this instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -60,12 +60,6 @@ namespace MediaBrowser.Model.System
|
||||||
/// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
|
/// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
|
||||||
public bool CanSelfRestart { get; set; }
|
public bool CanSelfRestart { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets a value indicating whether this instance can self update.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
|
|
||||||
public bool CanSelfUpdate { get; set; }
|
|
||||||
|
|
||||||
public bool CanLaunchWebBrowser { get; set; }
|
public bool CanLaunchWebBrowser { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user