0
0
Fork 0

Adding OAuth access scopes, fixing OAuth authorization UI, adding rate limiting

to the API
This commit is contained in:
Eugen Rochko 2016-10-22 19:38:47 +02:00
parent 17122df80d
commit a9e40a3d80
26 changed files with 195 additions and 99 deletions

View file

@ -7,7 +7,7 @@ class Feed
def get(limit, max_id = nil, since_id = nil)
max_id = '+inf' if max_id.blank?
since_id = '-inf' if since_id.blank?
unhydrated = redis.zrevrangebyscore(key, "(#{max_id}", "(#{since_id}", limit: [0, limit], with_scores: true).collect(&:last).map(&:to_i)
unhydrated = redis.zrevrangebyscore(key, "(#{max_id}", "(#{since_id}", limit: [0, limit], with_scores: true).map(&:last).map(&:to_i)
# If we're after most recent items and none are there, we need to precompute the feed
if unhydrated.empty? && max_id == '+inf' && since_id == '-inf'

View file

@ -34,7 +34,8 @@ class MediaAttachment < ApplicationRecord
image? ? 'image' : 'video'
end
private
private
def self.file_styles(f)
if f.instance.image?
{