Auto Discovery Cleanup (#10793)

* Call GetSmartApiUrl directly in UdpServer.RespondToV2Message

GetSmartApiUrl already returns PublishedServerUrl if set.

* Rewrite auto discovery using UdpClient and BackgroundService

* Respect network address settings in AutoDiscoveryHost

* Always listen on broadcast address in Linux for auto-discovery

* Await udp server tasks in AutoDiscoveryHost

* Only bind to broadcast addresses for IPv4

* Only bind to broadcast if IPv4 is enabled
This commit is contained in:
Patrick Barron
2024-01-06 15:34:09 -05:00
committed by GitHub
parent 82f93afa22
commit 43b32b0d94
4 changed files with 132 additions and 280 deletions

View File

@@ -6,6 +6,7 @@ using System.Net.Mime;
using System.Text;
using Jellyfin.Api.Middleware;
using Jellyfin.MediaEncoding.Hls.Extensions;
using Jellyfin.Networking;
using Jellyfin.Networking.HappyEyeballs;
using Jellyfin.Server.Extensions;
using Jellyfin.Server.HealthChecks;
@@ -13,7 +14,6 @@ using Jellyfin.Server.Implementations;
using Jellyfin.Server.Implementations.Extensions;
using Jellyfin.Server.Infrastructure;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Extensions;
using Microsoft.AspNetCore.Builder;
@@ -121,6 +121,8 @@ namespace Jellyfin.Server
.AddCheck<DbContextFactoryHealthCheck<JellyfinDbContext>>(nameof(JellyfinDbContext));
services.AddHlsPlaylistGenerator();
services.AddHostedService<AutoDiscoveryHost>();
}
/// <summary>