mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-31 17:53:49 -04:00
[README] Update smart playlist readme
This commit is contained in:
parent
d15018cb99
commit
b550ea4025
@ -24,56 +24,66 @@ field-name operator operand
|
|||||||
```
|
```
|
||||||
|
|
||||||
Where valid field-names (with their types) are:
|
Where valid field-names (with their types) are:
|
||||||
* artist (string)
|
* `artist` (string)
|
||||||
* album_artist (string)
|
* `album_artist` (string)
|
||||||
* album (string)
|
* `album` (string)
|
||||||
* title (string)
|
* `title` (string)
|
||||||
* genre (string)
|
* `genre` (string)
|
||||||
* composer (string)
|
* `composer` (string)
|
||||||
* path (string)
|
* `path` (string)
|
||||||
* type (string)
|
* `type` (string)
|
||||||
* grouping (string)
|
* `grouping` (string)
|
||||||
* data_kind (enumeration)
|
* `data_kind` (enumeration)
|
||||||
* media_kind (enumeration)
|
* `media_kind` (enumeration)
|
||||||
* play_count (integer)
|
* `play_count` (integer)
|
||||||
* rating (integer)
|
* `rating` (integer)
|
||||||
* year (integer)
|
* `year` (integer)
|
||||||
* compilation (integer)
|
* `compilation` (integer)
|
||||||
* time_added (date)
|
* `time_added` (date)
|
||||||
* time_modified (date)
|
* `time_modified` (date)
|
||||||
* time_played (date)
|
* `time_played` (date)
|
||||||
|
|
||||||
Valid operators include:
|
Valid operators include:
|
||||||
* is, includes, starts with (string)
|
* `is`, `includes`, `starts with` (string)
|
||||||
* >, <, <=, >=, = (int)
|
* `>`, `<`, `<=`, `>=`, `=` (int)
|
||||||
* after, before (date)
|
* `after`, `before` (date)
|
||||||
* is (enumeration)
|
* `is` (enumeration)
|
||||||
|
|
||||||
The "is" operator must exactly match the field value, while the "includes" operator matches a substring.
|
The `is` operator must exactly match the field value, while the `includes` operator matches a substring.
|
||||||
The "starts with" operator matches, if the value starts with the given prefix.
|
The `starts with` operator matches, if the value starts with the given prefix.
|
||||||
All three matches are case-insensitive.
|
All three matches are case-insensitive.
|
||||||
|
|
||||||
Valid operands include:
|
Valid operands include:
|
||||||
* "string value" (string)
|
* "string value" (string)
|
||||||
* integer (int)
|
* integer (int)
|
||||||
|
|
||||||
Valid operands for the enumeration "data_kind" are:
|
Valid operands for the enumeration `data_kind` are:
|
||||||
* file
|
* `file`
|
||||||
* url
|
* `url`
|
||||||
* spotify
|
* `spotify`
|
||||||
* pipe
|
* `pipe`
|
||||||
|
|
||||||
Valid operands for the enumeration "media_kind" are:
|
Valid operands for the enumeration `media_kind` are:
|
||||||
* music
|
* `music`
|
||||||
* movie
|
* `movie`
|
||||||
* podcast
|
* `podcast`
|
||||||
* audiobook
|
* `audiobook`
|
||||||
* tvshow
|
* `tvshow`
|
||||||
|
|
||||||
|
|
||||||
Multiple expressions can be anded or ored together, using the keywords OR and AND. The unary not operator is also supported using the keyword NOT.
|
Multiple expressions can be anded or ored together, using the keywords `OR` and `AND`. The unary not operator is also supported using the keyword `NOT`.
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
It is possible to define the sort order and limit the number of items by adding an order clause and/or a limit clause after the last expression:
|
||||||
|
|
||||||
|
```
|
||||||
|
"Playlist Name" { expression ORDER BY field-name sort-direction LIMIT limit }
|
||||||
|
```
|
||||||
|
|
||||||
|
"sort-direction" is either `ASC` (ascending) or `DESC` (descending). "limit" is the maximum number of items.
|
||||||
|
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
"techno" {
|
"techno" {
|
||||||
@ -113,6 +123,15 @@ This would match all songs added as files to the library that are not placed und
|
|||||||
|
|
||||||
This would match any podcast and audiobook file that was never played with forked-daapd.
|
This would match any podcast and audiobook file that was never played with forked-daapd.
|
||||||
|
|
||||||
|
```
|
||||||
|
"Recently added music" {
|
||||||
|
media_kind is music
|
||||||
|
order by time_added desc
|
||||||
|
limit 10
|
||||||
|
}
|
||||||
|
```
|
||||||
|
This would match the last 10 music files added to the library.
|
||||||
|
|
||||||
|
|
||||||
## Date operand syntax
|
## Date operand syntax
|
||||||
|
|
||||||
@ -125,9 +144,9 @@ One example of a valid date is a date in yyyy-mm-dd format:
|
|||||||
```
|
```
|
||||||
|
|
||||||
There are also some special date keywords:
|
There are also some special date keywords:
|
||||||
* "today", "yesterday", "last week", "last month", "last year"
|
* `today`, `yesterday`, `last week`, `last month`, `last year`
|
||||||
|
|
||||||
A valid date can also be made by applying an interval to a date. Intervals can be defined as "days", "weeks", "months", "years".
|
A valid date can also be made by applying an interval to a date. Intervals can be defined as `days`, `weeks`, `months`, `years`.
|
||||||
As an example, a valid date might be:
|
As an example, a valid date might be:
|
||||||
|
|
||||||
```3 weeks before today``` or ```3 weeks ago```
|
```3 weeks before today``` or ```3 weeks ago```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user