Refactor SampleEntity to BinaryEntity and update related files and queries

This commit is contained in:
2025-06-10 19:46:19 +02:00
parent 4d7c46093c
commit 3746ced387
4 changed files with 9 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
package nl.astraeus.vst.base.db
object SampleDao {
object BinaryDao {
val queryProvider = SampleEntityQueryProvider
fun getSample(waveHash: String): ByteArray {

View File

@@ -2,8 +2,8 @@ package nl.astraeus.vst.base.db
import java.sql.ResultSet
val SAMPLE_CREATE_QUERY = """
CREATE TABLE SAMPLES (
val BINARY_CREATE_QUERY = """
CREATE TABLE BINARIESYSAMPLES (
SHA1HASH TEXT,
FILENAME TEXT,
LENGTH NUMBER,

View File

@@ -77,12 +77,17 @@ class WebsocketHandler(
}
}
}
// todo: add LOAD_BINARY command which expects a hash,
// find the file in the data/files/ directory and send it as binary
}
}
}
override fun onFullBinaryMessage(channel: WebSocketChannel?, message: BufferedBinaryMessage?) {
// do nothing yet
// todo: create hash from binary, save file in data/files/ directory,
// sub directories are 5 characters of the hash per directory
}
}