mirror of
				https://github.com/Dummi26/musicdb.git
				synced 2025-10-31 03:55:25 +01:00 
			
		
		
		
	add stop button
This commit is contained in:
		
							parent
							
								
									eedd348c5c
								
							
						
					
					
						commit
						88bff158f0
					
				| @ -112,7 +112,7 @@ async function runLoop() { | ||||
|     } | ||||
| } | ||||
| runLoop();</script>"#;
 | ||||
|     let buttons = "<button onclick=\"fetch('/play')\">play</button><button onclick=\"fetch('/pause')\">pause</button><button onclick=\"fetch('/skip')\">skip</button><button onclick=\"fetch('/clear-queue')\">clear queue</button>"; | ||||
|     let buttons = "<button onclick=\"fetch('/play')\">play</button><button onclick=\"fetch('/pause')\">pause</button><button onclick=\"fetch('/stop')\">stop</button><button onclick=\"fetch('/skip')\">skip</button><button onclick=\"fetch('/clear-queue')\">clear queue</button>"; | ||||
|     let search = "<input id=\"searchFieldArtist\" placeholder=\"artist\"><input id=\"searchFieldAlbum\" placeholder=\"album\"><input id=\"searchFieldTitle\" placeholder=\"title\">
 | ||||
| <button onclick=\"performSearch()\">search</button><div id=\"searchResultDiv\"></div>"; | ||||
|     let db = data.db.lock().unwrap(); | ||||
| @ -277,6 +277,10 @@ fn play(data: &State<Data>) { | ||||
| fn pause(data: &State<Data>) { | ||||
|     data.command_sender.send(Command::Pause).unwrap(); | ||||
| } | ||||
| #[get("/stop")] | ||||
| fn stop(data: &State<Data>) { | ||||
|     data.command_sender.send(Command::Stop).unwrap(); | ||||
| } | ||||
| #[get("/skip")] | ||||
| fn skip(data: &State<Data>) { | ||||
|     data.command_sender.send(Command::NextSong).unwrap(); | ||||
| @ -544,6 +548,7 @@ pub async fn main( | ||||
|                 index, | ||||
|                 play, | ||||
|                 pause, | ||||
|                 stop, | ||||
|                 skip, | ||||
|                 clear_queue, | ||||
|                 queue_goto, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Mark
						Mark