-
Notifications
You must be signed in to change notification settings - Fork 1
/
.byebug_history
256 lines (256 loc) · 6.5 KB
/
.byebug_history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
continue
user_data = fetch_plex_user_data(auth_token)
auth_token
continue
params
continue
browser.name
continue
browser.platform.name
browser.version
browser.name
browser.device.name
browser.platform.name
browser.platform
browser.device
browser
continue
@session
continue
@session
session_params
continue
movie['viewCount'].to_i == 0
movie['viewCount'].to_i
movie = movie.first
movie = movies.select { |movie| movie["title"].downcase.include?("65".downcase) }
movie['viewCount'].to_i > 0
movie['viewCount'].to_i
movie['viewCount']
movie = movie.first
movie['viewCount']
movie["viewCount"]
movie = movies.select { |movie| movie["title"].downcase.include?("suicide squad".downcase) }
movies.select { |movie| movie["title"].downcase.include?("suicide squad".downcase) }
movies("title" => "#Alive")
movies.first
movies.find_by(title: "Suicide Squad")
movies
continue
movies.first
movies.pluck(:unwatched)
movies.pluck(:watched)
movies
continue
movies[544]
movies[500]
movies[50]
movies[5]
movies[4]
movies.first
continue
movies.unwatched.pluck(:watched)
movies.unwatched
movies.all
movies.first
continue
duration[:hours]
duration = ActiveSupport::Duration.build(movie['duration'] / 1000).parts
ActiveSupport::Duration.build(movie['duration'] / 1000).parts
Duration.build(movie['duration'] / 1000).parts
movie['duration'] / 60000
movie['duration'] / 600
movie['duration'] / 60
movie['duration']
movie[:year]
movie['year']
movie = movies.first
movie = movie.first
movies.first
movies
continue
response.status
response
continue
sections = []
servers
continue
available_servers.map do |server|
connection_info = select_public_connection(server['connections'])
if connection_info
{
ip: connection_info['address'],
port: connection_info['port'],
local: connection_info['local']
}
else
Rails.logger.error("No suitable public connection found for Plex server: #{server['name']}")
nil
end
end.compact
servers.count
servers
servers = JSON.parse(response.body)
connection
continue
servers
continue
voter
continue
voter
continue
voter.user =! current_user
voter.user == current_user
current_user
voter.user
voter
continue
@movie
continue
@user.id
@session.movies.where.not(id: @session.votes.where(user_id: @user.id).select(:movie_id)).sample
@session.movies
@session
@movie
continue
voter_path
continue
@movie
@session.movies
@session
continue
current_user.movies.first
current_user.movies
current_user
@movie
continue
params
continue
params
total_voters
votes.where(positive: true)
.group(:movie_id)
.having('COUNT(DISTINCT voter_id) = ?', total_voters)
.exists?
votes.where(positive: true)
23: .group(:movie_id)
24: .having('COUNT(DISTINCT voter_id) = ?', total_voters)
25: .exists?
continue
voters
votes.last
session.vote.last
continue
votes.pluck(:positive)
votes.pluck(:voter_id)
votes.pluck(:voter_id).pluck(:positive)
votes
votes.where(positive: true).group(:movie_id).having('count(distinct voter_id) = ?', self.unique_participants).count.any?
session.votes.where(positive: true).group(:movie_id).having('count(distinct voter_id) = ?', self.unique_participants).count.any?
session.votes.where(positive: true).group(:movie_id).having('count(distinct voter_id) = ?', session.unique_participants).count.any?
self
session_id
session.votes.where(positive: true).group(:movie_id).having('count(distinct voter_id) = ?', session.unique_participants).count.any?
votes.where(positive: true).group(:movie_id).having('count(distinct voter_id) = ?', unique_participants).count.any?
votes.where(positive: true).group(:movie_id).having('count(distinct voter_id) = ?'
votes.where(positive: true).group(:movie_id).having('count(distinct voter_id) = ?', unique_participants).count.any?
votes
votes.where(positive: true).group(:movie_id).having('count(distinct voter_id) = ?'
votes.where(positive: true).group(:movie_id).having('count(distinct voter_id)
unique_participants
continue
session.votes.where(movie: @movie).count
session.votes.where(movie: @movie)
session.votes.where(movie: @movie, positive: true)
session.votes.where(movie: movie, positive: true)
@movie
session.votes.where(movie: movie, positive: true)
continue
xml_doc.xpath('//Video').first
xml_doc.xpath('//Video')
xml_doc.first
xml_doc
movie = movies.first
continue
movies.first
continue
"http://#{server_info[:ip]}:#{server_info[:port]}#{video.attr('thumb')}?X-Plex-Token=#{user.plex_token}"
server_info
video.attr('ratingKey')
video = movies.first
movies.first
movies = xml_doc.xpath('//Video')
xml_doc.xpath('//Video')
continue
response.body
response = connection.get("/library/sections/#{section_id}/all") do |req|
req.headers['Accept'] = 'application/xml'
req.headers['X-Plex-Token'] = user.plex_token
req.headers['X-Plex-Client-Identifier'] = user.plex_client_id
end
response = connection.get("/api/v2/library/sections/#{section_id}/all") do |req|
req.headers['Accept'] = 'application/xml'
req.headers['X-Plex-Token'] = user.plex_token
req.headers['X-Plex-Client-Identifier'] = user.plex_client_id
end
response
response.body
reponse.body
connection = Faraday.new(url: "http://#{server_info[:ip]}:#{server_info[:port]}") do |faraday|
faraday.request :url_encoded
faraday.adapter Faraday.default_adapter
end
server_info
section_id
continue
section_id
response.body
response = connection.get("/api/v2/library/sections/#{section_id}/all") do |req|
req.headers['Accept'] = 'application/xml'
req.headers['X-Plex-Token'] = user.plex_token
req.headers['X-Plex-Client-Identifier'] = user.plex_client_id
end
connection = Faraday.new(url: 'https://plex.tv') do |faraday|
faraday.request :url_encoded
faraday.adapter Faraday.default_adapter
end
sections
continue
Session.find_by(id: params[:id])
Session.find_by(session_token: params[:id])
params
continue
@session.save
continue
@session.errors
@session.save
continue
@session.errors
@session.save
@session
continue
conntinue
@session.errors
@session.save
continue
params
@session
continue
@session.errors
@session.save
@session
continue
sections
continue
servers.count
servers
servers = JSON.parse(response.body)
response = connection.get('/api/v2/resources') do |req|
req.headers['Accept'] = 'application/json'
req.headers['X-Plex-Token'] = user.plex_token
req.headers['X-Plex-Client-Identifier'] = user.plex_client_id
end
continue
response.body
response = connection.get('/api/v2/resources') do |req|
req.headers['Accept'] = 'application/json'