diff --git a/configs/defaultConfig.ini b/configs/defaultConfig.ini index 6ce353f..0226890 100644 --- a/configs/defaultConfig.ini +++ b/configs/defaultConfig.ini @@ -3,5 +3,5 @@ allowUnknownFlags = false # Don't terminate the app if ini file contains unknow configUpdateInterval = 0s # Update interval for re-reading config file set via -config flag. Zero disables config file re-reading. imagesRootPath = # This is the images root path that should be mirrored to piwigo. piwigoPassword = # This is password to the given username. -piwigoUrl = # The root url to your piwigo installation. +piwigoUrl = # The root url without tailing slash to your piwigo installation. piwigoUser = # The username to use during sync. diff --git a/internal/app/app.go b/internal/app/app.go index 0166798..7168214 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -3,6 +3,7 @@ package app import ( "errors" "flag" + "fmt" "github.com/sirupsen/logrus" "haefelfinger.net/piwigo/DirectoriesToAlbums/internal/pkg/localFileStructure" "haefelfinger.net/piwigo/DirectoriesToAlbums/internal/pkg/piwigo/authentication" @@ -11,7 +12,7 @@ import ( var ( imagesRootPath = flag.String("imagesRootPath", "", "This is the images root path that should be mirrored to piwigo.") - piwigoUrl = flag.String("piwigoUrl", "", "The root url to your piwigo installation.") + piwigoUrl = flag.String("piwigoUrl", "", "The root url without tailing slash to your piwigo installation.") piwigoUser = flag.String("piwigoUser", "", "The username to use during sync.") piwigoPassword = flag.String("piwigoPassword", "", "This is password to the given username.") ) @@ -87,7 +88,7 @@ func configureContext() (*AppContext, error) { context := new(AppContext) context.LocalRootPath = *imagesRootPath context.Piwigo = new(authentication.PiwigoContext) - context.Piwigo.Url = *piwigoUrl + context.Piwigo.Url = fmt.Sprintf("%s/ws.php?format=json", *piwigoUrl) context.Piwigo.Username = *piwigoUser context.Piwigo.Password = *piwigoPassword