Use correct file extension in organize preview and resulting filename

Fixes #564
This commit is contained in:
Jonas Kvinge
2020-10-18 13:24:33 +02:00
parent cf17ff4478
commit 2ad1a60e59
5 changed files with 19 additions and 7 deletions

View File

@@ -108,7 +108,7 @@ bool OrganizeFormat::IsValid() const {
}
QString OrganizeFormat::GetFilenameForSong(const Song &song) const {
QString OrganizeFormat::GetFilenameForSong(const Song &song, QString extension) const {
QString filename = ParseBlock(format_, song);
@@ -144,7 +144,7 @@ QString OrganizeFormat::GetFilenameForSong(const Song &song) const {
filename = filename.simplified();
QFileInfo info(filename);
QString extension = info.suffix();
if (extension.isEmpty()) extension = info.suffix();
QString filepath;
if (!info.path().isEmpty() && info.path() != ".") {
filepath.append(info.path());