package dev.photosync.core.provider.immich;

import dev.photosync.core.provider.PhotoProvider;
import dev.photosync.core.provider.ProviderConnection;
import dev.photosync.core.provider.ProviderDescriptor;
import dev.photosync.core.provider.ProviderFactory;
import dev.photosync.core.provider.ProviderId;

/**
 * Registers Immich with the {@code ProviderCatalog}.
 *
 * <p>The one place in the mod where the string "immich" appears outside a
 * language file. A second backend is a second class like this one.
 */
public final class ImmichProviderFactory implements ProviderFactory {

    private final ProviderDescriptor descriptor =
            new ProviderDescriptor(new ProviderId("immich"), "photosync.provider.immich", true);

    @Override
    public ProviderDescriptor descriptor() {
        return descriptor;
    }

    @Override
    public PhotoProvider connect(ProviderConnection connection) {
        return new ImmichProvider(descriptor, connection);
    }
}
