summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsimonphoenix96 <diazjustin1995@yahoo.de>2021-02-27 21:59:09 +0100
committersimonphoenix96 <diazjustin1995@yahoo.de>2021-02-27 21:59:09 +0100
commit84487b2e520f74871afb7dfa97117cfe0282f0c9 (patch)
treed324a3370c07680aec499a145af61c46ff08eba9
parent9689376de69ae0fa1c6e8569647ced5d5851e2e1 (diff)
downloadinvidious-84487b2e520f74871afb7dfa97117cfe0282f0c9.tar.gz
invidious-84487b2e520f74871afb7dfa97117cfe0282f0c9.tar.bz2
invidious-84487b2e520f74871afb7dfa97117cfe0282f0c9.zip
format invidious.cr using crystal cli
-rw-r--r--src/invidious.cr10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index a776b2c0..80f551e9 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -760,7 +760,7 @@ post "/data_control" do |env|
end
end
when "import_youtube"
- if body[0..4] == "<opml"
+ if body[0..4] == "<opml"
subscriptions = XML.parse(body)
user.subscriptions += subscriptions.xpath_nodes(%q(//outline[@type="rss"])).map do |channel|
channel["xmlUrl"].match(/UC[a-zA-Z0-9_-]{22}/).not_nil![0]
@@ -1563,12 +1563,12 @@ post "/feed/webhook/:token" do |env|
views: video.views,
})
- was_insert = PG_DB.query_one("INSERT INTO channel_videos VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) \
- ON CONFLICT (id) DO UPDATE SET title = $2, published = $3, \
- updated = $4, ucid = $5, author = $6, length_seconds = $7, \
+ was_insert = PG_DB.query_one("INSERT INTO channel_videos VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
+ ON CONFLICT (id) DO UPDATE SET title = $2, published = $3,
+ updated = $4, ucid = $5, author = $6, length_seconds = $7,
live_now = $8, premiere_timestamp = $9, views = $10 returning (xmax=0) as was_insert", *video.to_tuple, as: Bool)
- PG_DB.exec("UPDATE users SET notifications = array_append(notifications, $1), \
+ PG_DB.exec("UPDATE users SET notifications = array_append(notifications, $1),
feed_needs_update = true WHERE $2 = ANY(subscriptions)", video.id, video.ucid) if was_insert
end
end