Commit 3cf5b6c2 authored by ale's avatar ale

export default metadata providers

parent 9a1fabfa
...@@ -290,6 +290,13 @@ func (uc *updateContext) dbwriter(ch chan fileAndBook) { ...@@ -290,6 +290,13 @@ func (uc *updateContext) dbwriter(ch chan fileAndBook) {
} }
} }
func DefaultMetadataProviders() []MetadataProvider {
return []MetadataProvider{
&opfProvider{},
&fileProvider{},
}
}
func (db *Database) Update(dir string, chooser MetadataChooserFunc) { func (db *Database) Update(dir string, chooser MetadataChooserFunc) {
// Parallelize metadata extraction, serialize database updates // Parallelize metadata extraction, serialize database updates
// (so that index-based de-duplication works). // (so that index-based de-duplication works).
...@@ -300,10 +307,7 @@ func (db *Database) Update(dir string, chooser MetadataChooserFunc) { ...@@ -300,10 +307,7 @@ func (db *Database) Update(dir string, chooser MetadataChooserFunc) {
// Calibre/OPF must be first, so we don't attempt to // Calibre/OPF must be first, so we don't attempt to
// parse the file itself. // parse the file itself.
providers: []MetadataProvider{ providers: DefaultMetadataProviders(),
&opfProvider{},
&fileProvider{},
},
// Check Google Books when the metadata is not // Check Google Books when the metadata is not
// sufficient to fully describe the book. // sufficient to fully describe the book.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment