From fa3ffe8f6d81c4761c12a78cb56310f4ed397ea8 Mon Sep 17 00:00:00 2001 From: Pablo Ruiz <37554617+pruizlezcano@users.noreply.github.com> Date: Mon, 18 Mar 2024 12:45:28 +0100 Subject: [PATCH] feat: Add DAW field to project details (#44) --- docs/src/content/docs/managing-projects.mdx | 8 ++++++++ src/main/main.ts | 1 + src/renderer/Views/ProjectView.tsx | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/docs/src/content/docs/managing-projects.mdx b/docs/src/content/docs/managing-projects.mdx index 6d97f50..49652a3 100644 --- a/docs/src/content/docs/managing-projects.mdx +++ b/docs/src/content/docs/managing-projects.mdx @@ -86,6 +86,14 @@ The path to the project file. **Filter:** `path:` [*text*](/legato/search-filters#text) +### DAW + +The digital audio workstation used to create the project. + +**Default**: The DAW used to create the project. + +**Filter:** `daw:` [*text*](/legato/search-filters#text) + ### Tracks A list of tracks in the project. diff --git a/src/main/main.ts b/src/main/main.ts index c6cff89..3737d06 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -298,6 +298,7 @@ ipcMain.on('update-project', async (event, arg: Project) => { project.notes = arg.notes; project.progress = arg.progress; project.audioFile = arg.audioFile; + project.daw = arg.daw; for (let i = 0; i < arg.tagNames!.length; i += 1) { let tag = await TagRepository.findOneBy({ name: arg.tagNames![i], diff --git a/src/renderer/Views/ProjectView.tsx b/src/renderer/Views/ProjectView.tsx index b848c3a..2bdea72 100644 --- a/src/renderer/Views/ProjectView.tsx +++ b/src/renderer/Views/ProjectView.tsx @@ -346,6 +346,24 @@ function ProjectView({ /> )} +
+ +
+ { + if ( + value === project.daw || + (project.daw == null && value === '') + ) + return; + dispatch(saveProject({ ...project, daw: value })); + }} + placeholder="Add Scale..." + className="w-40" + /> +
+