profile id support in api requests

This commit is contained in:
Mateusz Gruszczyński
2026-06-16 19:46:16 +02:00
parent c796a740d1
commit a73aeb5544
18 changed files with 1823 additions and 185 deletions
+5 -5
View File
@@ -5,7 +5,7 @@ from ._shared import *
@bp.get('/smart-queue')
def smart_queue_get():
from ..services import smart_queue
profile = preferences.active_profile()
profile = request_profile()
if not profile:
return ok({'settings': {}, 'exclusions': [], 'error': 'No profile'})
try:
@@ -23,7 +23,7 @@ def smart_queue_get():
@bp.post('/smart-queue')
def smart_queue_save():
from ..services import smart_queue
profile = preferences.active_profile()
profile = request_profile()
if not profile:
return ok({'settings': {}, 'error': 'No profile'})
try:
@@ -37,7 +37,7 @@ def smart_queue_save():
@bp.post('/smart-queue/check')
def smart_queue_check():
profile = preferences.active_profile()
profile = request_profile()
if not profile:
return ok({'result': {'ok': False, 'error': 'No profile'}})
if str(request.args.get('sync') or '').lower() in {'1', 'true', 'yes'}:
@@ -66,7 +66,7 @@ def smart_queue_check():
@bp.post('/smart-queue/exclusion')
def smart_queue_exclusion():
from ..services import smart_queue
profile = preferences.active_profile()
profile = request_profile()
if not profile:
return jsonify({'ok': False, 'error': 'No profile'}), 400
data = request.get_json(silent=True) or {}
@@ -79,7 +79,7 @@ def smart_queue_exclusion():
@bp.delete('/smart-queue/history')
def smart_queue_history_clear():
from ..services import smart_queue
profile = preferences.active_profile()
profile = request_profile()
if not profile:
return jsonify({'ok': False, 'error': 'No profile'}), 400
try: