Add ability to search by language.
[quanweb.git] / main / handler.go
index 2d8076e35720c20e5422ecd87fe9eca83f70c7c9..599f5d557bcde26ee40fbaed3e5eb8a0eb739771 100644 (file)
@@ -29,10 +29,10 @@ func bookMimeType(bookPath string) string {
 }
 
 func efsPathForId(efsId int) string {
-  config := getConfig()
+  config := GetConfig()
 
   idStr := fmt.Sprintf("%010d", efsId)
-  path := fmt.Sprintf("%s/%s/%s/%s/%s/%s.dat", config.efsBasePath, idStr[0:2], idStr[2:4], idStr[4:6], idStr[6:8], idStr)
+  path := fmt.Sprintf("%s/efs/%s/%s/%s/%s/%s.dat", config.basePath, idStr[0:2], idStr[2:4], idStr[4:6], idStr[6:8], idStr)
 
   return path
 }
@@ -180,7 +180,7 @@ func handleInfo(w http.ResponseWriter, r *http.Request) {
 func handleSearch(w http.ResponseWriter, r *http.Request) {
   var err error
 
-  fields := []Field{Author, Title, Series}
+  fields := []Field{Author, Language, Series, Title}
 
   terms := make([]SearchTerm, len(fields))