|
|
@ -13,7 +13,7 @@ client = pymongo.MongoClient(MONGODB_URL, username=MONGODB_USERNAME, password=MO
|
|
|
|
db = client[MONGODB_DATABASE]
|
|
|
|
db = client[MONGODB_DATABASE]
|
|
|
|
|
|
|
|
|
|
|
|
# Créer le dossier pour stocker les images s'il n'existe pas
|
|
|
|
# Créer le dossier pour stocker les images s'il n'existe pas
|
|
|
|
IMAGES_DIR = "../images"
|
|
|
|
IMAGES_DIR = "images"
|
|
|
|
if not os.path.exists(IMAGES_DIR):
|
|
|
|
if not os.path.exists(IMAGES_DIR):
|
|
|
|
os.makedirs(IMAGES_DIR)
|
|
|
|
os.makedirs(IMAGES_DIR)
|
|
|
|
|
|
|
|
|
|
|
@ -126,10 +126,10 @@ def import_real_data(user_id):
|
|
|
|
images_collection = db["images"]
|
|
|
|
images_collection = db["images"]
|
|
|
|
|
|
|
|
|
|
|
|
# Charger les données JSON
|
|
|
|
# Charger les données JSON
|
|
|
|
with open('../memorymap.pins.json', 'r', encoding='utf-8') as f:
|
|
|
|
with open('memorymap.pins.json', 'r', encoding='utf-8') as f:
|
|
|
|
pins_data = json.load(f)
|
|
|
|
pins_data = json.load(f)
|
|
|
|
|
|
|
|
|
|
|
|
with open('../memorymap.images.json', 'r', encoding='utf-8') as f:
|
|
|
|
with open('memorymap.images.json', 'r', encoding='utf-8') as f:
|
|
|
|
images_data = json.load(f)
|
|
|
|
images_data = json.load(f)
|
|
|
|
|
|
|
|
|
|
|
|
# Créer un mapping des anciens IDs vers les nouveaux
|
|
|
|
# Créer un mapping des anciens IDs vers les nouveaux
|
|
|
|