mirror of https://github.com/jellyfin/jellyfin.git
Remove old "has update available" code
This is the job of a package manager (or maybe the tray app for windows)
This commit is contained in:
parent
203c46de33
commit
b91c4be74c
|
@ -77,7 +77,6 @@ namespace Emby.Notifications
|
||||||
{
|
{
|
||||||
_libraryManager.ItemAdded += OnLibraryManagerItemAdded;
|
_libraryManager.ItemAdded += OnLibraryManagerItemAdded;
|
||||||
_appHost.HasPendingRestartChanged += OnAppHostHasPendingRestartChanged;
|
_appHost.HasPendingRestartChanged += OnAppHostHasPendingRestartChanged;
|
||||||
_appHost.HasUpdateAvailableChanged += OnAppHostHasUpdateAvailableChanged;
|
|
||||||
_activityManager.EntryCreated += OnActivityManagerEntryCreated;
|
_activityManager.EntryCreated += OnActivityManagerEntryCreated;
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
@ -132,25 +131,6 @@ namespace Emby.Notifications
|
||||||
return _config.GetConfiguration<NotificationOptions>("notifications");
|
return _config.GetConfiguration<NotificationOptions>("notifications");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void OnAppHostHasUpdateAvailableChanged(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (!_appHost.HasUpdateAvailable)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var type = NotificationType.ApplicationUpdateAvailable.ToString();
|
|
||||||
|
|
||||||
var notification = new NotificationRequest
|
|
||||||
{
|
|
||||||
Description = "Please see jellyfin.org for details.",
|
|
||||||
NotificationType = type,
|
|
||||||
Name = _localization.GetLocalizedString("NewVersionIsAvailable")
|
|
||||||
};
|
|
||||||
|
|
||||||
await SendNotification(notification, null).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnLibraryManagerItemAdded(object? sender, ItemChangeEventArgs e)
|
private void OnLibraryManagerItemAdded(object? sender, ItemChangeEventArgs e)
|
||||||
{
|
{
|
||||||
if (!FilterItem(e.Item))
|
if (!FilterItem(e.Item))
|
||||||
|
@ -325,7 +305,6 @@ namespace Emby.Notifications
|
||||||
|
|
||||||
_libraryManager.ItemAdded -= OnLibraryManagerItemAdded;
|
_libraryManager.ItemAdded -= OnLibraryManagerItemAdded;
|
||||||
_appHost.HasPendingRestartChanged -= OnAppHostHasPendingRestartChanged;
|
_appHost.HasPendingRestartChanged -= OnAppHostHasPendingRestartChanged;
|
||||||
_appHost.HasUpdateAvailableChanged -= OnAppHostHasUpdateAvailableChanged;
|
|
||||||
_activityManager.EntryCreated -= OnActivityManagerEntryCreated;
|
_activityManager.EntryCreated -= OnActivityManagerEntryCreated;
|
||||||
|
|
||||||
_disposed = true;
|
_disposed = true;
|
||||||
|
|
|
@ -1102,7 +1102,6 @@ namespace Emby.Server.Implementations
|
||||||
OperatingSystemDisplayName = OperatingSystem.Name,
|
OperatingSystemDisplayName = OperatingSystem.Name,
|
||||||
CanSelfRestart = CanSelfRestart,
|
CanSelfRestart = CanSelfRestart,
|
||||||
CanLaunchWebBrowser = CanLaunchWebBrowser,
|
CanLaunchWebBrowser = CanLaunchWebBrowser,
|
||||||
HasUpdateAvailable = HasUpdateAvailable,
|
|
||||||
TranscodingTempPath = ConfigurationManager.GetTranscodePath(),
|
TranscodingTempPath = ConfigurationManager.GetTranscodePath(),
|
||||||
ServerName = FriendlyName,
|
ServerName = FriendlyName,
|
||||||
LocalAddress = GetSmartApiUrl(source),
|
LocalAddress = GetSmartApiUrl(source),
|
||||||
|
@ -1252,26 +1251,6 @@ namespace Emby.Server.Implementations
|
||||||
|
|
||||||
protected abstract void ShutdownInternal();
|
protected abstract void ShutdownInternal();
|
||||||
|
|
||||||
public event EventHandler HasUpdateAvailableChanged;
|
|
||||||
|
|
||||||
private bool _hasUpdateAvailable;
|
|
||||||
|
|
||||||
public bool HasUpdateAvailable
|
|
||||||
{
|
|
||||||
get => _hasUpdateAvailable;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
var fireEvent = value && !_hasUpdateAvailable;
|
|
||||||
|
|
||||||
_hasUpdateAvailable = value;
|
|
||||||
|
|
||||||
if (fireEvent)
|
|
||||||
{
|
|
||||||
HasUpdateAvailableChanged?.Invoke(this, EventArgs.Empty);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<Assembly> GetApiPluginAssemblies()
|
public IEnumerable<Assembly> GetApiPluginAssemblies()
|
||||||
{
|
{
|
||||||
var assemblies = _allConcreteTypes
|
var assemblies = _allConcreteTypes
|
||||||
|
|
|
@ -16,8 +16,6 @@ namespace MediaBrowser.Controller
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IServerApplicationHost : IApplicationHost
|
public interface IServerApplicationHost : IApplicationHost
|
||||||
{
|
{
|
||||||
event EventHandler HasUpdateAvailableChanged;
|
|
||||||
|
|
||||||
bool CoreStartupHasCompleted { get; }
|
bool CoreStartupHasCompleted { get; }
|
||||||
|
|
||||||
bool CanLaunchWebBrowser { get; }
|
bool CanLaunchWebBrowser { get; }
|
||||||
|
@ -39,12 +37,6 @@ namespace MediaBrowser.Controller
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool ListenWithHttps { get; }
|
bool ListenWithHttps { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether this instance has update available.
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if this instance has update available; otherwise, <c>false</c>.</value>
|
|
||||||
bool HasUpdateAvailable { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the name of the friendly.
|
/// Gets the name of the friendly.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -130,6 +130,7 @@ namespace MediaBrowser.Model.System
|
||||||
/// Gets or sets a value indicating whether this instance has update available.
|
/// Gets or sets a value indicating whether this instance has update available.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value><c>true</c> if this instance has update available; otherwise, <c>false</c>.</value>
|
/// <value><c>true</c> if this instance has update available; otherwise, <c>false</c>.</value>
|
||||||
|
[Obsolete("This should be handled by the package manager")]
|
||||||
public bool HasUpdateAvailable { get; set; }
|
public bool HasUpdateAvailable { get; set; }
|
||||||
|
|
||||||
public FFmpegLocation EncoderLocation { get; set; }
|
public FFmpegLocation EncoderLocation { get; set; }
|
||||||
|
|
Loading…
Reference in New Issue