Stemify iOS 1.1 and WebUI updates, repo restructure into desktop/ios/server/web
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
894dd5a695
commit
df5d847169
157 files changed
+3935
-742
No files matched your search
@@ -38,14 +38,14 @@ final class StemCoverage: @unchecked Sendable {
|
||||
self.settings = settings
|
||||
file = dir.appendingPathComponent("library_tracks.json")
|
||||
listing = (try? Data(contentsOf: file)).flatMap { try? JSONDecoder().decode(Listing.self, from: $0) }
|
||||
settings.onChange("musicSection") { [weak self] in self?.sectionChanged() }
|
||||
settings.onChange("servers") { [weak self] in self?.sectionChanged() }
|
||||
stems.onIndexChange { [weak self] in self?.recompute() }
|
||||
sectionChanged()
|
||||
recompute()
|
||||
}
|
||||
|
||||
private func sectionChanged() {
|
||||
let section = settings.musicSection
|
||||
let section = settings.libraryKey
|
||||
guard !section.isEmpty else { return }
|
||||
if let l = listing, l.section == section, Date().timeIntervalSince1970 - l.at <= Self.staleSeconds { return }
|
||||
Task { await refresh() }
|
||||
@@ -54,7 +54,7 @@ final class StemCoverage: @unchecked Sendable {
|
||||
/// Lists every track in the library again (every few hours).
|
||||
func refresh() async {
|
||||
await lock.run {
|
||||
let section = settings.musicSection
|
||||
let section = settings.libraryKey
|
||||
guard !section.isEmpty, plex.signedIn else { return }
|
||||
var all: [Slim] = []
|
||||
do {
|
||||
@@ -76,7 +76,7 @@ final class StemCoverage: @unchecked Sendable {
|
||||
}
|
||||
|
||||
private func recompute() {
|
||||
guard let l = listing, l.section == settings.musicSection, stems.index.size > 0 else { return }
|
||||
guard let l = listing, l.section == settings.libraryKey, stems.index.size > 0 else { return }
|
||||
let tracks = l.tracks
|
||||
Task.detached { [self] in
|
||||
var al: [String: (Int, Int)] = [:]
|
||||
|
||||
Reference in new issue
Block a user