libsaria: Start banned songs on the banned playlist
Instead of putting them on the library playlist. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
4718bf77f3
commit
ed5574f612
|
@ -5,6 +5,7 @@
|
|||
#include <libsaria/library.h>
|
||||
#include <libsaria/track.h>
|
||||
#include <libsaria/print.h>
|
||||
#include <libsaria/ban.h>
|
||||
#include <libsaria/fs.h>
|
||||
#include "library.h"
|
||||
|
||||
|
@ -49,7 +50,8 @@ void read_path(ifstream &stream)
|
|||
stringstream s;
|
||||
unsigned int size;
|
||||
unsigned int version;
|
||||
list<libsaria::Track *> tracks;
|
||||
libsaria::Track *track;
|
||||
list<libsaria::Track *> tracks, banned;
|
||||
struct libsaria::library::Path path, *path_ptr;
|
||||
|
||||
getline(stream, tmp);
|
||||
|
@ -73,7 +75,11 @@ void read_path(ifstream &stream)
|
|||
path_ptr = push_path(path);
|
||||
for (unsigned int i = 0; i < size; i++) {
|
||||
path_ptr->tracks.push_back(libsaria::Track(stream, path_ptr, version));
|
||||
tracks.push_back(&path_ptr->tracks.back());
|
||||
track = &path_ptr->tracks.back();
|
||||
if (track->get_banned())
|
||||
banned.push_back(track);
|
||||
else
|
||||
tracks.push_back(track);
|
||||
}
|
||||
|
||||
if (version != 2) {
|
||||
|
@ -83,6 +89,7 @@ void read_path(ifstream &stream)
|
|||
|
||||
notify_path_updated(path_ptr);
|
||||
lib_playlist.add_tracks(tracks);
|
||||
libsaria::ban::get_banned_plist()->add_tracks(banned);
|
||||
}
|
||||
|
||||
unsigned int schedule_load()
|
||||
|
|
Loading…
Reference in New Issue