|
myMPD
Internal API documentation
|
Smart playlist implementation. More...
#include "compile_time.h"#include "src/lib/smartpls.h"#include "src/lib/api.h"#include "src/lib/filehandler.h"#include "src/lib/json/json_print.h"#include "src/lib/json/json_rpc.h"#include "src/lib/msg_queue.h"#include "src/lib/sds_extras.h"#include <string.h>#include <sys/stat.h>
Functions | |
| static bool | smartpls_save (sds workdir, const char *smartpltype, const char *playlist, const char *fields, const char *sort, bool sortdesc, int max_entries) |
| bool | smartpls_save_sticker (sds workdir, const char *playlist, const char *sticker, const char *value, const char *op, const char *sort, bool sortdesc, int max_entries) |
| bool | smartpls_save_newest (sds workdir, const char *playlist, unsigned timerange, const char *sort, bool sortdesc, int max_entries) |
| bool | smartpls_save_search (sds workdir, const char *playlist, const char *expression, const char *sort, bool sortdesc, int max_entries) |
| bool | is_smartpls (sds workdir, const char *playlist) |
| time_t | smartpls_get_mtime (sds workdir, const char *playlist) |
| bool | smartpls_update (const char *playlist, unsigned long conn_id, unsigned int request_id) |
| bool | smartpls_update_all (bool force) |
Smart playlist implementation.
| bool is_smartpls | ( | sds | workdir, |
| const char * | playlist | ||
| ) |
Checks if playlist is a smart playlist
| workdir | myMPD working directory |
| playlist | name of the playlist to check |
| time_t smartpls_get_mtime | ( | sds | workdir, |
| const char * | playlist | ||
| ) |
Returns the smart playlist last modification time
| workdir | myMPD working directory |
| playlist | name of the playlist to check |
|
static |
Saves the smart playlist to disk.
| workdir | myMPD working directory |
| smartpltype | type of the smart playlist: sticker, newest or search |
| playlist | name of the smart playlist |
| fields | custom fields |
| sort | mpd tag to sort or the string "shuffle" |
| sortdesc | sort descending? |
| max_entries | maximum songs |
| bool smartpls_save_newest | ( | sds | workdir, |
| const char * | playlist, | ||
| unsigned | timerange, | ||
| const char * | sort, | ||
| bool | sortdesc, | ||
| int | max_entries | ||
| ) |
Saves a newest smart playlist
| workdir | myMPD working directory |
| playlist | playlist name |
| timerange | number of second since now |
| sort | tag to sort the playlist: empty = no sorting, shuffle or mpd tag |
| sortdesc | sort descending? |
| max_entries | maximum number of playlist entries |
| bool smartpls_save_search | ( | sds | workdir, |
| const char * | playlist, | ||
| const char * | expression, | ||
| const char * | sort, | ||
| bool | sortdesc, | ||
| int | max_entries | ||
| ) |
Saves a search based smart playlist
| workdir | myMPD working directory |
| playlist | playlist name |
| expression | mpd search expression |
| sort | tag to sort the playlist: empty = no sorting, shuffle or mpd tag |
| sortdesc | sort descending? |
| max_entries | maximum number of playlist entries |
| bool smartpls_save_sticker | ( | sds | workdir, |
| const char * | playlist, | ||
| const char * | sticker, | ||
| const char * | value, | ||
| const char * | op, | ||
| const char * | sort, | ||
| bool | sortdesc, | ||
| int | max_entries | ||
| ) |
Saves a sticker based smart playlist
| workdir | myMPD working directory |
| playlist | playlist name |
| sticker | sticker name |
| value | minimum integer value of sticker |
| op | compare operator |
| sort | tag to sort the playlist: empty = no sorting, shuffle or mpd tag |
| sortdesc | sort descending? |
| max_entries | maximum number of playlist entries |
| bool smartpls_update | ( | const char * | playlist, |
| unsigned long | conn_id, | ||
| unsigned int | request_id | ||
| ) |
Sends a request to the mympd_api_queue to update a smart playlist
| playlist | smart playlist to update |
| conn_id | mongoose connection id |
| request_id | jsonrpc request id |
| bool smartpls_update_all | ( | bool | force | ) |
Sends a request to the mympd_api_queue to update all smart playlists
| force | Force smart playlist update? |