TextStore

The words read from each photo, in a full-text index (SQLite FTS4, unicode61: case- and accent-insensitive), so a search for a name or a phrase finds every screenshot containing it. Same lifecycle as EmbeddingStore: app-private, not backed up, rebuilt if lost.

Types

Link copied to clipboard
object Companion
Link copied to clipboard

What the index knows about mediaId at modified: not read yet, read with no words, or read with words.

Link copied to clipboard
class StoredLines(val width: Int, val height: Int, val data: ByteArray)

Properties

Link copied to clipboard
open val databaseName: String?
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun addLines(mediaId: Long, modified: Long, lines: List<String>): Int

Adds the lines's words don't have yet, if it's already been read at modified (a frame read in the viewer, from a video the indexer sampled); an item not read yet is left for its full read. Returns how many lines were new.

Link copied to clipboard
open fun close()
Link copied to clipboard
fun count(): Int
Link copied to clipboard
fun indexed(): Map<Long, Long>

Item id → the modified it was read at.

Link copied to clipboard
fun known(mediaId: Long, modified: Long): TextStore.Known
Link copied to clipboard
fun lines(mediaId: Long, modified: Long): TextStore.StoredLines?

mediaId's lines as read at modified; null when there are none for that version.

Link copied to clipboard
Link copied to clipboard
open override fun onCreate(db: SQLiteDatabase)
Link copied to clipboard
open fun onDowngrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int)
Link copied to clipboard
open fun onOpen(db: SQLiteDatabase?)
Link copied to clipboard
open override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int)
Link copied to clipboard
fun put(mediaId: Long, modified: Long, text: String)

Replaces whatever mediaId had; text is empty when the photo has no readable words.

Link copied to clipboard
fun putLines(mediaId: Long, modified: Long, width: Int, height: Int, data: ByteArray)
Link copied to clipboard
Link copied to clipboard
fun search(query: String): List<Long>

Items whose text has every word of query, the last one as a prefix (it may still be being typed). Empty for a query with no letters or digits.

Link copied to clipboard

Items whose text has every phrase word for word (full-text phrase queries skip punctuation: "so baby, come" matches "so baby come"); the last word is a prefix while its quote is still being typed.

Link copied to clipboard
open fun setIdleConnectionTimeout(idleConnectionTimeoutMs: Long)
Link copied to clipboard
open fun setLookasideConfig(slotSize: Int, slotCount: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun text(mediaId: Long): String?

The words read in one item, or null if none (or not read yet).

Link copied to clipboard

Photos read before lines were kept that have words: read again once, for Live Text.