more work on output parsing
This commit is contained in:
7
main.py
7
main.py
@@ -45,7 +45,7 @@ def index():
|
|||||||
@app.route('/download', methods=['GET'])
|
@app.route('/download', methods=['GET'])
|
||||||
def download():
|
def download():
|
||||||
updated = []
|
updated = []
|
||||||
|
notupdated = []
|
||||||
result = db.session.query(manga, url_metadata).filter_by(active=1).join(url_metadata, manga.url_flag==url_metadata.flag).all()
|
result = db.session.query(manga, url_metadata).filter_by(active=1).join(url_metadata, manga.url_flag==url_metadata.flag).all()
|
||||||
|
|
||||||
for each in result:
|
for each in result:
|
||||||
@@ -66,11 +66,12 @@ def download():
|
|||||||
stdout = exec_command.communicate()[0]
|
stdout = exec_command.communicate()[0]
|
||||||
# print(stdout)
|
# print(stdout)
|
||||||
book['command'] = exec_command.args
|
book['command'] = exec_command.args
|
||||||
|
if stdout in 'No new chapters found':
|
||||||
|
notupdated.append(book['title'] + 'not updated')
|
||||||
updated.append(book)
|
updated.append(book)
|
||||||
|
|
||||||
missing = check(passin=1)
|
missing = check(passin=1)
|
||||||
return jsonify(manga=updated, missingFlags=missing[0], missingManga=missing[1], test=stdout)
|
return jsonify(manga=updated, missingFlags=missing[0], missingManga=missing[1], notupdated=notupdated)
|
||||||
|
|
||||||
@app.route('/upload', methods=['GET'])
|
@app.route('/upload', methods=['GET'])
|
||||||
def upload_jason():
|
def upload_jason():
|
||||||
|
|||||||
Reference in New Issue
Block a user