Joshua Ramon Enslin 7cfd3bb1de
First working version
- Move from separate dirs for upload to a unified one (identify
  media/metadata files by file extension)
- Prevent uploading when an import is already scheduled
- Allow setting custom, parser-specific settings
- Add CLI
- Implement WebDAV upload
- Implement checking of upload folders for uploadable contents

Close #6, close #7, close #9, close #3, close #1, close #4
2025-02-27 17:29:20 +01:00

62 lines
1.8 KiB
Go

package main
import (
"slices"
"os"
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/cli"
)
// Attempts to connect to WebDAV server, verifying that the authentication data
// works and that the server is one for uploads with museum-digital.
// A museum-digital WebDAV directory can be identified by the availability of the
// directories IMPORT_IMG and IMPORT_XML.
// func verifyConnection(config MDWebDavUploaderConfig) bool {
// }
// Generates the contents of the file import_config.txt necessary
// to let museum-digital know about the required import configuration.
func generateImportConfigFile() { // string {
}
// Uploads metadata files to the configured instance of
// museum-digital / musdb.
func uploadMetadataFiles() {
}
// Uploads media files to the configured instance of
// museum-digital / musdb.
func uploadMediaFiles() {
}
func main() {
if slices.Contains(os.Args, "--help") {
} else if slices.Contains(os.Args, "--show-config") {
cli.ShowCurrentConfig()
} else if slices.Contains(os.Args, "--run-manual-setup") {
cli.RunManualSetup()
} else if slices.Contains(os.Args, "--set-additional-setting") {
cli.SetAdditionalSetting()
} else if slices.Contains(os.Args, "--upload") {
cli.HandleUpload()
} else if slices.Contains(os.Args, "--webdav-remote-list-toplevel") {
cli.ListRemoteToplevel()
} else if slices.Contains(os.Args, "--webdav-remote-list-metadata-dir") {
cli.ListRemoteMetadataDir()
} else if slices.Contains(os.Args, "--webdav-remote-list-media-dir") {
cli.ListRemoteMediaDir()
} else if slices.Contains(os.Args, "--local-list-metadata") {
cli.ListLocalMetadata()
} else if slices.Contains(os.Args, "--local-list-media") {
cli.ListLocalMedia()
} else {
// cli.RunManualSetup()
}
}