mirror of
https://github.com/photoprism/photoprism.git
synced 2025-10-26 10:20:32 +08:00
Push updates: Add event types for photos & albums
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
@@ -48,6 +48,10 @@ func BatchPhotosArchive(router *gin.RouterGroup, conf *config.Config) {
|
||||
|
||||
event.Publish("config.updated", event.Data(conf.ClientConfig()))
|
||||
|
||||
event.Publish("photos.archived", event.Data{
|
||||
"entities": f.Photos,
|
||||
})
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"message": fmt.Sprintf("photos archived in %d s", elapsed)})
|
||||
})
|
||||
}
|
||||
@@ -86,6 +90,10 @@ func BatchPhotosRestore(router *gin.RouterGroup, conf *config.Config) {
|
||||
|
||||
event.Publish("config.updated", event.Data(conf.ClientConfig()))
|
||||
|
||||
event.Publish("photos.restored", event.Data{
|
||||
"entities": f.Photos,
|
||||
})
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"message": fmt.Sprintf("photos restored in %d s", elapsed)})
|
||||
})
|
||||
}
|
||||
@@ -120,6 +128,10 @@ func BatchAlbumsDelete(router *gin.RouterGroup, conf *config.Config) {
|
||||
|
||||
event.Publish("config.updated", event.Data(conf.ClientConfig()))
|
||||
|
||||
event.Publish("albums.deleted", event.Data{
|
||||
"entities": f.Albums,
|
||||
})
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"message": fmt.Sprintf("albums deleted")})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user