From 5d944606caceb25e67f6902120e97578313f9772 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 3 Apr 2012 09:12:55 -0400 Subject: [PATCH] Fix most compile errors --- server/paths.go | 6 +++--- server/server.go | 4 ++-- server/tv_rename.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/paths.go b/server/paths.go index ae084fb..682f1dd 100644 --- a/server/paths.go +++ b/server/paths.go @@ -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] == '.' { diff --git a/server/server.go b/server/server.go index db101ab..d921a14 100644 --- a/server/server.go +++ b/server/server.go @@ -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) } diff --git a/server/tv_rename.go b/server/tv_rename.go index f1dd48b..d902f4d 100644 --- a/server/tv_rename.go +++ b/server/tv_rename.go @@ -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) -- 2.43.5