fix: resolve build errors in forwarded headers and config endpoints

Fixed duplicate builder variable, deprecated KnownNetworks property, and removed non-existent SpotifyImportSettings properties from config endpoint.
This commit is contained in:
2026-02-09 13:12:21 -05:00
parent bdd753fd02
commit faa07c2791
3 changed files with 6 additions and 25 deletions

View File

@@ -1398,9 +1398,6 @@ public class AdminController : ControllerBase
{
enabled = _spotifyImportSettings.Enabled,
matchingIntervalHours = _spotifyImportSettings.MatchingIntervalHours,
syncStartHour = _spotifyImportSettings.SyncStartHour,
syncStartMinute = _spotifyImportSettings.SyncStartMinute,
syncWindowHours = _spotifyImportSettings.SyncWindowHours,
playlists = _spotifyImportSettings.Playlists.Select(p => new
{
name = p.Name,

View File

@@ -27,7 +27,7 @@ builder.Services.Configure<ForwardedHeadersOptions>(options =>
// Clear known networks and proxies to accept headers from any proxy
// This is safe when running behind a trusted reverse proxy (nginx)
options.KnownNetworks.Clear();
options.KnownIPNetworks.Clear();
options.KnownProxies.Clear();
// Trust X-Forwarded-* headers from any source
@@ -35,8 +35,6 @@ builder.Services.Configure<ForwardedHeadersOptions>(options =>
options.ForwardLimit = null;
});
var builder = WebApplication.CreateBuilder(args);
// Decode SquidWTF API base URLs once at startup
var squidWtfApiUrls = DecodeSquidWtfUrls();
static List<string> DecodeSquidWtfUrls()

View File

@@ -997,7 +997,7 @@
</div>
<div class="card">
<h2>Sync Schedule</h2>
<h2>Spotify Import Settings</h2>
<div class="config-section">
<div class="config-item">
<span class="label">Spotify Import Enabled</span>
@@ -1005,19 +1005,9 @@
<button onclick="openEditSetting('SPOTIFY_IMPORT_ENABLED', 'Spotify Import Enabled', 'toggle')">Edit</button>
</div>
<div class="config-item">
<span class="label">Sync Start Time</span>
<span class="value" id="config-sync-time">-</span>
<button onclick="openEditSetting('SPOTIFY_IMPORT_SYNC_START_HOUR', 'Sync Start Hour (0-23)', 'number')">Edit</button>
</div>
<div class="config-item">
<span class="label">Sync Start Minute</span>
<span class="value" id="config-sync-minute">-</span>
<button onclick="openEditSetting('SPOTIFY_IMPORT_SYNC_START_MINUTE', 'Sync Start Minute (0-59)', 'number')">Edit</button>
</div>
<div class="config-item">
<span class="label">Sync Window</span>
<span class="value" id="config-sync-window">-</span>
<button onclick="openEditSetting('SPOTIFY_IMPORT_SYNC_WINDOW_HOURS', 'Sync Window (hours)', 'number')">Edit</button>
<span class="label">Matching Interval (hours)</span>
<span class="value" id="config-matching-interval">-</span>
<button onclick="openEditSetting('SPOTIFY_IMPORT_MATCHING_INTERVAL_HOURS', 'Matching Interval (hours)', 'number', 'How often to check for playlist updates')">Edit</button>
</div>
</div>
</div>
@@ -1919,11 +1909,7 @@
// Sync settings
document.getElementById('config-spotify-import-enabled').textContent = data.spotifyImport?.enabled ? 'Yes' : 'No';
const syncHour = data.spotifyImport?.syncStartHour || 0;
const syncMin = data.spotifyImport?.syncStartMinute || 0;
document.getElementById('config-sync-time').textContent = `${String(syncHour).padStart(2, '0')}:${String(syncMin).padStart(2, '0')}`;
document.getElementById('config-sync-minute').textContent = String(syncMin).padStart(2, '0');
document.getElementById('config-sync-window').textContent = (data.spotifyImport?.syncWindowHours || 24) + ' hours';
document.getElementById('config-matching-interval').textContent = (data.spotifyImport?.matchingIntervalHours || 24) + ' hours';
} catch (error) {
console.error('Failed to fetch config:', error);
}