package com.ar.imagetracear.utils;

import android.content.Context;


import com.ar.imagetracear.database.AppDatabase;
import com.ar.imagetracear.database.ImageTraceEntry;
import com.ar.imagetracear.database.ImageTraceEntryDao;

import java.util.ArrayList;
import java.util.List;

public class ImageTraceRepository {

    private final ImageTraceEntryDao imageTraceEntryDao;

    public ImageTraceRepository(Context context) {
        AppDatabase db = AppDatabase.getInstance(context);
        imageTraceEntryDao = db.imageTraceEntryDao();
    }

    public void insertAllImages(List<String> imagePaths) {
        List<ImageTraceEntry> imageEntries = new ArrayList<>();
        for (String path : imagePaths) {
            imageEntries.add(new ImageTraceEntry(false, false, path));
        }

        imageTraceEntryDao.insertAll(imageEntries);
    }
}
