1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-25 09:12:38 +00:00
This commit is contained in:
Louis Vézina 2019-12-14 12:34:14 -05:00
parent ad601c60a1
commit 8b52c4d6ae

View file

@ -47,7 +47,25 @@ class Series(Resource):
return jsonify(result)
class Episodes(Resource):
def get(self):
seriesId = request.args.get('id')
if seriesId:
result = database.execute("SELECT * FROM table_episodes WHERE sonarrSeriesId=?", (seriesId,))
else:
result = database.execute("SELECT * FROM table_episodes")
for item in result:
# Provide mapped path
mapped_path = path_replace(item['path'])
item.update({"mapped_path": mapped_path})
# Confirm if path exist
item.update({"exist": os.path.isfile(mapped_path)})
return jsonify(result)
api.add_resource(Series, '/api/series')
api.add_resource(Episodes, '/api/episodes')
if __name__ == '__main__':
app.run(debug=True)