2021-01-31 07:41:23 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2021-01-31 08:59:44 +01:00
|
|
|
"fmt"
|
2021-01-31 07:41:23 +01:00
|
|
|
"os"
|
2021-01-31 08:59:44 +01:00
|
|
|
|
|
|
|
photoprism "github.com/kris-nova/client-go"
|
2021-01-31 07:41:23 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2021-02-03 20:00:11 +01:00
|
|
|
uuid := os.Getenv("PHOTOPRISM_ID")
|
|
|
|
if uuid == "" {
|
|
|
|
halt(2, "Missing PHOTOPRISM_UUID")
|
2021-01-31 07:41:23 +01:00
|
|
|
}
|
2021-02-03 20:00:11 +01:00
|
|
|
client := photoprism.New(auth())
|
|
|
|
photo, err := client.V1().GetPhoto(uuid)
|
2021-01-31 08:59:44 +01:00
|
|
|
if err != nil {
|
|
|
|
halt(3, "Error fetching photo: %v", err)
|
|
|
|
}
|
|
|
|
fmt.Println(*photo)
|
2021-01-31 07:41:23 +01:00
|
|
|
}
|