PiwigoDirectoryUploader/cmd/DirectoriesToAlbums/main.go

32 lines
600 B
Go
Raw Normal View History

2019-02-23 21:57:54 +01:00
package main
import (
"flag"
"github.com/sirupsen/logrus"
2019-02-23 22:02:12 +01:00
"haefelfinger.net/piwigo/DirectoriesToAlbums/internal/app"
2019-02-23 21:57:54 +01:00
"os"
)
func main() {
flag.Parse()
root := flag.Arg(0)
InitializeLog()
app.AuthenticateToPiwigo()
app.ScanLocalDirectories(root)
app.GetAllCategoriesFromServer()
app.FindMissingAlbums()
app.CreateMissingAlbums()
app.FindMissingImages()
app.UploadImages()
}
func InitializeLog() {
//TODO: make log configurable to file instead of console
logrus.SetLevel(logrus.DebugLevel)
logrus.SetOutput(os.Stdout)
logrus.Infoln("Starting Piwigo directories to albums...")
2019-02-23 22:02:12 +01:00
}