Compare commits

..
Author SHA1 Message Date
rootandClaude Opus 5.5 0516362461 iOS: Use Stem Server switch for Plex-only playback, build 42
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 08:59:13 -08:00
rootandClaude Opus 5.5 7843ff562b iOS build 41
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 07:23:02 -08:00
rootandClaude Opus 5.5 9e0d7236c2 iOS: seek bar uses the album art accent when Match Album Art is on
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 07:22:42 -08:00
6 changed files with 65 additions and 38 deletions

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@ final class HomeReach: @unchecked Sendable {
let (at, last) = stamp.with { (checkedAt, _last) }
if at != 0 && now - at < Self.ttl { return last }
let urls = settings.servers.map { $0.base + ($0.kind == .plex ? "/identity" : "/System/Info/Public") }
+ [settings.stemUrl.trimmingCharacters(in: CharacterSet(charactersIn: "/")) + "/api/info"]
+ (settings.stemServerOff ? [] : [settings.stemUrl.trimmingCharacters(in: CharacterSet(charactersIn: "/")) + "/api/info"])
let ok = await withTaskGroup(of: Bool.self) { g in
for u in urls { g.addTask { await self.answers(u) } }
for await r in g where r { g.cancelAll(); return true }
+3 -1
View File
@@ -107,7 +107,7 @@ final class Settings: @unchecked Sendable {
private static let keys = [
"servers", "plexUrl", "plexToken", "plexUser", "plexMachineId", "musicSection", "musicSectionTitle",
"stemUrl", "stemToken", "plexAccountToken", "stemRoots", "theme", "accent", "albumTheme", "albumColorNowPlaying", "highRefreshRate",
"stemUrl", "stemToken", "stemServerOff", "plexAccountToken", "stemRoots", "theme", "accent", "albumTheme", "albumColorNowPlaying", "highRefreshRate",
"stemQuality", "cacheLimitGb", "downloadsWifiOnly", "downloadSort", "keepStemMix", "masterVolume", "tabLayout",
"karaokeVocals", "karaokeSoftDb", "playbackSpeed", "stemsOnly", "noStems", "precacheCount", "hiddenNowPlaying", "presets", "presetOrder", "hiddenPresets", "lockedPreset", "webStations", "lockScreenMix", "swipeUpQueue", "acapella", "crossfadeSec", "sweetFades", "foldedArtLeft",
]
@@ -205,6 +205,8 @@ final class Settings: @unchecked Sendable {
/// The id a new server gets: empty (bare keys) when no server holds it yet.
func nextServerId() -> String { servers.contains { $0.id.isEmpty } ? MediaServer.newId() : "" }
/// Plex only: no stem index, no stemserve traffic.
var stemServerOff: Bool { get { read(\.stemServerOff, "stemServerOff", false) } set { write(\.stemServerOff, "stemServerOff", newValue, false) } }
var stemUrl: String { get { read(\.stemUrl, "stemUrl", "http://192.168.86.2:8765") } set { write(\.stemUrl, "stemUrl", newValue, "http://192.168.86.2:8765") } }
var stemToken: String { get { read(\.stemToken, "stemToken", "") } set { write(\.stemToken, "stemToken", newValue, "") } }
var plexAccountToken: String { get { read(\.plexAccountToken, "plexAccountToken", "") } set { write(\.plexAccountToken, "plexAccountToken", newValue, "") } }
+15 -2
View File
@@ -5,6 +5,7 @@ enum StemServerStatus: Equatable {
case unknown
case online(tracks: Int, transcode: Bool)
case offline(reason: String, cachedTracks: Int)
case off
var isOnline: Bool { if case .online = self { true } else { false } }
}
@@ -65,7 +66,8 @@ final class StemServer: @unchecked Sendable {
self.settings = settings
indexFile = dir.appendingPathComponent("stem_index.json")
etagFile = dir.appendingPathComponent("stem_index.etag")
if let data = try? Data(contentsOf: indexFile),
if settings.stemServerOff { status = .off }
else if let data = try? Data(contentsOf: indexFile),
let parsed = try? JSONDecoder().decode(StemIndexFile.self, from: data) {
index = StemIndex(parsed.tracks, roots: roots())
}
@@ -111,7 +113,7 @@ final class StemServer: @unchecked Sendable {
/// Reads /api/queue. A change in the finished count pulls the new index straight away.
func pollQueue() async {
guard !base.isEmpty,
guard !settings.stemServerOff, !base.isEmpty,
let u = try? url("/api/queue"),
let data = try? await http.data(req(u)),
let q = try? JSONDecoder().decode(QueueInfo.self, from: data) else { return }
@@ -146,6 +148,16 @@ final class StemServer: @unchecked Sendable {
func refresh(force: Bool = false) async {
await refreshLock.run {
if settings.stemServerOff {
await MainActor.run {
let had = self.index.size > 0
self.index = StemIndex([])
self.current = nil; self.pending = []; self.failed = []
self.status = .off
if had { self.indexListeners.forEach { $0() } }
}
return
}
do {
let info = try JSONDecoder().decode(ServerInfo.self, from: try await http.data(req(try url("/api/info"))))
transcode = info.ffmpeg
@@ -185,6 +197,7 @@ final class StemServer: @unchecked Sendable {
}
func find(_ track: Track) -> StemEntry? {
if settings.stemServerOff { return nil }
let idx = index
if let k = track.stemKey { return idx.entries.first { $0.key == k } }
let hit = idx.find(track.partFile, durationMs: track.durationMs)
@@ -239,7 +239,7 @@ struct NowPlayingScreen: View {
.padding(.top, tight || snug ? 8 : 14)
.transition(.opacity.combined(with: .move(edge: .top)))
}
ProgressVolumeBar(played: c.label, unplayed: c.label3, centerLabel: badge(track))
ProgressVolumeBar(played: g.settings.albumTheme ? c.accent : c.label, unplayed: c.label3, centerLabel: badge(track))
.padding(.top, tight ? (wide ? 14 : 18) : snug ? 14 : wide ? 24 : panel == .Art ? 34 : 30)
HStack(spacing: 0) {
SideToggle(symbol: "shuffle", on: pm.shuffle, action: pm.toggleShuffle, width: narrow ? 36 : 40)
+44 -32
View File
@@ -279,6 +279,7 @@ struct SettingsScreen: View {
case .online(let n, _): "\(n.formatted()) songs with stems"
case .offline(_, let cached): cached > 0 ? "Can't reach it, \(cached.formatted()) songs saved" : "Can't reach it"
case .unknown: "Checking…"
case .off: "Off, Plex only"
}
}
}
@@ -826,40 +827,51 @@ struct StemServerScreen: View {
let status = g.stems.status
List {
Section {
FieldCell(label: "Address", text: $url, placeholder: "http://192.168.86.2:8765")
FieldCell(label: "Token", text: $token, placeholder: "Optional", secret: true)
ActionCell(title: busy ? "Connecting…" : "Save & Connect") { connect() }
} header: { Header(text: "stemserve") } footer: {
Footer(text: "stemserve shares the Stems folder that stemd fills (port 8765). The app checks it for new stems every minute.\n\n" + matchNote)
}
Section {
ValueCell(title: "Connection", value: {
switch status {
case .online: "Online"
case .offline: "Offline"
case .unknown: "Checking"
}
}()).themedRow()
ValueCell(title: "Songs with Stems", value: {
switch status {
case .online(let n, _): "\(n)"
case .offline(_, let n): "\(n) (cached)"
case .unknown: "—"
}
}()).themedRow()
ValueCell(title: "stemd", value: g.stems.liveLine ?? (g.stems.failed.isEmpty ? "Idle" : "\(g.stems.failed.count) failed")).themedRow()
ValueCell(title: "Opus Transcoding", value: {
if case .online(_, let t) = status { return t ? "Available" : "No ffmpeg" }
return "—"
}()).themedRow()
if case .offline(let reason, _) = status {
VStack(alignment: .leading, spacing: 2) {
Text("Error").foregroundStyle(p.label)
Text(reason).font(.footnote).foregroundStyle(p.label2)
}
Toggle(isOn: Binding(get: { !g.settings.stemServerOff }, set: { on in
g.settings.stemServerOff = !on
Task { await g.stems.refresh(force: true) }
})) { Text("Use Stem Server").foregroundStyle(p.label) }
.tint(Color(hex: 0x34C759))
.themedRow()
}
if !g.settings.stemServerOff {
Section {
FieldCell(label: "Address", text: $url, placeholder: "http://192.168.86.2:8765")
FieldCell(label: "Token", text: $token, placeholder: "Optional", secret: true)
ActionCell(title: busy ? "Connecting…" : "Save & Connect") { connect() }
} header: { Header(text: "stemserve") } footer: {
Footer(text: "stemserve shares the Stems folder that stemd fills (port 8765). The app checks it for new stems every minute.\n\n" + matchNote)
}
} header: { Header(text: "Status") }
Section {
ValueCell(title: "Connection", value: {
switch status {
case .online: "Online"
case .offline: "Offline"
case .unknown: "Checking"
case .off: "Off"
}
}()).themedRow()
ValueCell(title: "Songs with Stems", value: {
switch status {
case .online(let n, _): "\(n)"
case .offline(_, let n): "\(n) (cached)"
case .unknown, .off: "—"
}
}()).themedRow()
ValueCell(title: "stemd", value: g.stems.liveLine ?? (g.stems.failed.isEmpty ? "Idle" : "\(g.stems.failed.count) failed")).themedRow()
ValueCell(title: "Opus Transcoding", value: {
if case .online(_, let t) = status { return t ? "Available" : "No ffmpeg" }
return "—"
}()).themedRow()
if case .offline(let reason, _) = status {
VStack(alignment: .leading, spacing: 2) {
Text("Error").foregroundStyle(p.label)
Text(reason).font(.footnote).foregroundStyle(p.label2)
}
.themedRow()
}
} header: { Header(text: "Status") }
}
}
.listStyle(.insetGrouped)
.themedList()
+1 -1
View File
@@ -9,7 +9,7 @@ settings:
# iOS needs a plain number for the bundle version; the label is what the app and releases show.
MARKETING_VERSION: "0.10.0"
VERSION_LABEL: "0.10.0"
CURRENT_PROJECT_VERSION: "40"
CURRENT_PROJECT_VERSION: "42"
# Dev builds override these (build-ipa.sh dev) so they install next to the release app.
APP_ID: org.cdnutter.stemify
APP_NAME: Stemify