From 1e7a714a628de1cd52a143014fc63411922793cc Mon Sep 17 00:00:00 2001 From: zvon Date: Wed, 15 Jan 2020 20:10:47 +0100 Subject: [PATCH] Main: fix file_set --- main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index ab59b85..eab943e 100644 --- a/main.cpp +++ b/main.cpp @@ -275,17 +275,17 @@ int main if ( !FSLib::isDirectory( path ) && FSLib::exists( path ) ) { // specified file, not directory - auto *file_set = new std::set< string >; - file_set->insert( path ); - size_t season_pos{}; - if ( !searchSeason( path.c_str(), season_pos ) ) { + std::map< int, string > file_set{}; + size_t season_pos{}, ep_pos{}; + if ( !searchSeason( path.c_str(), season_pos, ep_pos ) ) { cerr << "Specified file does not conform to filename pattern, " << "cannot rename." << std::endl; return 1; } else { + file_set[std::stoi( path.c_str() + ep_pos )] = path; auto season = std::stoi( path.c_str() + season_pos ); singleSeason( path, show, season, TEXT( "" ), language, pattern, - tv_flags, file_set, true ); + tv_flags, &file_set, true ); return 0; } } else if ( !FSLib::isDirectory( path ) ) {