From 4346f1aaa08b2013014a7c4883b754a56afb6977 Mon Sep 17 00:00:00 2001 From: "Jill \"oatmealine\" Monoids" Date: Fri, 26 May 2023 11:29:24 +0300 Subject: [PATCH] oops! wrong argument order. database permanently affected swap source and url in song_authors to fix --- src/lib/songs.cr | 2 +- src/template_endpoints/levels.cr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/songs.cr b/src/lib/songs.cr index f98f5db..7e6f6b0 100644 --- a/src/lib/songs.cr +++ b/src/lib/songs.cr @@ -223,7 +223,7 @@ module CrystalGauntlet::Songs end if !author_id - author_id = get_artist_id(metadata.author, metadata.source, metadata.author_url) + author_id = get_artist_id(metadata.author, metadata.author_url, metadata.source) end if config_get("songs.sources.proxy_downloads") diff --git a/src/template_endpoints/levels.cr b/src/template_endpoints/levels.cr index c45d330..28d1af4 100644 --- a/src/template_endpoints/levels.cr +++ b/src/template_endpoints/levels.cr @@ -25,7 +25,7 @@ CrystalGauntlet.template_endpoints[{ id = params["id"].as(String).to_i begin - name, username, difficulty_community, difficulty_set, demon_difficulty_int, featured, epic, rated_coins, downloads, likes, stars, description, song_id, song_name, song_author, song_url, song_author_url = DATABASE.query_one("select levels.name, users.username, community_difficulty, difficulty, demon_difficulty, featured, epic, rated_coins, downloads, likes, levels.stars, description, song_id, song_data.name, song_authors.name, songs.url, song_authors.source from levels left join users on levels.user_id = users.id left join songs on songs.id = levels.song_id left join song_data on song_data.id = levels.song_id left join song_authors on song_data.author_id = song_authors.id where levels.id = ?", id, as: {String, String, Int32?, Int32?, Int32?, Bool, Bool, Bool, Int32, Int32, Int32?, String, Int32, String?, String?, String?, String?}) + name, username, difficulty_community, difficulty_set, demon_difficulty_int, featured, epic, rated_coins, downloads, likes, stars, description, song_id, song_name, song_author, song_url, song_author_url = DATABASE.query_one("select levels.name, users.username, community_difficulty, difficulty, demon_difficulty, featured, epic, rated_coins, downloads, likes, levels.stars, description, song_id, song_data.name, song_authors.name, songs.url, song_authors.url from levels left join users on levels.user_id = users.id left join songs on songs.id = levels.song_id left join song_data on song_data.id = levels.song_id left join song_authors on song_data.author_id = song_authors.id where levels.id = ?", id, as: {String, String, Int32?, Int32?, Int32?, Bool, Bool, Bool, Int32, Int32, Int32?, String, Int32, String?, String?, String?, String?}) rescue err LOG.error {"whar.... #{err}"} context.response.status = HTTP::Status::NOT_FOUND