|
|
@ -89,7 +89,13 @@ class Series(Resource):
|
|
|
|
|
|
|
|
|
|
|
|
class Episodes(Resource):
|
|
|
|
class Episodes(Resource):
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
|
|
|
|
start = request.args.get('start') or 0
|
|
|
|
|
|
|
|
length = request.args.get('length') or -1
|
|
|
|
|
|
|
|
draw = request.args.get('draw')
|
|
|
|
|
|
|
|
|
|
|
|
seriesId = request.args.get('id')
|
|
|
|
seriesId = request.args.get('id')
|
|
|
|
|
|
|
|
row_count = database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE sonarrSeriesId=?",
|
|
|
|
|
|
|
|
(seriesId,), only_one=True)['count']
|
|
|
|
if seriesId:
|
|
|
|
if seriesId:
|
|
|
|
result = database.execute("SELECT * FROM table_episodes WHERE sonarrSeriesId=?", (seriesId,))
|
|
|
|
result = database.execute("SELECT * FROM table_episodes WHERE sonarrSeriesId=?", (seriesId,))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
@ -117,7 +123,7 @@ class Episodes(Resource):
|
|
|
|
|
|
|
|
|
|
|
|
# Confirm if path exist
|
|
|
|
# Confirm if path exist
|
|
|
|
item.update({"exist": os.path.isfile(mapped_path)})
|
|
|
|
item.update({"exist": os.path.isfile(mapped_path)})
|
|
|
|
return jsonify(result)
|
|
|
|
return jsonify(draw=draw, recordsTotal=row_count, recordsFiltered=row_count, data=result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Movies(Resource):
|
|
|
|
class Movies(Resource):
|
|
|
|