libsaria: Fix bug in updating library
I was readding all tracks to the new linked list, rather than checking if the track existed first. This has been fixed.
This commit is contained in:
parent
b5c8efc6d5
commit
7507955018
|
@ -26,7 +26,7 @@ class LibraryPath
|
||||||
string get_path();
|
string get_path();
|
||||||
void get_info(void (*)(struct libsaria::library::PathInfo &));
|
void get_info(void (*)(struct libsaria::library::PathInfo &));
|
||||||
bool get_info_id(ino_t &, void (*)(Track &));
|
bool get_info_id(ino_t &, void (*)(Track &));
|
||||||
void insert_track(TrackTag &);
|
void insert_track(ino_t &inode, TrackTag &);
|
||||||
bool play_id(ino_t &);
|
bool play_id(ino_t &);
|
||||||
void save(OutFile &);
|
void save(OutFile &);
|
||||||
void update();
|
void update();
|
||||||
|
|
|
@ -3,9 +3,10 @@
|
||||||
#include <libsaria/library.h>
|
#include <libsaria/library.h>
|
||||||
#include "library.h"
|
#include "library.h"
|
||||||
|
|
||||||
void LibraryPath::insert_track(TrackTag &tag)
|
void LibraryPath::insert_track(ino_t &inode, TrackTag &tag)
|
||||||
{
|
{
|
||||||
file_list.push_back(tag);
|
if (find_id(inode) == file_list.end())
|
||||||
|
file_list.push_back(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LibraryPath::update()
|
void LibraryPath::update()
|
||||||
|
@ -31,7 +32,7 @@ void ScanTask::tag_file(file filepath)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
TrackTag tag(dir + "/" + filepath.name, filepath.d_ino);
|
TrackTag tag(dir + "/" + filepath.name, filepath.d_ino);
|
||||||
library->insert_track(tag);
|
library->insert_track(filepath.d_ino, tag);
|
||||||
} catch (string message) {
|
} catch (string message) {
|
||||||
println(message);
|
println(message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue