Adds audiobook index to available indexes

custom
ailurux 7 months ago
parent 2bc191e63d
commit 5e43b42218
  1. 2
      src/tangara/database/database.cpp
  2. 7
      src/tangara/database/index.cpp
  3. 1
      src/tangara/database/index.hpp

@ -293,7 +293,7 @@ auto Database::getIndexes() -> std::vector<IndexInfo> {
// TODO(jacqueline): This probably needs to be async? When we have runtime
// configurable indexes, they will need to come from somewhere.
return {
kAllTracks, kAllAlbums, kAlbumsByArtist, kTracksByGenre, kPodcasts,
kAllTracks, kAllAlbums, kAlbumsByArtist, kTracksByGenre, kPodcasts, kAudiobooks
};
}

@ -63,6 +63,13 @@ const IndexInfo kPodcasts{
.components = {Tag::kTitle},
};
const IndexInfo kAudiobooks{
.id = 6,
.type = MediaType::kAudiobook,
.name = "Audiobooks",
.components = {Tag::kAlbum, Tag::kAlbumOrder},
};
static auto titleOrFilename(const TrackData& data, const TrackTags& tags)
-> std::pmr::string {
auto title = tags.title();

@ -79,5 +79,6 @@ extern const IndexInfo kTracksByGenre;
extern const IndexInfo kAllTracks;
extern const IndexInfo kAllAlbums;
extern const IndexInfo kPodcasts;
extern const IndexInfo kAudiobooks;
} // namespace database

Loading…
Cancel
Save