Fix links from info and meta feeds
This commit is contained in:
parent
199048207a
commit
f993969a68
2 changed files with 4 additions and 4 deletions
6
app.py
6
app.py
|
@ -15,12 +15,12 @@ VIRTUAL_HOST = os.getenv('VIRTUAL_HOST')
|
|||
@app.route('/mensa/<parser_name>.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/<parser_name>/meta/<canteen_name>')
|
||||
@app.route('/mensa/<parser_name>/meta/<canteen_name>.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/<parser_name>/feed/<canteen_name>')
|
||||
@app.route('/mensa/<parser_name>/feed/<canteen_name>.xml')
|
||||
def mensa(parser_name, canteen_name):
|
||||
try:
|
||||
return utils.get_parser(parser_name).get_meal_data(canteen_name)
|
||||
|
|
2
utils.py
2
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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue