AlbumCoverLoader: Remove slash and backslash from cover filename

Fixes #903
This commit is contained in:
Jonas Kvinge 2022-02-21 20:20:02 +01:00
parent 3608c31d22
commit ff3db03696
1 changed files with 3 additions and 3 deletions

View File

@ -106,8 +106,8 @@ void AlbumCoverLoader::ReloadSettings() {
QString AlbumCoverLoader::AlbumCoverFilename(QString artist, QString album, const QString &extension) {
artist.remove('/');
album.remove('/');
artist.remove('/').remove("\\");
album.remove('/').remove("\\");
QString filename = artist + "-" + album;
filename = Utilities::UnicodeToAscii(filename.toLower());
@ -157,7 +157,7 @@ QString AlbumCoverLoader::CoverFilePath(const Song::Source source, const QString
save_cover_filename_ == CollectionSettingsPage::SaveCoverFilename_Pattern &&
!cover_pattern_.isEmpty()) {
filename = CoverFilenameFromVariable(artist, album);
filename.remove(OrganizeFormat::kInvalidFatCharacters);
filename.remove(OrganizeFormat::kInvalidFatCharacters).remove('/').remove("\\");
if (cover_lowercase_) filename = filename.toLower();
if (cover_replace_spaces_) filename.replace(QRegularExpression("\\s"), "-");
if (!extension.isEmpty()) {