Fix replacing windows-illegal characters (I have no idea how it worked till now)

This commit is contained in:
zvon 2019-01-24 16:37:25 +01:00
parent 72706a5c0e
commit 4c8922b619

View File

@ -123,7 +123,7 @@ void singleSeason( const std::string &path, const std::string &show, int season,
auto name = compilePattern(pattern, season, num+1, og_name.substr(0, pos), episodes[num], show) + og_name.substr(pos); auto name = compilePattern(pattern, season, num+1, og_name.substr(0, pos), episodes[num], show) + og_name.substr(pos);
// replace characters illegal in windows if desired // replace characters illegal in windows if desired
if( !linux ) { if( !linux ) {
season_code.erase(std::remove_if(name.begin(), name.end(), [](char x) {return x == '?' || x == '"' || x == '\\' || x == '|' || x == '*';}), season_code.end()); name.erase(std::remove_if(name.begin(), name.end(), [](char x) {return x == '?' || x == '"' || x == '\\' || x == '|' || x == '*';}), name.end());
size_t max{name.size()}; size_t max{name.size()};
for( size_t i = 0; i < max ; i++ ) { for( size_t i = 0; i < max ; i++ ) {
if( name[i] == '<' ) { if( name[i] == '<' ) {