コード例 #1
0
ファイル: libraries.go プロジェクト: rharter/mediaman
// GET /libraries/:id/process
// Processes a library of files to fetch metadata
func LibraryProcess(w http.ResponseWriter, r *http.Request) (interface{}, error) {
	idstr := getPathParam(r, "id")
	id, err := strconv.ParseInt(idstr, 10, 64)
	if err != nil {
		return nil, err
	}

	library, err := database.GetLibrary(id)
	if err != nil {
		return nil, err
	}

	processor.ProcessLibrary(library)

	return nil, nil
}
コード例 #2
0
ファイル: libraries.go プロジェクト: jerrellmardis/mediaman
func LibraryProcess(w http.ResponseWriter, r *http.Request) error {
	idstr := r.URL.Query().Get(":id")

	log.Printf("Handling request to precess library: %s", idstr)

	id, err := strconv.ParseInt(idstr, 10, 64)
	if err != nil {
		return err
	}

	library, err := database.GetLibrary(id)
	if err != nil {
		return err
	}

	processor.ProcessLibrary(library)

	return RenderText(w, "Processing", 200)
}