mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-15 18:08:29 +00:00
feat: Track watch history when requesting through API
This commit is contained in:
parent
2df3ff3be9
commit
80e2e22804
@ -12,6 +12,10 @@ module Invidious::Routes::API::V1::Videos
|
||||
|
||||
begin
|
||||
video = get_video(id, region: region)
|
||||
user = env.get("user").as(User)
|
||||
if user.preferences.watch_history
|
||||
Invidious::Database::Users.mark_watched(user, id)
|
||||
end
|
||||
rescue ex : NotFoundException
|
||||
return error_json(404, ex)
|
||||
rescue ex
|
||||
|
Loading…
Reference in New Issue
Block a user