forked from midou/invidious
Fix watch history order
This commit is contained in:
parent
b287ff2126
commit
8445d3ae12
@ -50,6 +50,7 @@ module Invidious::Database::Users
|
|||||||
end
|
end
|
||||||
|
|
||||||
def mark_watched(user : User, vid : String)
|
def mark_watched(user : User, vid : String)
|
||||||
|
mark_unwatched(user, vid)
|
||||||
request = <<-SQL
|
request = <<-SQL
|
||||||
UPDATE users
|
UPDATE users
|
||||||
SET watched = array_append(watched, $1)
|
SET watched = array_append(watched, $1)
|
||||||
|
@ -76,7 +76,7 @@ module Invidious::Routes::Watch
|
|||||||
end
|
end
|
||||||
env.params.query.delete_all("iv_load_policy")
|
env.params.query.delete_all("iv_load_policy")
|
||||||
|
|
||||||
if watched && preferences.watch_history && !watched.includes? id
|
if watched && preferences.watch_history
|
||||||
Invidious::Database::Users.mark_watched(user.as(User), id)
|
Invidious::Database::Users.mark_watched(user.as(User), id)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -259,9 +259,7 @@ module Invidious::Routes::Watch
|
|||||||
|
|
||||||
case action
|
case action
|
||||||
when "action_mark_watched"
|
when "action_mark_watched"
|
||||||
if !user.watched.includes? id
|
Invidious::Database::Users.mark_watched(user, id)
|
||||||
Invidious::Database::Users.mark_watched(user, id)
|
|
||||||
end
|
|
||||||
when "action_mark_unwatched"
|
when "action_mark_unwatched"
|
||||||
Invidious::Database::Users.mark_unwatched(user, id)
|
Invidious::Database::Users.mark_unwatched(user, id)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user