|
|
|
@ -117,6 +117,8 @@ static void cli_incoming_media_reload_file(str *instr, struct cli_writer *cw, co
|
|
|
|
|
static void cli_incoming_media_reload_files(str *instr, struct cli_writer *cw, const cli_handler_t *);
|
|
|
|
|
static void cli_incoming_media_reload_db(str *instr, struct cli_writer *cw, const cli_handler_t *);
|
|
|
|
|
static void cli_incoming_media_reload_dbs(str *instr, struct cli_writer *cw, const cli_handler_t *);
|
|
|
|
|
static void cli_incoming_media_reload_cache(str *instr, struct cli_writer *cw, const cli_handler_t *);
|
|
|
|
|
static void cli_incoming_media_reload_caches(str *instr, struct cli_writer *cw, const cli_handler_t *);
|
|
|
|
|
|
|
|
|
|
static void cli_incoming_media_evict_file(str *instr, struct cli_writer *cw, const cli_handler_t *);
|
|
|
|
|
static void cli_incoming_media_evict_files(str *instr, struct cli_writer *cw, const cli_handler_t *);
|
|
|
|
@ -208,6 +210,8 @@ static const cli_handler_t cli_media_reload_handlers[] = {
|
|
|
|
|
{ "files", cli_incoming_media_reload_files, NULL },
|
|
|
|
|
{ "db", cli_incoming_media_reload_db, NULL },
|
|
|
|
|
{ "dbs", cli_incoming_media_reload_dbs, NULL },
|
|
|
|
|
{ "cache", cli_incoming_media_reload_cache, NULL },
|
|
|
|
|
{ "caches", cli_incoming_media_reload_caches, NULL },
|
|
|
|
|
{ NULL, },
|
|
|
|
|
};
|
|
|
|
|
static const cli_handler_t cli_media_evict_handlers[] = {
|
|
|
|
@ -1866,6 +1870,29 @@ static void cli_incoming_media_reload_dbs(str *instr, struct cli_writer *cw, con
|
|
|
|
|
cw->cw_printf(cw, "%u media entries reloaded\n", num);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void cli_incoming_media_reload_cache(str *instr, struct cli_writer *cw, const cli_handler_t *handler) {
|
|
|
|
|
if (instr->len == 0) {
|
|
|
|
|
cw->cw_printf(cw, "More parameters required.\n");
|
|
|
|
|
return ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned long long id = str_to_ui(instr, 0);
|
|
|
|
|
if (id == 0 || id == ULLONG_MAX)
|
|
|
|
|
cw->cw_printf(cw, "Invalid ID '" STR_FORMAT "'\n", STR_FMT(instr));
|
|
|
|
|
else {
|
|
|
|
|
bool ok = media_player_reload_cache(id);
|
|
|
|
|
if (ok)
|
|
|
|
|
cw->cw_printf(cw, "Success\n");
|
|
|
|
|
else
|
|
|
|
|
cw->cw_printf(cw, "Failed to reload '" STR_FORMAT "'\n", STR_FMT(instr));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void cli_incoming_media_reload_caches(str *instr, struct cli_writer *cw, const cli_handler_t *handler) {
|
|
|
|
|
unsigned int num = media_player_reload_caches();
|
|
|
|
|
cw->cw_printf(cw, "%u media entries reloaded\n", num);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void cli_incoming_media_evict_file(str *instr, struct cli_writer *cw, const cli_handler_t *handler) {
|
|
|
|
|
if (instr->len == 0) {
|
|
|
|
|
cw->cw_printf(cw, "More parameters required.\n");
|
|
|
|
|