diff options
| author | jacqueline <me@jacqueline.id.au> | 2025-01-24 11:44:36 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2025-01-24 11:44:36 +1100 |
| commit | b4b43ca3eb011b0b69db39821ac310229e1b37ad (patch) | |
| tree | b53e5f14926e03ff5c5399b3be95c827a255c83b /src/tangara/database/index.cpp | |
| parent | 337f62669bb0b3ab35333ee4bbd46a9b46fde386 (diff) | |
| parent | 580712acd11d5afdacd51c2e8d29313efc93d520 (diff) | |
| download | tangara-fw-b4b43ca3eb011b0b69db39821ac310229e1b37ad.tar.gz | |
Merge branch 'main' of codeberg.org:cool-tech-zone/tangara-fw
Diffstat (limited to 'src/tangara/database/index.cpp')
| -rw-r--r-- | src/tangara/database/index.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/tangara/database/index.cpp b/src/tangara/database/index.cpp index e60f56d5..7f594700 100644 --- a/src/tangara/database/index.cpp +++ b/src/tangara/database/index.cpp @@ -77,8 +77,8 @@ const IndexInfo kAudiobooks{ .components = {Tag::kAlbum, Tag::kAlbumOrder}, }; -static auto titleOrFilename(const TrackData& data, const TrackTags& tags) - -> std::pmr::string { +static auto titleOrFilename(const TrackData& data, + const TrackTags& tags) -> std::pmr::string { auto title = tags.title(); if (title) { return *title; @@ -147,8 +147,7 @@ auto Indexer::index() -> std::vector<std::pair<IndexKey, std::string>> { IndexKey::Header root_header{ .id = index_.id, - .depth = 0, - .components_hash = 0, + .components_hash = {}, }; handleLevel(root_header, index_.components); @@ -237,16 +236,10 @@ auto Index(locale::ICollator& collator, } auto ExpandHeader(const IndexKey::Header& header, - const std::optional<std::pmr::string>& component) - -> IndexKey::Header { + const std::pmr::string& component) -> IndexKey::Header { IndexKey::Header ret{header}; - ret.depth++; - if (component) { - ret.components_hash = - komihash(component->data(), component->size(), ret.components_hash); - } else { - ret.components_hash = komihash(NULL, 0, ret.components_hash); - } + ret.components_hash.push_back( + komihash(component.data(), component.size(), 0)); return ret; } |
