Main: fix file_set

This commit is contained in:
zvon 2020-01-15 20:10:47 +01:00
parent 5b38547fe3
commit 1e7a714a62

View File

@ -275,17 +275,17 @@ int main
if ( !FSLib::isDirectory( path ) && FSLib::exists( path ) ) { if ( !FSLib::isDirectory( path ) && FSLib::exists( path ) ) {
// specified file, not directory // specified file, not directory
auto *file_set = new std::set< string >; std::map< int, string > file_set{};
file_set->insert( path ); size_t season_pos{}, ep_pos{};
size_t season_pos{}; if ( !searchSeason( path.c_str(), season_pos, ep_pos ) ) {
if ( !searchSeason( path.c_str(), season_pos ) ) {
cerr << "Specified file does not conform to filename pattern, " cerr << "Specified file does not conform to filename pattern, "
<< "cannot rename." << std::endl; << "cannot rename." << std::endl;
return 1; return 1;
} else { } else {
file_set[std::stoi( path.c_str() + ep_pos )] = path;
auto season = std::stoi( path.c_str() + season_pos ); auto season = std::stoi( path.c_str() + season_pos );
singleSeason( path, show, season, TEXT( "" ), language, pattern, singleSeason( path, show, season, TEXT( "" ), language, pattern,
tv_flags, file_set, true ); tv_flags, &file_set, true );
return 0; return 0;
} }
} else if ( !FSLib::isDirectory( path ) ) { } else if ( !FSLib::isDirectory( path ) ) {