mirror of
				https://github.com/SuperBFG7/ympd
				synced 2025-10-31 13:53:00 +00:00 
			
		
		
		
	Fixed search_add function
This commit is contained in:
		| @@ -1053,6 +1053,10 @@ function appendQueue(type, uri, name) { | ||||
|             sendAPI({"cmd": "MPD_API_ADD_TRACK", "data": {"uri": uri}}); | ||||
|             showNotification('"' + name + '" added','','','success'); | ||||
|             break; | ||||
|         case 'dir': | ||||
|             sendAPI({"cmd": "MPD_API_ADD_TRACK", "data": {"uri": uri}}); | ||||
|             showNotification('"' + name + '" added','','','success'); | ||||
|             break; | ||||
|         case 'plist': | ||||
|             sendAPI({"cmd": "MPD_API_ADD_PLAYLIST", "data": {"plist": uri}}); | ||||
|             showNotification('"' + name + '" added','','','success'); | ||||
| @@ -1066,6 +1070,10 @@ function appendAfterQueue(type, uri, to, name) { | ||||
|             sendAPI({"cmd": "MPD_API_ADD_TRACK_AFTER", "data": {"uri": uri, "to": to}}); | ||||
|             showNotification('"' + name + '" added to pos ' + to, '', '', 'success'); | ||||
|             break; | ||||
|         case 'dir': | ||||
|             sendAPI({"cmd": "MPD_API_ADD_TRACK_AFTER", "data": {"uri": uri, "to": to}}); | ||||
|             showNotification('"' + name + '" added to pos ' + to, '', '', 'success'); | ||||
|             break; | ||||
|     } | ||||
| } | ||||
|  | ||||
| @@ -1075,6 +1083,10 @@ function replaceQueue(type, uri, name) { | ||||
|             sendAPI({"cmd": "MPD_API_REPLACE_TRACK", "data": {"uri": uri}}); | ||||
|             showNotification('"' + name + '" replaced','','','success'); | ||||
|             break; | ||||
|         case 'dir': | ||||
|             sendAPI({"cmd": "MPD_API_REPLACE_TRACK", "data": {"uri": uri}}); | ||||
|             showNotification('"' + name + '" replaced','','','success'); | ||||
|             break; | ||||
|         case 'plist': | ||||
|             sendAPI({"cmd": "MPD_API_REPLACE_PLAYLIST", "data": {"plist": uri}}); | ||||
|             showNotification('"' + name + '" replaced','','','success'); | ||||
| @@ -1267,7 +1279,7 @@ function addAllFromBrowse() { | ||||
|  | ||||
| function addAllFromSearch() { | ||||
|     if (app.current.search.length >= 2) { | ||||
|         sendAPI({"cmd":"MPD_API_SEARCH_ADD","data":{"filter": app.current.filter, "searchstr": + app.current.search}}); | ||||
|         sendAPI({"cmd":"MPD_API_SEARCH_ADD", "data":{"filter": app.current.filter, "searchstr": app.current.search}}); | ||||
|         showNotification('Added '+ parseInt(document.getElementById('panel-heading-search').innerText) +' songs from search','','','success'); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -305,7 +305,7 @@ void callback_mympd(struct mg_connection *nc, const struct mg_str msg) | ||||
|             } | ||||
|             break;             | ||||
|         case MPD_API_SEARCH_ADD: | ||||
|             je = json_scanf(msg.p, msg.len, "{ data: { mpdtag:%Q, searchstr:%Q } }", &p_charbuf1, &p_charbuf2); | ||||
|             je = json_scanf(msg.p, msg.len, "{ data: { filter:%Q, searchstr:%Q } }", &p_charbuf1, &p_charbuf2); | ||||
|             if (je == 2) { | ||||
|                 n = mympd_search_add(mpd.buf, p_charbuf1, p_charbuf2); | ||||
|                 free(p_charbuf1); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 jcorporation
					jcorporation