performance updates now qwith progress on import

This commit is contained in:
Mark Gregory
2026-11-06 09:30:42 +00:00
parent 48d8ffe804
commit e331b0e5b2
4 changed files with 12 additions and 9 deletions
+1 -1
View File
@@ -648,7 +648,7 @@ struct StudioSettingsDialog: View {
VStack(spacing:0) {
HStack {
Text(category).font(.headline).frame(maxWidth:.infinity,alignment:.leading)
Picker("Settings for",selection:$scope) { Text("Karaoke").tag("Karaoke");Text("DJ").tag("DJ") }.pickerStyle(.segmented).frame(width:220)
Picker("Settings for",selection:$scope) { Text("Karaoke Studio").tag("Karaoke");Text("DJ Studio").tag("DJ") }.pickerStyle(.segmented).frame(width:280)
}.padding(.horizontal,24).padding(.top,18).padding(.bottom,10)
HStack(spacing:8) {
ForEach(categories,id:\.self) { name in
+6 -5
View File
@@ -499,6 +499,7 @@ struct SongDragReference: Codable, Sendable {
self.importToken = nil;self.importTask = nil;self.isImporting = false
self.perform { try self.refresh() }
self.importProgress = result
if let failure = result.failure { self.error = failure }
}
}
}
@@ -880,7 +881,7 @@ struct LibraryView: View {
}
private var workspaceLayout: some View {
TabView(selection:$workspaceTab) {
libraryWorkspace.tabItem { Label("Karaoke",systemImage:"music.mic") }.tag("Karaoke")
libraryWorkspace.tabItem { Label("Karaoke Studio",systemImage:"music.mic") }.tag("Karaoke")
DJConsole(system:model.dj)
.tabItem { Label("DJ Studio",systemImage:"opticaldisc") }.tag("DJ Studio")
}.accessibilityIdentifier("workspace.tabs")
@@ -918,8 +919,8 @@ struct LibraryView: View {
}
var body: some View {
workspace
.disabled(model.importProgress != nil || model.storageProgress != nil)
.overlay { if model.storageProgress != nil { ImportProgressDialog(model:model,storageMode:true) } else if model.importProgress != nil { ImportProgressDialog(model:model) } }
.disabled(model.storageProgress != nil)
.overlay { if model.storageProgress != nil { ImportProgressDialog(model:model,storageMode:true) } }
.onAppear { updateLibraryRows() }
.onChange(of:model.songs) { _ in updateLibraryRows() }
.onChange(of:model.tuningCache) { _ in updateLibraryRows() }
@@ -1691,8 +1692,8 @@ private struct SingerSongsSheet: View {
}.frame(height:270)
HStack { Button("Import Songs…") { importing = true };Button("SMB/NAS…") { importingServer = true };Spacer();Button("Done") { dismiss() }.keyboardShortcut(.defaultAction) }
}.padding(24).frame(width:520).background(StudioTheme.frame)
.disabled(model.importProgress != nil || model.storageProgress != nil)
.overlay { if model.storageProgress != nil { ImportProgressDialog(model:model,storageMode:true) } else if model.importProgress != nil { ImportProgressDialog(model:model) } }
.disabled(model.storageProgress != nil)
.overlay { if model.storageProgress != nil { ImportProgressDialog(model:model,storageMode:true) } }
.sheet(isPresented:$importingServer,onDismiss:{
let urls = serverImportURLs;serverImportURLs = []
model.importFiles(urls)