Search: fix off by one offset error

Offset is eventually passed to sqlite as an OFFSET clause.

This works as follows:

sqlite> select num from seq limit 5 offset 0;
┌─────┐
│ num │
├─────┤
│ 1   │
│ 2   │
│ 3   │
│ 4   │
│ 5   │
└─────┘

sqlite> select num from seq limit 5 offset 5;
┌─────┐
│ num │
├─────┤
│ 6   │
│ 7   │
│ 8   │
│ 9   │
│ 10  │
└─────┘

However, the code currently emits a request for offset + 1, which ends
up skipping a message

sqlite> select num from seq limit 5 offset 5+1;
┌─────┐
│ num │
├─────┤
│ 7   │
│ 8   │
│ 9   │
│ 10  │
│ 11  │
└─────┘
This commit is contained in:
Reto Brunner 2022-11-12 23:16:16 +01:00
parent 8095d9e88a
commit 51c9ce078d

View File

@ -212,7 +212,7 @@ export default defineComponent({
networkUuid: network.value?.uuid, networkUuid: network.value?.uuid,
channelName: channel.value?.name, channelName: channel.value?.name,
searchTerm: String(route.query.q || ""), searchTerm: String(route.query.q || ""),
offset: offset.value + 1, offset: offset.value,
}); });
}; };