mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 03:27:40 +01:00
Replace slashes with underscores when organising files. Fixes issue #503
This commit is contained in:
parent
aba01f63c7
commit
692e5715e3
@ -144,6 +144,10 @@ QString OrganiseFormat::TagValue(const QString &tag, const Song &song) const {
|
||||
if (tag == "track" && value.length() == 1)
|
||||
value.prepend('0');
|
||||
|
||||
// Replace characters that really shouldn't be in paths
|
||||
value.replace('/', '_');
|
||||
value.replace('\\', '_');
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
@ -139,3 +139,9 @@ TEST_F(OrganiseFormatTest, TrackNumberPadding) {
|
||||
song_.set_track(0);
|
||||
EXPECT_EQ("", format_.GetFilenameForSong(song_));
|
||||
}
|
||||
|
||||
TEST_F(OrganiseFormatTest, ReplaceSlashes) {
|
||||
format_.set_format("%title");
|
||||
song_.set_title("foo/bar\\baz");
|
||||
EXPECT_EQ("foo_bar_baz", format_.GetFilenameForSong(song_));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user