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:
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user