mirror of
				https://github.com/iv-org/invidious.git
				synced 2025-11-04 06:08:31 -06:00 
			
		
		
		
	Merge branch 'master' into api-only
This commit is contained in:
		
						commit
						6630f3b2a5
					
				@ -1,7 +1,7 @@
 | 
			
		||||
crawl_threads: 1
 | 
			
		||||
video_threads: 0
 | 
			
		||||
crawl_threads: 0
 | 
			
		||||
channel_threads: 1
 | 
			
		||||
feed_threads: 1
 | 
			
		||||
video_threads: 1
 | 
			
		||||
db:
 | 
			
		||||
  user: kemal
 | 
			
		||||
  password: kemal
 | 
			
		||||
 | 
			
		||||
@ -14,7 +14,6 @@
 | 
			
		||||
# You should have received a copy of the GNU Affero General Public License
 | 
			
		||||
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 | 
			
		||||
require "crypto/bcrypt/password"
 | 
			
		||||
require "detect_language"
 | 
			
		||||
require "digest/md5"
 | 
			
		||||
require "kemal"
 | 
			
		||||
 | 
			
		||||
@ -180,6 +180,21 @@ def pull_top_videos(config, db)
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
def pull_popular_videos(db)
 | 
			
		||||
  loop do
 | 
			
		||||
    subscriptions = PG_DB.query_all("SELECT channel FROM \
 | 
			
		||||
      (SELECT UNNEST(subscriptions) AS channel FROM users) AS d \
 | 
			
		||||
    GROUP BY channel ORDER BY COUNT(channel) DESC LIMIT 40", as: String)
 | 
			
		||||
 | 
			
		||||
    videos = PG_DB.query_all("SELECT DISTINCT ON (ucid) * FROM \
 | 
			
		||||
      channel_videos WHERE ucid IN (#{arg_array(subscriptions)}) \
 | 
			
		||||
    ORDER BY ucid, published DESC", subscriptions, as: ChannelVideo).sort_by { |video| video.published }.reverse
 | 
			
		||||
 | 
			
		||||
    yield videos
 | 
			
		||||
    Fiber.yield
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
def update_decrypt_function
 | 
			
		||||
  loop do
 | 
			
		||||
    begin
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,5 @@
 | 
			
		||||
require "crypto/bcrypt/password"
 | 
			
		||||
 | 
			
		||||
class User
 | 
			
		||||
  module PreferencesConverter
 | 
			
		||||
    def self.from_rs(rs)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user