package DataSource

type DataSession interface {
	Start(torrents TorrentSelection) error

	StartNow(torrents TorrentSelection) error

	Stop(torrents TorrentSelection) error

	Verify(torrents TorrentSelection) error

	Reannounce(torrents TorrentSelection) error

	Update(torrents TorrentSelection, properties map[string]interface{}) error

	// MonotonicUpdateCounter must return an int that increases every time the
	// underlying data from 'Get' would have changed. This is used by TRPCD to
	// optimise sending traffic to the client.
	MonotonicUpdateCounter() int64

	// Get should return all known torrent information. TRPCD will transparently
	// optimise the traffic sent to the client.
	Get() ([]Torrent, error)

	// Add accepts properties in the form of a DataSource.TorrentAdd struct, but
	// with most keys being optional.
	Add(properties map[string]interface{}) (TorrentAddResponse, error)

	Remove(torrents TorrentSelection) error

	SetLocation(torrents TorrentSelection, Location string, Move bool) error

	RenamePath(torrents TorrentSelection, Path, Name string) error

	UpdateSession(properties map[string]interface{}) error

	Session() (Session, error)

	SessionStats() (SessionStats, error)

	UpdateBlocklist() error

	MoveUp(torrents TorrentSelection) error

	MoveDown(torrents TorrentSelection) error

	MoveToTop(torrents TorrentSelection) error

	MoveToBottom(torrents TorrentSelection) error

	FreeSpace(Path string) (int64, error)
}
