mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-31 09:44:50 +01:00
Only append path if not empty
This commit is contained in:
parent
ffd2e2188a
commit
3a0d59e66f
@ -115,7 +115,15 @@ QString OrganizeFormat::GetFilenameForSong(const Song &song, QString extension)
|
||||
if (QFileInfo(filename).completeBaseName().isEmpty()) {
|
||||
// Avoid having empty filenames, or filenames with extension only: in this case, keep the original filename.
|
||||
// We remove the extension from "filename" if it exists, as song.basefilename() also contains the extension.
|
||||
filename = QFileInfo(filename).path() + "/" + song.basefilename();
|
||||
QString path = QFileInfo(filename).path();
|
||||
filename.clear();
|
||||
if (!path.isEmpty()) {
|
||||
filename.append(path);
|
||||
if (path.right(1) != '/' && path.right(1) != '\\') {
|
||||
filename.append('/');
|
||||
}
|
||||
}
|
||||
filename.append(song.basefilename());
|
||||
}
|
||||
|
||||
if (remove_problematic_) filename = filename.remove(kProblematicCharacters);
|
||||
|
Loading…
x
Reference in New Issue
Block a user