mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 17:06:17 +00:00
Fix api get_entity
This commit is contained in:
parent
3e51bf2a6d
commit
c3fd94343f
@ -17,6 +17,7 @@ from flask import Blueprint
|
|||||||
from pony.orm import ObjectNotFound
|
from pony.orm import ObjectNotFound
|
||||||
from pony.orm import commit
|
from pony.orm import commit
|
||||||
|
|
||||||
|
from ..db import Folder
|
||||||
from ..managers.user import UserManager
|
from ..managers.user import UserManager
|
||||||
from ..py23 import dict
|
from ..py23 import dict
|
||||||
|
|
||||||
@ -82,6 +83,9 @@ def get_client_prefs():
|
|||||||
|
|
||||||
def get_entity(cls, param="id"):
|
def get_entity(cls, param="id"):
|
||||||
eid = request.values[param]
|
eid = request.values[param]
|
||||||
|
if cls == Folder:
|
||||||
|
eid = int(eid)
|
||||||
|
else:
|
||||||
eid = uuid.UUID(eid)
|
eid = uuid.UUID(eid)
|
||||||
entity = cls[eid]
|
entity = cls[eid]
|
||||||
return entity
|
return entity
|
||||||
|
Loading…
Reference in New Issue
Block a user