descartes 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/descartes/modules/pigro.rb +31 -4
- data/lib/descartes/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9fde5d438495d6be05885ffca91155325cdfaaff
|
|
4
|
+
data.tar.gz: 5fa4dc848dc33e44cbdd3b303a5d270437bcc075
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bbd0dbaf5f17abe1ea0d79de76b28ff7ae5c173e3cafdc9622ea2d69a26cacc6d8b7082a1e08934e42741d681e5d1a148720db982dc44700e4fb622f2c2074de
|
|
7
|
+
data.tar.gz: 1f1f27d7f379be6862345b5988d69119c85e616cc00b201955b3bde9f94b427d4b7b2ef37ae5117fca7d00c8520a51ce5f38cbd3f9069cd86ec2da99f3e0d556
|
|
@@ -159,12 +159,37 @@ class Descartes
|
|
|
159
159
|
end
|
|
160
160
|
end
|
|
161
161
|
|
|
162
|
-
match /pigro (.+)
|
|
163
|
-
def edit_episode(m,
|
|
164
|
-
|
|
162
|
+
match /pigro (.+)/, method: :edit_episode
|
|
163
|
+
def edit_episode(m, things)
|
|
164
|
+
if not m.user.authed?
|
|
165
|
+
m.reply 'You have to login first.'
|
|
166
|
+
return
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
things = things.split ' '
|
|
170
|
+
len = things.length
|
|
171
|
+
status = things.pop
|
|
172
|
+
field = things.pop
|
|
173
|
+
episode = things.pop
|
|
174
|
+
show = things.join ' '
|
|
175
|
+
|
|
176
|
+
if len < 4 || !episode.numeric?
|
|
177
|
+
m.reply 'usage: !pigro SHOW EPISODE FIELD STATUS'
|
|
178
|
+
return
|
|
179
|
+
end
|
|
180
|
+
|
|
165
181
|
host = get_host
|
|
182
|
+
user = get_user m.user.nick
|
|
166
183
|
assonnato = Assonnato.new host
|
|
167
184
|
|
|
185
|
+
series = assonnato.show.search show
|
|
186
|
+
if series.length != 1
|
|
187
|
+
m.reply 'You should refine your search.'
|
|
188
|
+
return
|
|
189
|
+
else
|
|
190
|
+
show = series.first.name
|
|
191
|
+
end
|
|
192
|
+
|
|
168
193
|
if user
|
|
169
194
|
login = assonnato.user.login user['username'], user['password']
|
|
170
195
|
if login['status'] == 'error'
|
|
@@ -185,7 +210,9 @@ class Descartes
|
|
|
185
210
|
|
|
186
211
|
if File.exists? file
|
|
187
212
|
users = JSON.parse File.read(file)
|
|
188
|
-
users.select { |user|
|
|
213
|
+
users.select { |user|
|
|
214
|
+
user['nicknames'].select { |n| n['nickname'] == nickname }
|
|
215
|
+
}.last
|
|
189
216
|
else
|
|
190
217
|
false
|
|
191
218
|
end
|
data/lib/descartes/version.rb
CHANGED