Remove recordings feature, replay sessions directly, bump to 0.6.0
Recordings were just a thin named pointer over an already-captured session's events, so the whole separate feature (recordings table, API routes, pages, UI) is gone: any completed session can now be named and replayed directly. Replaying no longer creates a session or duplicates events of its own - it just bumps the source session's playCount/lastPlayedAt. Also renames play_sessions/playSession(s) to sessions/session(s) throughout the schema, queries, API routes, and UI for consistency, and updates the README to match the new flow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,14 +11,14 @@ export interface IncomingEvent {
|
||||
durationMs?: number;
|
||||
}
|
||||
|
||||
export async function insertEvents(playSessionId: number, events: IncomingEvent[]): Promise<void> {
|
||||
export async function insertEvents(sessionId: number, events: IncomingEvent[]): Promise<void> {
|
||||
if (events.length === 0) return;
|
||||
|
||||
const insertMany = sqlite.transaction((rows: IncomingEvent[]) => {
|
||||
for (const row of rows) {
|
||||
db.insert(sessionEvents)
|
||||
.values({
|
||||
playSessionId,
|
||||
sessionId,
|
||||
sessionDeviceId: row.sessionDeviceId,
|
||||
tsMs: row.tsMs,
|
||||
commandType: row.commandType,
|
||||
@@ -33,10 +33,10 @@ export async function insertEvents(playSessionId: number, events: IncomingEvent[
|
||||
insertMany(events);
|
||||
}
|
||||
|
||||
export async function getEventsForSession(playSessionId: number) {
|
||||
export async function getEventsForSession(sessionId: number) {
|
||||
return db
|
||||
.select()
|
||||
.from(sessionEvents)
|
||||
.where(eq(sessionEvents.playSessionId, playSessionId))
|
||||
.where(eq(sessionEvents.sessionId, sessionId))
|
||||
.orderBy(asc(sessionEvents.tsMs));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user