Fix most compile errors
authorRobert Sesek <rsesek@bluestatic.org>
Tue, 3 Apr 2012 13:12:55 +0000 (09:12 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Tue, 3 Apr 2012 13:32:06 +0000 (09:32 -0400)
server/paths.go
server/server.go
server/tv_rename.go

index ae084fb38b07c1311efab7a7053850b84d2813d0..682f1ddbcdce3136989957fffbce95f83b057de9 100644 (file)
@@ -34,7 +34,7 @@ func checkInJail(the_path string) bool {
        return true
 }
 
-func IsValidPathPath(path string) (bool, string) {
+func IsValidPath(path string) (bool, string) {
        path = canonicalizePath(path)
        _, err := os.Lstat(path)
        return err == nil && checkInJail(path), path
@@ -58,8 +58,8 @@ func ListPath(the_path string) (files []string, err error) {
        }
 
        for _, info := range fileinfos {
-               name := info.Name
-               if info.IsDirectory() {
+               name := info.Name()
+               if info.IsDir() {
                        name += "/"
                }
                if !gConfig.IncludeDotfiles && name[0] == '.' {
index db101aba3bbc79c3df60e44ed31f05984bc30b7a..d921a149652f010514613ef14bec53d05e57c9ca 100644 (file)
@@ -93,7 +93,7 @@ func serviceHandler(response http.ResponseWriter, request *http.Request) {
                        okResponse(response, data)
                }
        case "tv_rename":
-               newPath, err := tv_rename.RenameEpisode(request.FormValue("path"))
+               newPath, err := RenameTVEpisode(request.FormValue("path"))
                if err != nil {
                        errorResponse(response, err.Error())
                } else {
@@ -209,6 +209,6 @@ func RunBackEnd() {
        mux.HandleFunc("/download", downloadHandler)
        mux.HandleFunc("/proxy", proxyHandler)
 
-       error := http.ListenAndServe(fmt.Sprintf(":%d", config.Port), mux)
+       error := http.ListenAndServe(fmt.Sprintf(":%d", gConfig.Port), mux)
        fmt.Printf("error %v", error)
 }
index f1dd48b5d9e2bd8ffd3fef3a580a2a084eb225f8..d902f4dbf5743b637b275d5b197ceb43ebc46608 100644 (file)
@@ -26,7 +26,7 @@ import (
 
 // Takes a full file path and renames the last path component as if it were a
 // TV episode. This performs the actual rename as well.
-func RenameEpisode(inPath string) (*string, error) {
+func RenameTVEpisode(inPath string) (*string, error) {
        // Parse the filename into its components.
        dirName, fileName := path.Split(inPath)
        info := parseEpisodeName(fileName)