feat: initial database creation, loading

fixes for cartographer and automatically add track to album when adding to artist
This commit is contained in:
Joshua Strobl 2024-10-05 00:03:50 +03:00
parent 72bbcaba9e
commit 62c99ee67c
18 changed files with 515 additions and 108 deletions

View file

@ -29,11 +29,19 @@ std::optional<KotoAlbum*> Cartographer::getAlbum(QUuid uuid) {
return album ? std::optional {album} : std::nullopt;
}
QList<KotoAlbum*> Cartographer::getAlbums() {
return this->i_albums.values();
}
std::optional<KotoArtist*> Cartographer::getArtist(QUuid uuid) {
auto artist = this->i_artists.value(uuid, nullptr);
return artist ? std::optional {artist} : std::nullopt;
}
QList<KotoArtist*> Cartographer::getArtists() {
return this->i_artists.values();
}
std::optional<KotoArtist*> Cartographer::getArtist(QString name) {
auto artist = this->i_artists_by_name.value(name, nullptr);
return artist ? std::optional {artist} : std::nullopt;
@ -43,3 +51,7 @@ std::optional<KotoTrack*> Cartographer::getTrack(QUuid uuid) {
auto track = this->i_tracks.value(uuid, nullptr);
return track ? std::optional {track} : std::nullopt;
}
QList<KotoTrack*> Cartographer::getTracks() {
return this->i_tracks.values();
}