diff --git a/vendor/built_in_modules/video/app/controllers/panel/video/back_end/channel_videos_controller.rb b/vendor/built_in_modules/video/app/controllers/panel/video/back_end/channel_videos_controller.rb index ebb1d5689..681ce13d4 100644 --- a/vendor/built_in_modules/video/app/controllers/panel/video/back_end/channel_videos_controller.rb +++ b/vendor/built_in_modules/video/app/controllers/panel/video/back_end/channel_videos_controller.rb @@ -61,9 +61,12 @@ class Panel::Video::BackEnd::ChannelVideosController < OrbitBackendController @data = Array.new @channels.each do |channel| + client = YouTubeIt::Client.new(:dev_key => "AI39si5KGPg8rhKLBfmeukit2tCSP_B9lT8igiNICbrbgUXQoAdYGvsyCGCmO1wGnr1OW4bDRv-ESolwk-rdBNIAgVTL9VYaEA") + @client_videos = client.videos_by(:user => channel.channel_name) + number_of_videos = @client_videos.videos.length name = channel.channel_name channel_id = channel.id.to_s - @data << { channel_name: name, channel_link: "http://ntue.tp.rulingcom.com/panel/video/back_end/channel_videos/get_channel_videos?channel_id=#{channel_id}"} + @data << { channel_name: name, channel_link: "http://ntue.tp.rulingcom.com/panel/video/back_end/channel_videos/get_channel_videos?channel_id=#{channel_id}", number_of_videos: number_of_videos } end render :json => JSON.pretty_generate(@data)