Browse Source

Update Reaktori to be fazerfood branched from amica brand (same API)

Toni Fadjukoff 6 years ago
parent
commit
1176596fe9
1 changed files with 3 additions and 1 deletions
  1. 3 1
      amica.py

+ 3 - 1
amica.py View File

4
 restaurant_info = [
4
 restaurant_info = [
5
   [ "(TaY) Amica Minerva", "http://www.amica.fi/minerva", "", "middle", "https://www.amica.fi/modules/json/json/Index?costNumber=0815&language=fi" ],
5
   [ "(TaY) Amica Minerva", "http://www.amica.fi/minerva", "", "middle", "https://www.amica.fi/modules/json/json/Index?costNumber=0815&language=fi" ],
6
   [ "(TaY) Tampereen normaalikoulun ravintola", "http://www.amica.fi/tampereennormaalikoulu", "", "middle", "https://www.amica.fi/modules/json/json/Index?costNumber=0811&language=fi" ],
6
   [ "(TaY) Tampereen normaalikoulun ravintola", "http://www.amica.fi/tampereennormaalikoulu", "", "middle", "https://www.amica.fi/modules/json/json/Index?costNumber=0811&language=fi" ],
7
-  [ "(TTY) Ravintola Reaktori", "http://www.amica.fi/reaktori", "", "middle", "https://www.amica.fi/modules/json/json/Index?costNumber=0812&language=fi" ]
7
+  [ "(TTY) Ravintola Reaktori", "https://www.fazerfoodco.fi/ravintolat/Ravintolat-kaupungeittain/tampere/reaktori/", "", "middle", "https://www.fazerfoodco.fi/modules/json/json/Index?costNumber=0812&language=fi" ]
8
 ]
8
 ]
9
 
9
 
10
 def get_restaurants(use_old, week):
10
 def get_restaurants(use_old, week):
27
 
27
 
28
         week_foods = {}
28
         week_foods = {}
29
         lunch_menus = data["MenusForDays"]
29
         lunch_menus = data["MenusForDays"]
30
+        if not lunch_menus:
31
+            continue
30
         for lunch_menu in lunch_menus:
32
         for lunch_menu in lunch_menus:
31
             date = lunch_menu["Date"].split("T")[0]
33
             date = lunch_menu["Date"].split("T")[0]
32
             try:
34
             try: