aboutsummaryrefslogtreecommitdiffstats
path: root/src/SongUpdate.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/SongUpdate.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx
index 1e1bb2ff5..fd4aa6751 100644
--- a/src/SongUpdate.cxx
+++ b/src/SongUpdate.cxx
@@ -32,6 +32,7 @@
#include "tag/TagId3.hxx"
#include "tag/ApeTag.hxx"
#include "TagFile.hxx"
+#include "TagStream.hxx"
#include <assert.h>
#include <string.h>
@@ -119,12 +120,15 @@ Song::UpdateFileInArchive()
if (!decoder_plugins_supports_suffix(suffix))
return false;
- delete tag;
+ const auto path_fs = map_song_fs(*this);
+ if (path_fs.IsNull())
+ return false;
- //accept every file that has music suffix
- //because we don't support tag reading through
- //input streams
- tag = new Tag();
+ TagBuilder tag_builder;
+ if (!tag_stream_scan(path_fs.c_str(), full_tag_handler, &tag_builder))
+ return false;
+ delete tag;
+ tag = tag_builder.Commit();
return true;
}