Directory: use Song::Export()
This commit is contained in:
parent
f5ae1ce00b
commit
a506adea41
@ -252,20 +252,6 @@ Directory::Sort()
|
|||||||
child->Sort();
|
child->Sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
static LightSong
|
|
||||||
ExportSong(const Song &src)
|
|
||||||
{
|
|
||||||
LightSong dest;
|
|
||||||
dest.directory = src.parent->IsRoot()
|
|
||||||
? nullptr : src.parent->GetPath();
|
|
||||||
dest.uri = src.uri;
|
|
||||||
dest.tag = &src.tag;
|
|
||||||
dest.mtime = src.mtime;
|
|
||||||
dest.start_ms = src.start_ms;
|
|
||||||
dest.end_ms = src.end_ms;
|
|
||||||
return dest;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Directory::Walk(bool recursive, const SongFilter *filter,
|
Directory::Walk(bool recursive, const SongFilter *filter,
|
||||||
VisitDirectory visit_directory, VisitSong visit_song,
|
VisitDirectory visit_directory, VisitSong visit_song,
|
||||||
@ -277,7 +263,7 @@ Directory::Walk(bool recursive, const SongFilter *filter,
|
|||||||
if (visit_song) {
|
if (visit_song) {
|
||||||
Song *song;
|
Song *song;
|
||||||
directory_for_each_song(song, *this) {
|
directory_for_each_song(song, *this) {
|
||||||
const LightSong song2 = ExportSong(*song);
|
const LightSong song2 = song->Export();
|
||||||
if ((filter == nullptr || filter->Match(song2)) &&
|
if ((filter == nullptr || filter->Match(song2)) &&
|
||||||
!visit_song(song2, error))
|
!visit_song(song2, error))
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user