summaryrefslogtreecommitdiff
path: root/src/database/include/database.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-10-24 16:29:46 +1100
committerjacqueline <me@jacqueline.id.au>2023-10-24 16:29:46 +1100
commit2086ab09b8d89c27f524d82a68b9a2035ea02436 (patch)
treee84765353237e23487b9fe6ceae8faeb13b2a94d /src/database/include/database.hpp
parent4f8c127da926bc1e1724e7686a42d37c1da0f563 (diff)
downloadtangara-fw-2086ab09b8d89c27f524d82a68b9a2035ea02436.tar.gz
Implement incremental updates of database indexes
This makes rescanning the library *so* much faster. Yay!
Diffstat (limited to 'src/database/include/database.hpp')
-rw-r--r--src/database/include/database.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/database/include/database.hpp b/src/database/include/database.hpp
index 7cb1d09c..cdf69db0 100644
--- a/src/database/include/database.hpp
+++ b/src/database/include/database.hpp
@@ -7,6 +7,7 @@
#pragma once
#include <stdint.h>
+#include <sys/_stdint.h>
#include <cstdint>
#include <future>
#include <memory>
@@ -150,6 +151,11 @@ class Database {
auto dbPutHash(const uint64_t& hash, TrackId i) -> void;
auto dbGetHash(const uint64_t& hash) -> std::optional<TrackId>;
auto dbCreateIndexesForTrack(const Track& track) -> void;
+ auto dbRemoveIndexes(std::shared_ptr<TrackData>) -> void;
+ auto dbIngestTagHashes(const TrackTags&,
+ std::pmr::unordered_map<Tag, uint64_t>&) -> void;
+ auto dbRecoverTagsFromHashes(const std::pmr::unordered_map<Tag, uint64_t>&)
+ -> std::shared_ptr<TrackTags>;
template <typename T>
auto dbGetPage(const Continuation& c) -> Result<T>*;