func (repo *RepositoryConfig) ListKind(source string, kind MediaKind) []*Image {
	if System.GetCamera(source) == nil {
		panic(fmt.Errorf("attempt to list unknown camera '%s'", source))
	}

	images := []*Image{}
	dir := repo.dirFor(source, kind)
	f, err := os.Open(dir)
	if err != nil {
		panic(err)
	}
	defer f.Close()
	entries, err := f.Readdir(0)
	if err != nil {
		panic(err)
	}
	for _, entry := range entries {
		s := strings.Split(entry.Name(), ".")
		if s[1] != "jpg" {
			// .webm files live alonside their .jpg still images, but we shouldn't return them as handles`
			continue
		}
		_, err := os.Stat(filepath.Join(dir, fmt.Sprintf("%s.webm", s[0])))
		hasVideo := (kind == MediaGenerated || err == nil)
		images = append(images, &Image{
			Handle:    s[0],
			Source:    source,
			Timestamp: entry.ModTime(),
			HasVideo:  hasVideo,
		})
	}

	return images
}
// ListKind returns the handles of all images of the indicated kind, associated with the indicated source.
ListKind returns the handles of all images of the indicated kind, associated with the indicated source.
// ListKind returns the handles of all images of the indicated kind associated with the indicated source .
func (repo *RepositoryConfig) ListKind(source string, kind MediaKind) []*Image {
	if System.GetCamera(source) == nil {
		panic(fmt.Errorf("attempt to list unknown camera '%s'", source))
	}
	images := []*Image{}
	dir := repo.dirFor(source, kind)
	f, err := os.Open(dir)
	if err != nil {
		panic(err)
	}
	defer f.Close()
	entries, err := f.Readdir(0)
	if err != nil {
		panic(err)
	}
	for _, entry := range entries {
		s := strings.Split(entry.Name(), ".")
		if s[1] != "jpg" {
			continue
		}
		_, err := os.Stat(filepath.Join(dir, fmt.Sprintf("%s.webm", s[0])))
		hasVideo := (kind == MediaGenerated || err == nil)
		images = append(images, &Image{
			Handle:    s[0],
			Source:    source,
			Timestamp: entry.ModTime(),
			HasVideo:  hasVideo,
		})
	}
	return images
}
func ( repo * RepositoryConfig ) ListKind ( source string , kind MediaKind ) [ ] * Image { if System . GetCamera ( source ) == nil { panic ( fmt . Errorf ( " " , source ) ) } images := [ ] * Image { } dir := repo . dirFor ( source , kind ) f , err := os . Open ( dir ) if err != nil { panic ( err ) } defer f . Close ( ) entries , err := f . Readdir ( 0 ) if err != nil { panic ( err ) } for _ , entry := range entries { s := strings . Split ( entry . Name ( ) , " " ) if s [ 1 ] != " " { continue } _ , err := os . Stat ( filepath . Join ( dir , fmt . Sprintf ( " " , s [ 0 ] ) ) ) hasVideo := ( kind == MediaGenerated || err == nil ) images = append ( images , & Image { Handle : s [ 0 ] , Source : source , Timestamp : entry . ModTime ( ) , HasVideo : hasVideo , } ) } return images }
ListKind returns the handles of all images of the indicated kind, associated with the indicated source.
ListKind returns the handles of all images of the indicated kind associated with the indicated source .
// .webm files live alonside their .jpg still images, but we shouldn't return them as handles`