diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-10-24 16:29:46 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-10-24 16:29:46 +1100 |
| commit | 2086ab09b8d89c27f524d82a68b9a2035ea02436 (patch) | |
| tree | e84765353237e23487b9fe6ceae8faeb13b2a94d /src/database/include/track.hpp | |
| parent | 4f8c127da926bc1e1724e7686a42d37c1da0f563 (diff) | |
| download | tangara-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/track.hpp')
| -rw-r--r-- | src/database/include/track.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/database/include/track.hpp b/src/database/include/track.hpp index b07da9ba..72296e8d 100644 --- a/src/database/include/track.hpp +++ b/src/database/include/track.hpp @@ -83,6 +83,10 @@ class TrackTags { auto at(const Tag& key) const -> std::optional<std::pmr::string>; auto operator[](const Tag& key) const -> std::optional<std::pmr::string>; + auto tags() const -> const std::pmr::unordered_map<Tag, std::pmr::string>& { + return tags_; + } + /* * Returns a hash of the 'identifying' tags of this track. That is, a hash * that can be used to determine if one track is likely the same as another, @@ -119,12 +123,14 @@ struct TrackData { : id(0), filepath(&memory::kSpiRamResource), tags_hash(0), + individual_tag_hashes(&memory::kSpiRamResource), is_tombstoned(false), modified_at() {} TrackId id; std::pmr::string filepath; uint64_t tags_hash; + std::pmr::unordered_map<Tag, uint64_t> individual_tag_hashes; bool is_tombstoned; std::pair<uint16_t, uint16_t> modified_at; |
