cleanup
This commit is contained in:
@@ -126,13 +126,19 @@ func handleFolder(fullPath string, stat os.FileInfo) error {
|
||||
func handleFolderCompletion(fullPath string, info *godirwalk.Dirent) error {
|
||||
currentDir := currentDirStack.Peek()
|
||||
defer currentDirStack.Pop()
|
||||
if currentCover.NewlyInserted {
|
||||
currentDir.CoverID = currentCover.ID
|
||||
tx.Save(currentDir)
|
||||
}
|
||||
var dirShouldSave bool
|
||||
if currentAlbum.ID != 0 {
|
||||
currentAlbum.CoverID = currentCover.ID
|
||||
tx.Save(currentAlbum)
|
||||
currentDir.HasTracks = true
|
||||
dirShouldSave = true
|
||||
}
|
||||
if currentCover.NewlyInserted {
|
||||
currentDir.CoverID = currentCover.ID
|
||||
dirShouldSave = true
|
||||
}
|
||||
if dirShouldSave {
|
||||
tx.Save(currentDir)
|
||||
}
|
||||
currentCover = &db.Cover{}
|
||||
currentAlbum = &db.Album{}
|
||||
|
||||
@@ -140,7 +140,7 @@ func setAdminRoutes(cont handler.Controller, mux *http.ServeMux) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
address := ":6969"
|
||||
address := "0.0.0.0:6969"
|
||||
mux := http.NewServeMux()
|
||||
// create a new controller and pass a copy to both routes.
|
||||
// they will add more fields to their copy if they need them
|
||||
|
||||
Reference in New Issue
Block a user