mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 08:56:17 +00:00
Some clients do POST requests
This commit is contained in:
parent
b959d720de
commit
810c288d73
@ -6,7 +6,7 @@ from db import Track
|
||||
import random
|
||||
import uuid
|
||||
|
||||
@app.route('/rest/getRandomSongs.view')
|
||||
@app.route('/rest/getRandomSongs.view', methods = [ 'GET', 'POST' ])
|
||||
def rand_songs():
|
||||
size = request.args.get('size', '10')
|
||||
genre, fromYear, toYear, musicFolderId = map(request.args.get, [ 'genre', 'fromYear', 'toYear', 'musicFolderId' ])
|
||||
|
@ -5,7 +5,7 @@ from web import app
|
||||
from db import Folder, Artist, Album, Track
|
||||
import uuid, time, string
|
||||
|
||||
@app.route('/rest/getMusicFolders.view')
|
||||
@app.route('/rest/getMusicFolders.view', methods = [ 'GET', 'POST' ])
|
||||
def list_folders():
|
||||
return request.formatter({
|
||||
'musicFolders': {
|
||||
@ -16,7 +16,7 @@ def list_folders():
|
||||
}
|
||||
})
|
||||
|
||||
@app.route('/rest/getIndexes.view')
|
||||
@app.route('/rest/getIndexes.view', methods = [ 'GET', 'POST' ])
|
||||
def list_indexes():
|
||||
musicFolderId = request.args.get('musicFolderId')
|
||||
ifModifiedSince = request.args.get('ifModifiedSince')
|
||||
@ -83,7 +83,7 @@ def list_indexes():
|
||||
}
|
||||
})
|
||||
|
||||
@app.route('/rest/getMusicDirectory.view')
|
||||
@app.route('/rest/getMusicDirectory.view', methods = [ 'GET', 'POST' ])
|
||||
def show_directory():
|
||||
did = request.args.get('id')
|
||||
if not did:
|
||||
|
@ -7,7 +7,7 @@ from db import Track, Folder
|
||||
import config
|
||||
import os.path, uuid
|
||||
|
||||
@app.route('/rest/stream.view')
|
||||
@app.route('/rest/stream.view', methods = [ 'GET', 'POST' ])
|
||||
def stream_media():
|
||||
id, maxBitRate, format, timeOffset, size, estimateContentLength = map(request.args.get, [ 'id', 'maxBitRate', 'format', 'timeOffset', 'size', 'estimateContentLength' ])
|
||||
if not id:
|
||||
@ -41,7 +41,7 @@ def stream_media():
|
||||
|
||||
return send_file(track.path)
|
||||
|
||||
@app.route('/rest/getCoverArt.view')
|
||||
@app.route('/rest/getCoverArt.view', methods = [ 'GET', 'POST' ])
|
||||
def cover_art():
|
||||
id = request.args.get('id')
|
||||
if not id:
|
||||
|
@ -3,11 +3,11 @@
|
||||
from flask import request
|
||||
from web import app
|
||||
|
||||
@app.route('/rest/ping.view')
|
||||
@app.route('/rest/ping.view', methods = [ 'GET', 'POST' ])
|
||||
def ping():
|
||||
return request.formatter({})
|
||||
|
||||
@app.route('/rest/getLicense.view')
|
||||
@app.route('/rest/getLicense.view', methods = [ 'GET', 'POST' ])
|
||||
def license():
|
||||
return request.formatter({ 'license': { 'valid': False } })
|
||||
|
||||
|
@ -4,7 +4,7 @@ from flask import request
|
||||
from web import app
|
||||
from db import User
|
||||
|
||||
@app.route('/rest/getUser.view')
|
||||
@app.route('/rest/getUser.view', methods = [ 'GET', 'POST' ])
|
||||
def user_info():
|
||||
username = request.args.get('username')
|
||||
if username is None:
|
||||
|
Loading…
Reference in New Issue
Block a user