Add endpoint /all_channels.json to facilitate future autocomplete.
This commit is contained in:
		
							parent
							
								
									8b4edad9f2
								
							
						
					
					
						commit
						d76d592501
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		|  | @ -9,6 +9,12 @@ from .. import jsonify | ||||||
| 
 | 
 | ||||||
| site = common.site | site = common.site | ||||||
| 
 | 
 | ||||||
|  | @site.route('/all_channels.json') | ||||||
|  | def get_all_channel_names(): | ||||||
|  |     all_channels = {channel.id: channel.name for channel in common.ycdldb.get_channels()} | ||||||
|  |     response = {'channels': all_channels} | ||||||
|  |     return jsonify.make_json_response(response) | ||||||
|  | 
 | ||||||
| @site.route('/channels') | @site.route('/channels') | ||||||
| def get_channels(): | def get_channels(): | ||||||
|     channels = common.ycdldb.get_channels() |     channels = common.ycdldb.get_channels() | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue