From f993969a689327a546fe630f4756f486beaab47a Mon Sep 17 00:00:00 2001 From: Julius Freudenberger Date: Sat, 4 Feb 2023 20:34:59 +0100 Subject: [PATCH] Fix links from info and meta feeds --- app.py | 6 +++--- utils.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 27fb3d2..2e73184 100644 --- a/app.py +++ b/app.py @@ -15,12 +15,12 @@ VIRTUAL_HOST = os.getenv('VIRTUAL_HOST') @app.route('/mensa/.json') def index(parser_name): try: - return utils.get_parser(parser_name).get_canteen_index(f'http://{VIRTUAL_HOST}/meta') + return utils.get_parser(parser_name).get_canteen_index(f'http://{VIRTUAL_HOST}/mensa/{parser_name}/meta') except KeyError: abort(404) -@app.route('/mensa//meta/') +@app.route('/mensa//meta/.xml') def meta(parser_name, canteen_name): try: return utils.get_parser(parser_name).get_meta_data(canteen_name, f'http://{VIRTUAL_HOST}/mensa/{parser_name}/feed') @@ -28,7 +28,7 @@ def meta(parser_name, canteen_name): abort(404) -@app.route('/mensa//feed/') +@app.route('/mensa//feed/.xml') def mensa(parser_name, canteen_name): try: return utils.get_parser(parser_name).get_meal_data(canteen_name) diff --git a/utils.py b/utils.py index be7ceda..103eebd 100644 --- a/utils.py +++ b/utils.py @@ -50,7 +50,7 @@ class Parser: meta_data.city = canteen.city meta_data.availability = 'public' if canteen.public else 'restricted' meta_data.feeds.append( - Feed('full', priority='0', url=f'{prefix}/{canteen.canteen_id}', source=canteen.source, dayOfWeek='*', dayOfMonth='*', + Feed('full', priority='0', url=f'{prefix}/{canteen.canteen_id}.xml', source=canteen.source, dayOfWeek='*', dayOfMonth='*', hour='9', minute='30', retry='60 1 1440')) return meta_data.toXMLFeed()