Skip to content

Commit

Permalink
Remove old "has update available" code
Browse files Browse the repository at this point in the history
This is the job of a package manager (or maybe the tray app for windows)
  • Loading branch information
Bond-009 committed Jul 11, 2021
1 parent 203c46d commit b91c4be
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 50 deletions.
21 changes: 0 additions & 21 deletions Emby.Notifications/NotificationEntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public Task RunAsync()
{
_libraryManager.ItemAdded += OnLibraryManagerItemAdded;
_appHost.HasPendingRestartChanged += OnAppHostHasPendingRestartChanged;
_appHost.HasUpdateAvailableChanged += OnAppHostHasUpdateAvailableChanged;
_activityManager.EntryCreated += OnActivityManagerEntryCreated;

return Task.CompletedTask;
Expand Down Expand Up @@ -132,25 +131,6 @@ private NotificationOptions GetOptions()
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)
{
if (!FilterItem(e.Item))
Expand Down Expand Up @@ -325,7 +305,6 @@ protected virtual void Dispose(bool disposing)

_libraryManager.ItemAdded -= OnLibraryManagerItemAdded;
_appHost.HasPendingRestartChanged -= OnAppHostHasPendingRestartChanged;
_appHost.HasUpdateAvailableChanged -= OnAppHostHasUpdateAvailableChanged;
_activityManager.EntryCreated -= OnActivityManagerEntryCreated;

_disposed = true;
Expand Down
21 changes: 0 additions & 21 deletions Emby.Server.Implementations/ApplicationHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,6 @@ public SystemInfo GetSystemInfo(IPAddress source)
OperatingSystemDisplayName = OperatingSystem.Name,
CanSelfRestart = CanSelfRestart,
CanLaunchWebBrowser = CanLaunchWebBrowser,
HasUpdateAvailable = HasUpdateAvailable,
TranscodingTempPath = ConfigurationManager.GetTranscodePath(),
ServerName = FriendlyName,
LocalAddress = GetSmartApiUrl(source),
Expand Down Expand Up @@ -1252,26 +1251,6 @@ public async Task Shutdown()

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()
{
var assemblies = _allConcreteTypes
Expand Down
8 changes: 0 additions & 8 deletions MediaBrowser.Controller/IServerApplicationHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ namespace MediaBrowser.Controller
/// </summary>
public interface IServerApplicationHost : IApplicationHost
{
event EventHandler HasUpdateAvailableChanged;

bool CoreStartupHasCompleted { get; }

bool CanLaunchWebBrowser { get; }
Expand All @@ -39,12 +37,6 @@ public interface IServerApplicationHost : IApplicationHost
/// </summary>
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>
/// Gets the name of the friendly.
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions MediaBrowser.Model/System/SystemInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public SystemInfo()
/// Gets or sets 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>
[Obsolete("This should be handled by the package manager")]
public bool HasUpdateAvailable { get; set; }

public FFmpegLocation EncoderLocation { get; set; }
Expand Down

0 comments on commit b91c4be

Please sign in to comment.