Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Nonetype error! #3233

Merged
merged 3 commits into from
Mar 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions listenbrainz/webserver/views/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ def artist_similarity():
ORDER BY total_listen_count DESC
LIMIT 1
"""))

artist_mbid = result.fetchone()[0]

result_row = result.fetchone()
if result_row is None:
# Return a JSON error response
return jsonify({"error": f"Artist not found in the database"}), 404

artist_mbid = result_row[0]
data = {
"algorithm": "session_based_days_7500_session_300_contribution_5_threshold_10_limit_100_filter_True_skip_30",
"artist_mbid": artist_mbid
Expand Down
Loading