From 8c024387ae602bdb823a7306ee33ac23d75a28b4 Mon Sep 17 00:00:00 2001 From: whatdoineed2do/Ray Date: Tue, 18 Jun 2019 09:36:57 +0100 Subject: [PATCH] [web-src/jsonapi] endpoint GET /api/update/meta -> PUT /api/rescan --- README_JSON_API.md | 6 +++--- htdocs/admin/js/forked-daapd.js | 2 +- src/httpd_jsonapi.c | 4 ++-- web-src/src/webapi/index.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README_JSON_API.md b/README_JSON_API.md index 33ad9793..8d5b155f 100644 --- a/README_JSON_API.md +++ b/README_JSON_API.md @@ -723,7 +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 | +| PUT | [/api/rescan](#trigger-meta-rescan) | Trigger a library metadata rescan | @@ -1665,7 +1665,7 @@ Trigger a library metadata rescan even if files have not been updated. Maintene **Endpoint** ```http -GET /api/update/meta +PUT /api/rescan ``` **Response** @@ -1675,7 +1675,7 @@ On success returns the HTTP `204 No Content` success status response code. **Example** ```shell -curl -X GET "http://localhost:3689/api/update/meta" +curl -X PUT "http://localhost:3689/api/rescan" ``` diff --git a/htdocs/admin/js/forked-daapd.js b/htdocs/admin/js/forked-daapd.js index 2dcf0e20..d0f072db 100644 --- a/htdocs/admin/js/forked-daapd.js +++ b/htdocs/admin/js/forked-daapd.js @@ -58,7 +58,7 @@ var app = new Vue({ update_meta: function() { this.library.updating = true; - axios.get('/api/update/meta').then(console.log('Library is rescanning meta')); + axios.put('/api/rescan').then(console.log('Library is rescanning meta')); }, kickoffPairing: function() { diff --git a/src/httpd_jsonapi.c b/src/httpd_jsonapi.c index 6dd684a2..30e821a1 100644 --- a/src/httpd_jsonapi.c +++ b/src/httpd_jsonapi.c @@ -788,7 +788,7 @@ jsonapi_reply_update(struct httpd_request *hreq) } static int -jsonapi_reply_meta_update(struct httpd_request *hreq) +jsonapi_reply_meta_rescan(struct httpd_request *hreq) { library_metarescan(); return HTTP_NOCONTENT; @@ -3518,7 +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_PUT, "^/api/rescan$", jsonapi_reply_meta_rescan }, { 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 }, diff --git a/web-src/src/webapi/index.js b/web-src/src/webapi/index.js index 198001f5..dc753b9e 100644 --- a/web-src/src/webapi/index.js +++ b/web-src/src/webapi/index.js @@ -22,7 +22,7 @@ export default { }, library_update_meta () { - return axios.get('/api/update/meta') + return axios.put('/api/rescan') }, library_count (expression) {