mirror of
				https://github.com/photoprism/photoprism.git
				synced 2025-10-31 12:16:39 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			725 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			725 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package batch
 | |
| 
 | |
| import "strings"
 | |
| 
 | |
| // PhotosRequest represents items selected in the user interface.
 | |
| type PhotosRequest struct {
 | |
| 	Return bool        `json:"return,omitempty"`
 | |
| 	Filter string      `json:"filter,omitempty"`
 | |
| 	Photos []string    `json:"photos"`
 | |
| 	Values *PhotosForm `json:"values,omitempty"`
 | |
| }
 | |
| 
 | |
| // Empty checks if any specific items were selected.
 | |
| func (f PhotosRequest) Empty() bool {
 | |
| 	switch {
 | |
| 	case len(f.Photos) > 0:
 | |
| 		return false
 | |
| 	}
 | |
| 
 | |
| 	return true
 | |
| }
 | |
| 
 | |
| // Get returns a string slice with the selected item UIDs.
 | |
| func (f PhotosRequest) Get() []string {
 | |
| 	return f.Photos
 | |
| }
 | |
| 
 | |
| // String returns a string containing all selected item UIDs.
 | |
| func (f PhotosRequest) String() string {
 | |
| 	return strings.Join(f.Get(), ", ")
 | |
| }
 | 
