CXwudi / vocadb-video-downloader-new

An integrated cli-based media archiving solution for VocaDB
2 stars 0 forks source link

only load downloader if needed #13

Closed CXwudi closed 2 years ago

CXwudi commented 3 years ago

when we have more and more downloaders choice in the futures, we can't force users to fill in all downloaders config, so we need:

CXwudi commented 3 years ago

So we have an enablement config with map of PV services to downloader names, but how to validate this map

Q: can we put custom ConstrainValidator into spring ApplicationContext and let it has depending bean of Preference? A: Yes, a ConstrainValidator can be a spring component with other dependent components Q2: can the custom validator contains a bean of Environment and call checkProperty() method to validate if a property root path exist? A: Yes and No, we can only check if the full name property exists, but not the root

CXwudi commented 3 years ago

About solution for loading only enabled downloaders:

CXwudi commented 3 years ago

FInal answer: use @Conditonal(MyCondition.class) Reason: