File tree Expand file tree Collapse file tree 4 files changed +23
-23
lines changed Expand file tree Collapse file tree 4 files changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -35,31 +35,31 @@ module Invidious::Database::Channels
3535 def update_author (id : String , author : String )
3636 request = <<-SQL
3737 UPDATE channels
38- SET updated = $ 1 , author = $2 , deleted = false
39- WHERE id = $3
38+ SET updated = now() , author = $1 , deleted = false
39+ WHERE id = $2
4040 SQL
4141
42- PG_DB .exec(request, Time .utc, author, id)
42+ PG_DB .exec(request, author, id)
4343 end
4444
4545 def update_subscription_time (id : String )
4646 request = <<-SQL
4747 UPDATE channels
48- SET subscribed = $ 1
49- WHERE id = $2
48+ SET subscribed = now()
49+ WHERE id = $1
5050 SQL
5151
52- PG_DB .exec(request, Time .utc, id)
52+ PG_DB .exec(request, id)
5353 end
5454
5555 def update_mark_deleted (id : String )
5656 request = <<-SQL
5757 UPDATE channels
58- SET updated = $ 1 , deleted = true
59- WHERE id = $2
58+ SET updated = now() , deleted = true
59+ WHERE id = $1
6060 SQL
6161
62- PG_DB .exec(request, Time .utc, id)
62+ PG_DB .exec(request, id)
6363 end
6464
6565 # -------------------
Original file line number Diff line number Diff line change @@ -59,35 +59,35 @@ module Invidious::Database::Playlists
5959 def update_subscription_time (id : String )
6060 request = <<-SQL
6161 UPDATE playlists
62- SET subscribed = $ 1
63- WHERE id = $2
62+ SET subscribed = now()
63+ WHERE id = $1
6464 SQL
6565
66- PG_DB .exec(request, Time .utc, id)
66+ PG_DB .exec(request, id)
6767 end
6868
6969 def update_video_added (id : String , index : String | Int64 )
7070 request = <<-SQL
7171 UPDATE playlists
7272 SET index = array_append(index, $1 ),
7373 video_count = cardinality(index) + 1 ,
74- updated = $ 2
75- WHERE id = $3
74+ updated = now()
75+ WHERE id = $2
7676 SQL
7777
78- PG_DB .exec(request, index, Time .utc, id)
78+ PG_DB .exec(request, index, id)
7979 end
8080
8181 def update_video_removed (id : String , index : String | Int64 )
8282 request = <<-SQL
8383 UPDATE playlists
8484 SET index = array_remove(index, $1 ),
8585 video_count = cardinality(index) - 1 ,
86- updated = $ 2
87- WHERE id = $3
86+ updated = now()
87+ WHERE id = $2
8888 SQL
8989
90- PG_DB .exec(request, index, Time .utc, id)
90+ PG_DB .exec(request, index, id)
9191 end
9292
9393 # -------------------
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ module Invidious::Database::SessionIDs
1010 def insert (sid : String , email : String , handle_conflicts : Bool = false )
1111 request = <<-SQL
1212 INSERT INTO session_ids
13- VALUES ($1 , $2 , $ 3 )
13+ VALUES ($1 , $2 , now() )
1414 SQL
1515
1616 request += " ON CONFLICT (id) DO NOTHING" if handle_conflicts
1717
18- PG_DB .exec(request, sid, email, Time .utc )
18+ PG_DB .exec(request, sid, email)
1919 end
2020
2121 # -------------------
Original file line number Diff line number Diff line change @@ -143,11 +143,11 @@ module Invidious::Database::Users
143143 def clear_notifications (user : User )
144144 request = <<-SQL
145145 UPDATE users
146- SET notifications = ' {}' , updated = $ 1
147- WHERE email = $2
146+ SET notifications = ' {}' , updated = now()
147+ WHERE email = $1
148148 SQL
149149
150- PG_DB .exec(request, Time .utc, user.email)
150+ PG_DB .exec(request, user.email)
151151 end
152152
153153 # -------------------
You can’t perform that action at this time.
0 commit comments