oops! wrong argument order. database permanently affected

swap source and url in song_authors to fix
This commit is contained in:
Jill 2023-05-26 11:29:24 +03:00
parent 344edf369c
commit 4346f1aaa0
Signed by: oat
GPG Key ID: 33489AA58A955108
2 changed files with 2 additions and 2 deletions

View File

@ -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")

View File

@ -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