diff --git a/README_JSON_API.md b/README_JSON_API.md index ca633229..33ad9793 100644 --- a/README_JSON_API.md +++ b/README_JSON_API.md @@ -723,6 +723,7 @@ curl -X PUT "http://localhost:3689/api/queue/items/2" | GET | [/api/library/count](#get-count-of-tracks-artists-and-albums) | Get count of tracks, artists and albums | | GET | [/api/library/files](#list-local-directories) | Get list of directories in the local library | | GET | [/api/update](#trigger-rescan) | Trigger a library rescan | +| GET | [/api/update/meta](#trigger-meta-rescan) | Trigger a library metadata rescan | @@ -1657,6 +1658,25 @@ curl -X GET "http://localhost:3689/api/update" } ``` +### Trigger meta rescan + +Trigger a library metadata rescan even if files have not been updated. Maintenence method. + +**Endpoint** + +```http +GET /api/update/meta +``` + +**Response** + +On success returns the HTTP `204 No Content` success status response code. + +**Example** + +```shell +curl -X GET "http://localhost:3689/api/update/meta" +``` ## Search diff --git a/src/httpd_jsonapi.c b/src/httpd_jsonapi.c index 9c3ad537..6dd684a2 100644 --- a/src/httpd_jsonapi.c +++ b/src/httpd_jsonapi.c @@ -787,6 +787,14 @@ jsonapi_reply_update(struct httpd_request *hreq) return HTTP_NOCONTENT; } +static int +jsonapi_reply_meta_update(struct httpd_request *hreq) +{ + library_metarescan(); + return HTTP_NOCONTENT; +} + + /* * Endpoint to retrieve information about the spotify integration * @@ -3510,6 +3518,7 @@ static struct httpd_uri_map adm_handlers[] = { EVHTTP_REQ_GET, "^/api/config$", jsonapi_reply_config }, { EVHTTP_REQ_GET, "^/api/library$", jsonapi_reply_library }, { EVHTTP_REQ_GET, "^/api/update$", jsonapi_reply_update }, + { EVHTTP_REQ_GET, "^/api/update/meta$", jsonapi_reply_meta_update }, { EVHTTP_REQ_POST, "^/api/spotify-login$", jsonapi_reply_spotify_login }, { EVHTTP_REQ_GET, "^/api/spotify$", jsonapi_reply_spotify }, { EVHTTP_REQ_GET, "^/api/pairing$", jsonapi_reply_pairing_get },