Refactor containers and library loading

Replace trackPtr with raw Track* pointers in HashTable, add loadLibrary
to PlayerLocal, remove unused File helpers, and fix broken artwork/artist
SQL bindings.
This commit is contained in:
2026-06-22 11:51:27 +02:00
parent 05bd44a354
commit 00c8d9b843
6 changed files with 29 additions and 15 deletions
+11
View File
@@ -4,6 +4,8 @@
#include "../include/Database.h"
#include "../include/Containers.h"
#include <memory>
using db = Database;
void Player::play () { PE_.startPlayback(); }
@@ -55,3 +57,12 @@ void PlayerLocal::scanLibrary(){
db_.addTrack( t );
}
}
void PlayerLocal::loadLibrary() {
db_.fetchAll( library );
for ( auto t : library ) {
tracks_.ht_insert(t.title.toCString(), &t );
artists_.ht_insert( t.artist.toCString(), &t );
albums_.ht_insert( t.album.toCString(), &t );
}
}