diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious.cr | 15 | ||||
| -rw-r--r-- | src/invidious/users.cr | 4 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 169c4f12..285d4394 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -1028,7 +1028,7 @@ post "/login" do |env| user, sid = create_user(sid, email, password) user_array = user.to_a - user_array[5] = user_array[5].to_json + user_array[4] = user_array[4].to_json args = arg_array(user_array) PG_DB.exec("INSERT INTO users VALUES (#{args})", user_array) @@ -1375,10 +1375,8 @@ get "/subscription_manager" do |env| subscriptions = [] of InvidiousChannel user.subscriptions.each do |ucid| - begin - subscriptions << get_channel(ucid, PG_DB, false, false) - rescue ex - next + if channel = PG_DB.query_one?("SELECT * FROM channels WHERE id = $1", ucid, as: InvidiousChannel) + subscriptions << channel end end subscriptions.sort_by! { |channel| channel.author.downcase } @@ -3950,14 +3948,13 @@ end error 500 do |env| error_message = <<-END_HTML - Looks like you've found a bug in Invidious. Feel free to open a new issue - <a href="https://github.com/omarroth/invidious/issues/github.com/omarroth/invidious"> + Looks like you've found a bug in Invidious. Feel free to open a new issue + <a href="https://github.com/omarroth/invidious/issues"> here </a> or send an email to <a href="mailto:omarroth@protonmail.com"> - omarroth@protonmail.com - </a>. + omarroth@protonmail.com</a>. END_HTML templated "error" end diff --git a/src/invidious/users.cr b/src/invidious/users.cr index 67125654..072638ba 100644 --- a/src/invidious/users.cr +++ b/src/invidious/users.cr @@ -132,7 +132,7 @@ def get_user(sid, headers, db, refresh = true) user, sid = fetch_user(sid, headers, db) user_array = user.to_a - user_array[5] = user_array[5].to_json + user_array[4] = user_array[4].to_json args = arg_array(user_array) db.exec("INSERT INTO users VALUES (#{args}) \ @@ -154,7 +154,7 @@ def get_user(sid, headers, db, refresh = true) user, sid = fetch_user(sid, headers, db) user_array = user.to_a - user_array[5] = user_array[5].to_json + user_array[4] = user_array[4].to_json args = arg_array(user.to_a) db.exec("INSERT INTO users VALUES (#{args}) \ |
