feat: Track watch history when requesting through API

This commit is contained in:
Ramon 2025-05-23 15:01:58 +02:00
parent 2df3ff3be9
commit 80e2e22804

View File

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