From 7869f8a0970e5de27d72d988ddd5328ab8cf2b46 Mon Sep 17 00:00:00 2001 From: darrell-k <97928054+darrell-k@users.noreply.github.com> Date: Sat, 4 May 2024 01:34:35 +0100 Subject: [PATCH 1/4] Add works entry --- docs/reference/cli/database.md | 45 +++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/docs/reference/cli/database.md b/docs/reference/cli/database.md index ad4a6623..8e659e71 100755 --- a/docs/reference/cli/database.md +++ b/docs/reference/cli/database.md @@ -312,6 +312,49 @@ Request: "albums 0 5 artist_id:19" Response: "albums 0 5 artist_id:19 count:1 id:5 album:Bounce%20[Single]" ``` +*** +## works +`works ` + +The `works` query returns all works known by the server. + +A Work is a (usually classical) piece of music made up of one or more movements, acts, scenes etc, each of which is usually a separate track. + +A Work is defined by its name and its composer. + +An Album can contain many Works, and an instance of a Work can exist on many albums. There is therefore a many-to-many relationship between Works and Albums. +This many-to-many relationship is resolved in the Tracks table which contains the album id and the work id. + +**Accepted tagged parameters:** + +| Tag | Description | +|---|---| +| `search` | Search string. The search is case insensitive and obeys the `Search Within Words` server parameter. | +| `artist_id` | Limit results to those works on which the artist identified by `artist_id` performs. | +| `genre_id` | Limit results to the genre(s) identified by `genre_id`. The genre_id may be a list of comma separated IDs. | +| `library_id` | Virtual library ID, to restrict the results to a virtual library view. | +| `work_id` | Limit results to an individual `work`. | +| `role_id` | Limit results to the role(s) identified by `role_id`. The role_id may be a list of comma separated IDs. | + +**Returned parameters:** + +| Result | Tag | Description | +|---|---|---| +| count | `count` | Number of results returned by the query. | +| works_loop | `work_id` | unique work identifier | +|| `single_composer` | only returned if the results contain works from a single composer who is also the searched-for contributor | +|| `composer` | the name of the composer of the work | +|| `work` | the name of the work | +|| `composer_id` | the id of the composer of the work | +|| `artwork_track_id` | the id of the artwork for the first album found containing the work | +|| `artwork_track_ids` | a list of all artwork ids of albums containing the work | +|| `album_id` | a list of the ids of all albums containing the work | +|| `textkey` | if `single_composer` (see above), the first letter of the composer name, otherwise, the first letter of the work name | +|| `favorites_url` | the URL for favoriting the work | +|| `favorites_title` | the text to be used for the favorite | + +The work's `textkey` is the first letter of the sorting key. + *** ## years `years ` @@ -718,4 +761,4 @@ The `pragma` command executes the given pragma string against the SQLite databas Example: ``` pragma locking_mode = NORMAL -``` \ No newline at end of file +``` From 684ada36ae6e0b9b56a238d6cf08cea1e7b02e9b Mon Sep 17 00:00:00 2001 From: darrell-k <97928054+darrell-k@users.noreply.github.com> Date: Sat, 4 May 2024 01:47:48 +0100 Subject: [PATCH 2/4] Add works entry --- docs/reference/cli/database.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/reference/cli/database.md b/docs/reference/cli/database.md index 8e659e71..f7190858 100755 --- a/docs/reference/cli/database.md +++ b/docs/reference/cli/database.md @@ -322,7 +322,7 @@ A Work is a (usually classical) piece of music made up of one or more movements, A Work is defined by its name and its composer. -An Album can contain many Works, and an instance of a Work can exist on many albums. There is therefore a many-to-many relationship between Works and Albums. +An Album can contain many Works, and an instance of a Work can exist on many Albums. There is therefore a many-to-many relationship between Works and Albums. This many-to-many relationship is resolved in the Tracks table which contains the album id and the work id. **Accepted tagged parameters:** @@ -349,12 +349,10 @@ This many-to-many relationship is resolved in the Tracks table which contains th || `artwork_track_id` | the id of the artwork for the first album found containing the work | || `artwork_track_ids` | a list of all artwork ids of albums containing the work | || `album_id` | a list of the ids of all albums containing the work | -|| `textkey` | if `single_composer` (see above), the first letter of the composer name, otherwise, the first letter of the work name | +|| `textkey` | if `single_composer` (see above), the first letter of the work name, otherwise, the first letter of the composer name | || `favorites_url` | the URL for favoriting the work | || `favorites_title` | the text to be used for the favorite | -The work's `textkey` is the first letter of the sorting key. - *** ## years `years ` From 46532a25acacb059548dd86d37153f9caa9f3385 Mon Sep 17 00:00:00 2001 From: darrell-k <97928054+darrell-k@users.noreply.github.com> Date: Sat, 4 May 2024 01:54:19 +0100 Subject: [PATCH 3/4] Add works entry --- docs/reference/database-structure.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/reference/database-structure.md b/docs/reference/database-structure.md index f314fb08..05e94d5b 100644 --- a/docs/reference/database-structure.md +++ b/docs/reference/database-structure.md @@ -66,6 +66,9 @@ The tracks_persistent table contains additional statistics information about a t The tracks_persistent table was added in SqueezeCenter 7.1. +### works + +The works table contains an entry for each Work in your music library. ### genres From 73de8c5a9acd6795e9bf84eec975c1d414e380c1 Mon Sep 17 00:00:00 2001 From: darrell-k <97928054+darrell-k@users.noreply.github.com> Date: Sun, 5 May 2024 19:02:04 +0100 Subject: [PATCH 4/4] Update database.md --- docs/reference/cli/database.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/reference/cli/database.md b/docs/reference/cli/database.md index f7190858..47081820 100755 --- a/docs/reference/cli/database.md +++ b/docs/reference/cli/database.md @@ -338,10 +338,11 @@ This many-to-many relationship is resolved in the Tracks table which contains th **Returned parameters:** -| Result | Tag | Description | +| Block | Tag | Description | |---|---|---| +| First block: {: colspan=3} |⁠ {: style="padding:0"}|⁠ {: style="padding:0"}| | count | `count` | Number of results returned by the query. | -| works_loop | `work_id` | unique work identifier | +| For each work: {: colspan=3} |⁠ {: style="padding:0"}|⁠ {: style="padding:0"}| || `single_composer` | only returned if the results contain works from a single composer who is also the searched-for contributor | || `composer` | the name of the composer of the work | || `work` | the name of the work |