Implemented OneLibrary track addition and removal

This commit is contained in:
patben8 committed 2026-10-01 16:43:37 +02:00
1 parent c5280a95f2
commit 7960a5a68f
20 files changed
+822 -85

No files matched your search

+33
View File
@@ -94,3 +94,36 @@ export function platformAvailability(p: PlatformOption): string {
export function browsePrompt(p: PlatformOption): string {
return p.selects === 'directory' ? 'Find the drive to open.' : `Choose a ${p.library_label} to open.`
}
// ---- a library that places its own audio (a stick) ---------------------------
//
// `tracks.places_audio`: the library, not the user, decides where added audio
// goes (a OneLibrary stick can only point at files on itself), and a removed
// track's audio goes with it. These word the consequences from that fact.
/** Shown while there are unsaved changes, on a library an export set wrote. */
export function exportManagedWarning(save: SaveCapabilities): string | null {
return save.managed_by_export
? `${save.app_name} was written by a Konduktor export — its next run replaces edits made here.`
: null
}
/** What adding will do on a library that places its own audio. */
export function placedAudioSummary(save: SaveCapabilities, copied: number, inPlace: number): string {
const parts: string[] = []
if (copied) parts.push(`${copied} ${copied === 1 ? 'file is' : 'files are'} copied to ${save.app_name}, into Contents/<Artist>/<Album>/`)
if (inPlace) parts.push(`${inPlace} ${inPlace === 1 ? 'is' : 'are'} already on ${save.app_name} and ${inPlace === 1 ? 'stays' : 'stay'} where ${inPlace === 1 ? 'it is' : 'they are'}`)
return parts.length ? parts.join('; ') + '.' : `Nothing needs copying to ${save.app_name}.`
}
/** The removal confirm's note on what happens to the audio files. */
export function removalNote(caps: Capabilities, count: number): string {
const files = count === 1 ? 'Its audio and analysis files are' : 'Their audio and analysis files are'
if (caps.tracks.places_audio) {
return `${files} deleted from ${caps.save.app_name} when you save, and that save cannot be undone.`
}
const stay = count === 1 ? 'The audio file stays' : 'The audio files stay'
return `${stay} on disk. Nothing is written until you save${caps.save.history
? ', and a save can be rolled back from version history.'
: ', and that save cannot be undone.'}`
}