2022-01-04 02:15:28 +00:00
/// Standard help string containing usage information for MPS.
2022-01-04 02:22:22 +00:00
pub const HELP_STRING : & str =
2022-01-04 02:15:28 +00:00
" This language is all about iteration. Almost everything is an iterator or operates on iterators. By default, any operation which is not an assignment will cause the script runner to handle (play/save) the items which that statement contains.
2022-01-04 02:22:22 +00:00
To view the currently - supported operations , try ? functions and ? filters " ;
2022-01-04 02:15:28 +00:00
2022-01-04 02:22:22 +00:00
pub const FUNCTIONS : & str =
2022-01-04 02:15:28 +00:00
" FUNCTIONS (?functions)
Similar to most other languages : function_name ( param1 , param2 , etc . )
sql_init ( generate = true | false , folder = ` path / to / music ` )
2022-01-04 02:22:22 +00:00
Initialize the SQLite database connection using the provided parameters . This must be performed before any other database operation ( otherwise the database will already be connected with default settings ) .
2022-01-04 02:15:28 +00:00
sql ( ` SQL query here ` )
Perform a raw SQLite query on the database which MPS auto - generates . An iterator of the results is returned .
song ( ` something ` )
Retrieve all songs in the database with a title like something .
album ( ` something ` )
Retrieve all songs in the database with an album title like something .
artist ( ` something ` )
Retrieve all songs in the database with an artist name like something .
genre ( ` something ` )
Retrieve all songs in the database with a genre title like something .
repeat ( iterable , count )
Repeat the iterable count times , or infinite times if count is omitted .
files ( folder = ` path / to / music ` , recursive = true | false , regex = ` pattern ` )
2022-01-04 02:22:22 +00:00
Retrieve all files from a folder , matching a regex pattern . " ;
2022-01-04 02:15:28 +00:00
2022-01-04 02:22:22 +00:00
pub const FILTERS : & str =
2022-01-04 02:15:28 +00:00
" FILTERS (?filters)
Operations to reduce the items in an iterable : iterable . ( filter )
field = = something
field > = something
field > something
field < = something
field < something
Compare all items , keeping only those that match the condition .
[ empty ]
2022-01-04 02:22:22 +00:00
Matches all items " ;