PiwigoDirectoryUploader/internal/app/images.go

42 lines
1.0 KiB
Go
Raw Normal View History

package app
2019-02-25 23:51:18 +01:00
import (
"errors"
"github.com/sirupsen/logrus"
2019-02-26 00:02:22 +01:00
"haefelfinger.net/piwigo/DirectoriesToAlbums/internal/pkg/localFileStructure"
"haefelfinger.net/piwigo/DirectoriesToAlbums/internal/pkg/piwigo/category"
2019-02-25 23:51:18 +01:00
)
2019-02-27 00:09:41 +01:00
func synchronizeImages(context *AppContext, fileSystem map[string]*localFileStructure.FilesystemNode, existingCategories map[string]*category.PiwigoCategory) error {
imageFiles := getImageList(fileSystem)
missingFiles := findMissingImages(imageFiles)
uploadImages(missingFiles)
2019-02-26 00:02:22 +01:00
return errors.New("synchronizeImages: NOT IMPLEMENTED")
}
2019-02-27 00:09:41 +01:00
func findMissingImages(imageFiles []string) []string {
logrus.Warnln("Finding missing images (NotImplemented)")
2019-02-27 00:09:41 +01:00
return nil
}
2019-02-27 00:09:41 +01:00
func uploadImages(missingFiles []string) {
logrus.Warnln("Uploading missing images (NotImplemented)")
}
2019-02-27 00:09:41 +01:00
func getImageList(fileSystem map[string]*localFileStructure.FilesystemNode) []string {
imageFiles := []string{}
for _, file := range fileSystem {
if !file.IsDir {
imageFiles = append(imageFiles, file.Key)
}
}
return imageFiles
}