mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-18 20:24:36 -05:00
Check preferences before marking video as watched
This commit is contained in:
parent
7b124eec64
commit
15e9510ab2
@ -76,6 +76,10 @@ module Invidious::Routes::API::V1::Authenticated
|
|||||||
def self.mark_watched(env)
|
def self.mark_watched(env)
|
||||||
user = env.get("user").as(User)
|
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)
|
id = env.params.url["id"]?.try &.as(String)
|
||||||
if !id
|
if !id
|
||||||
return error_json(400, "Invalid video id.")
|
return error_json(400, "Invalid video id.")
|
||||||
|
Loading…
Reference in New Issue
Block a user