Invidious is an alternative front-end to YouTube
Check preferences before marking video as watched
Brahim Hadriche15e9510ab212
diff --git a/src/invidious/routes/api/v1/authenticated.cr b/src/invidious/routes/api/v1/authenticated.crindex e670a87c..dc86bb3c 100644--- a/src/invidious/routes/api/v1/authenticated.cr+++ b/src/invidious/routes/api/v1/authenticated.cr@@ -76,6 +76,10 @@ module Invidious::Routes::API::V1::Authenticateddef self.mark_watched(env)user = env.get("user").as(User)+ if !user.preferences.watch_history+ return error_json(409, "Watch history is disabled in preferences.")+ end+id = env.params.url["id"]?.try &.as(String)if !idreturn error_json(400, "Invalid video id.")