HighlightReaderProtocol
public protocol HighlightReaderProtocol
A protocol that defines a reader of HighlightObjects
-
highlightsByGroup(_:Asynchronous) Returns all HighlightObjects with the given group
Reads the highlight objects and returns the sorted list. The list is sorted by the
dateRecordeddesc,jerseyNumberascDeclaration
Swift
func highlightsByGroup(_ group: String?) async -> [HighlightObject]Parameters
groupgroup name or everything if nil. Pass the
groupto find all highlights created in a session. -
highlightsByChunkFile(_:Asynchronous) Returns all HighlightObjects for a given video chunk name
Reads the highlight objects and returns the sorted list. The list is sorted by the
dateRecordeddesc,jerseyNumberascDeclaration
Swift
func highlightsByChunkFile(_ file: String) async -> [HighlightObject]Parameters
filevideo chunk file name. Pass the
chunkNameto find all highlights associated with this chunk. -
highlightsBy(groups:AsynchronousjerseyNumbers: dateFrom: dateTo: ) Find the saved highlights by groups, jersey numbers and date range
You can search highlights by groups or jersey numbers or combination of both (AND condition) and optionally filter by date range.
Note
If you want to find all highlights without jersey numbers then pass [nil] to
jerseyNumbers. If you want all jersey numbers then passnilto the parameter.Declaration
Swift
func highlightsBy(groups: [String]?, jerseyNumbers: [Int?]?, dateFrom: Date?, dateTo: Date?) async -> [HighlightObject]Return Value
a list of HighlightObjects
-
availableJerseyNumbers(dateFrom:AsynchronousdateTo: ) Find a list of all known jersey numbers in the saved highlights for the given date range
Searches all highlights in the given date range and returns a list of unique jersey numbers sorted in ascending order.
Declaration
Swift
func availableJerseyNumbers(dateFrom: Date?, dateTo: Date?) async -> [JerseyNumberInfo]Return Value
a list of unique jersey numbers and number of highlights for each, each JN is included only once
-
availableGroups(dateFrom:AsynchronousdateTo: ) Find a list of all known groups in the saved highlights for the given date range
Searches all highlights in the given date range and returns a list of unique groups sorted by date recorded in ascending order.
Declaration
Swift
func availableGroups(dateFrom: Date?, dateTo: Date?) async -> [GroupInfo]Return Value
a list of unique groups and number of highlights for each, each group is included only once
-
saveHighlights(_:Asynchronous) Save the given list of highlight objects into internal DB
The method saves the given list of highlight objects into the internal DB to be later retrieved by the reader.
Note
The highlight should have the chunk file set and exist in thehighlightsPath.Declaration
Swift
func saveHighlights(_ highlights: [HighlightObject]) async -> [HighlightObject]Parameters
highlightsa list of highlight objects to save
Return Value
a list of saved highlight objects or empty array if nothing is saved
HighlightReaderProtocol Protocol Reference