#874 fixup: import get_wishlist_service in the ignore-list endpoints
ruff F821 caught a real NameError: the three /api/wishlist/ignore-list* endpoints called get_wishlist_service() without the local import every other call site in web_server.py uses, so they'd crash the moment the Ignored modal queried them. Add the import; ruff check now clean.
This commit is contained in:
parent
d15b3a185d
commit
4bdde1248e
1 changed files with 3 additions and 0 deletions
|
|
@ -16823,6 +16823,7 @@ def remove_batch_from_wishlist():
|
||||||
def get_wishlist_ignore_list():
|
def get_wishlist_ignore_list():
|
||||||
"""#874: active (non-expired) wishlist ignore entries for this profile."""
|
"""#874: active (non-expired) wishlist ignore entries for this profile."""
|
||||||
try:
|
try:
|
||||||
|
from core.wishlist_service import get_wishlist_service
|
||||||
runtime = _build_wishlist_route_runtime()
|
runtime = _build_wishlist_route_runtime()
|
||||||
entries = get_wishlist_service().database.get_wishlist_ignore(profile_id=runtime.profile_id)
|
entries = get_wishlist_service().database.get_wishlist_ignore(profile_id=runtime.profile_id)
|
||||||
from core.wishlist.ignore import IGNORE_TTL_DAYS
|
from core.wishlist.ignore import IGNORE_TTL_DAYS
|
||||||
|
|
@ -16839,6 +16840,7 @@ def remove_from_wishlist_ignore_list():
|
||||||
track_id = data.get('track_id') or data.get('spotify_track_id')
|
track_id = data.get('track_id') or data.get('spotify_track_id')
|
||||||
if not track_id:
|
if not track_id:
|
||||||
return jsonify({"success": False, "error": "No track_id provided"}), 400
|
return jsonify({"success": False, "error": "No track_id provided"}), 400
|
||||||
|
from core.wishlist_service import get_wishlist_service
|
||||||
runtime = _build_wishlist_route_runtime()
|
runtime = _build_wishlist_route_runtime()
|
||||||
ok = get_wishlist_service().database.remove_from_wishlist_ignore(
|
ok = get_wishlist_service().database.remove_from_wishlist_ignore(
|
||||||
track_id, profile_id=runtime.profile_id)
|
track_id, profile_id=runtime.profile_id)
|
||||||
|
|
@ -16851,6 +16853,7 @@ def remove_from_wishlist_ignore_list():
|
||||||
def clear_wishlist_ignore_list():
|
def clear_wishlist_ignore_list():
|
||||||
"""#874: clear the entire wishlist ignore-list for this profile."""
|
"""#874: clear the entire wishlist ignore-list for this profile."""
|
||||||
try:
|
try:
|
||||||
|
from core.wishlist_service import get_wishlist_service
|
||||||
runtime = _build_wishlist_route_runtime()
|
runtime = _build_wishlist_route_runtime()
|
||||||
count = get_wishlist_service().database.clear_wishlist_ignore(profile_id=runtime.profile_id)
|
count = get_wishlist_service().database.clear_wishlist_ignore(profile_id=runtime.profile_id)
|
||||||
return jsonify({"success": True, "cleared": count})
|
return jsonify({"success": True, "cleared": count})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue