parent
a41353ed03
commit
d56b76c9e3
|
@ -537,7 +537,6 @@ bool TagReader::SaveFile(const QString &filename, const pb::tagreader::SongMetad
|
||||||
fileref->tag()->setYear(song.year() <= 0 ? 0 : song.year());
|
fileref->tag()->setYear(song.year() <= 0 ? 0 : song.year());
|
||||||
fileref->tag()->setTrack(song.track() <= 0 ? 0 : song.track());
|
fileref->tag()->setTrack(song.track() <= 0 ? 0 : song.track());
|
||||||
|
|
||||||
bool saved = false;
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
if (TagLib::FLAC::File *file = dynamic_cast<TagLib::FLAC::File*>(fileref->file())) {
|
if (TagLib::FLAC::File *file = dynamic_cast<TagLib::FLAC::File*>(fileref->file())) {
|
||||||
|
@ -574,8 +573,6 @@ bool TagReader::SaveFile(const QString &filename, const pb::tagreader::SongMetad
|
||||||
SetTextFrame("TPE2", song.albumartist().empty() ? std::string() : song.albumartist(), tag);
|
SetTextFrame("TPE2", song.albumartist().empty() ? std::string() : song.albumartist(), tag);
|
||||||
SetTextFrame("TCMP", song.compilation() ? QString::number(1) : QString(), tag);
|
SetTextFrame("TCMP", song.compilation() ? QString::number(1) : QString(), tag);
|
||||||
SetUnsyncLyricsFrame(song.lyrics().empty() ? std::string() : song.lyrics(), tag);
|
SetUnsyncLyricsFrame(song.lyrics().empty() ? std::string() : song.lyrics(), tag);
|
||||||
result = file_mpeg->save(TagLib::MPEG::File::ID3v2);
|
|
||||||
saved = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (TagLib::MP4::File *file_mp4 = dynamic_cast<TagLib::MP4::File*>(fileref->file())) {
|
else if (TagLib::MP4::File *file_mp4 = dynamic_cast<TagLib::MP4::File*>(fileref->file())) {
|
||||||
|
@ -594,10 +591,7 @@ bool TagReader::SaveFile(const QString &filename, const pb::tagreader::SongMetad
|
||||||
SetVorbisComments(tag, song);
|
SetVorbisComments(tag, song);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!saved) {
|
result = fileref->save();
|
||||||
result = fileref->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
if (result) {
|
if (result) {
|
||||||
// Linux: inotify doesn't seem to notice the change to the file unless we change the timestamps as well. (this is what touch does)
|
// Linux: inotify doesn't seem to notice the change to the file unless we change the timestamps as well. (this is what touch does)
|
||||||
|
|
Loading…
Reference in New Issue