Skip to content

Commit aebc545

Browse files
committed
Add KEFW2UI_PORT env var, increase reindex HTTP timeout to 60s, and fix alt->title on anchor
1 parent b1194bd commit aebc545

5 files changed

Lines changed: 16 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ A built-in MCP server at `/api/mcp` (Streamable HTTP transport) exposes the full
190190
| Flag | Env Var | Default | Description |
191191
|------|---------|---------|-------------|
192192
| `--bind` | `KEFW2UI_BIND` | `0.0.0.0` | Address to bind to |
193-
| `--port` | - | `8080` | Port to listen on |
193+
| `--port` | `KEFW2UI_PORT` | `8080` | Port to listen on |
194194
| `--speaker-ips` | `KEFW2UI_SPEAKER_IPS` | - | Comma-separated speaker IP addresses |
195195
| `--no-discovery` | `KEFW2UI_NO_DISCOVERY` | `false` | Skip mDNS speaker discovery |
196196
| `--image-cache-ttl` | `KEFW2UI_IMAGE_CACHE_TTL` | `7d` | Image cache disk TTL (`0` = never expire, e.g. `1h`, `7d`, `30d`) |

compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ services:
2525
restart: unless-stopped
2626
environment:
2727
- TZ=${TZ:-UTC}
28+
# - KEFW2UI_PORT=8080
29+
# - KEFW2UI_BIND=0.0.0.0
2830
# Speaker IPs (comma-separated, use with KEFW2UI_NO_DISCOVERY to skip mDNS)
2931
- KEFW2UI_SPEAKER_IPS=10.0.0.149,10.0.0.93
3032
- KEFW2UI_NO_DISCOVERY=true

frontend/src/lib/components/Settings/Settings.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@
964964
target="_blank"
965965
rel="noopener noreferrer"
966966
class="block text-green-400 hover:text-green-300"
967-
alt="Jens Hilligsøe's GitHub page">Jens Hilligsøe</a>
967+
title="Jens Hilligsøe's GitHub page">Jens Hilligsøe</a>
968968
</p>
969969
</div>
970970

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func main() {
9393
)
9494

9595
flag.StringVar(&bind, "bind", envOrDefault("KEFW2UI_BIND", "0.0.0.0"), "Address to bind to")
96-
flag.IntVar(&port, "port", 8080, "Port to listen on")
96+
flag.IntVar(&port, "port", envInt("KEFW2UI_PORT", 8080), "Port to listen on")
9797
flag.BoolVar(&showVersion, "version", false, "Print version and exit")
9898

9999
// Speaker flags (env vars provide defaults)

server/server.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,16 @@ func (s *Server) getAirableClient(spk *kefw2.KEFSpeaker) *kefw2.AirableClient {
173173
}))
174174
}
175175

176+
// getReindexAirableClient returns an AirableClient configured for reindexing.
177+
// Uses a longer HTTP timeout (60s) since indexing large libraries involves many
178+
// sequential browse requests that can be slow on NAS devices.
179+
func (s *Server) getReindexAirableClient(spk *kefw2.KEFSpeaker) *kefw2.AirableClient {
180+
return kefw2.NewAirableClient(spk, kefw2.WithCache(kefw2.CacheConfig{
181+
Enabled: true,
182+
TTL: 5 * time.Minute,
183+
}), kefw2.WithHTTPTimeout(60*time.Second))
184+
}
185+
176186
// getCachedAirableClient returns an AirableClient with the server's shared disk cache.
177187
// Use this for browse operations that benefit from persistent caching.
178188
func (s *Server) getCachedAirableClient(spk *kefw2.KEFSpeaker) *kefw2.AirableClient {
@@ -3252,7 +3262,7 @@ func (s *Server) handleUPnPReindex(w http.ResponseWriter, r *http.Request) {
32523262
s.reindexMu.Unlock()
32533263
}()
32543264

3255-
client := s.getAirableClient(spk)
3265+
client := s.getReindexAirableClient(spk)
32563266
log.Printf("Starting media index rebuild for server %q (container: %q)", upnp.DefaultServer, upnp.IndexContainer)
32573267

32583268
// Progress callback broadcasts SSE events

0 commit comments

Comments
 (0)