package transcript

import (
	"encoding/json"

	"gitea.maximumdirect.net/eric/notarius/internal/core/source"
)

const (
	MetadataSpeaker = "speaker"
	MetadataStart   = "start"
	MetadataEnd     = "end"
)

func Speaker(unit source.SourceUnit) (string, bool) {
	value, ok := unit.Metadata[MetadataSpeaker].(string)
	return value, ok
}

func Start(unit source.SourceUnit) (json.Number, bool) {
	value, ok := unit.Metadata[MetadataStart].(json.Number)
	return value, ok
}

func End(unit source.SourceUnit) (json.Number, bool) {
	value, ok := unit.Metadata[MetadataEnd].(json.Number)
	return value, ok
}
