Fix possible error when adding to database
This commit is contained in:
parent
dac1ccc6c4
commit
fda181edea
@ -137,7 +137,7 @@ void DatabaseWindow::save() {
|
||||
auto *pw = new ProgressWindow;
|
||||
app->add_window( *pw );
|
||||
|
||||
t = std::thread( refreshSelectDB, std::ref( changed_rows ), linux, pw );
|
||||
t = std::thread( refreshSelectDB, changed_rows, linux, pw );
|
||||
t.detach();
|
||||
|
||||
// lambda capture
|
||||
|
@ -434,12 +434,12 @@ void prepareDB( const string &_pattern ) {
|
||||
}
|
||||
|
||||
#ifndef GUI
|
||||
void addToDB( string &show, const string &path, const string &language,
|
||||
void addToDB( const string &show, const string &path, const string &language,
|
||||
bool linux, bool dvd ) {
|
||||
if ( !FSLib::exists( getDBName() ) )
|
||||
prepareDB();
|
||||
#else
|
||||
void addToDB( string &show, const string &path, const string &language,
|
||||
void addToDB( const string &show, const string &path, const string &language,
|
||||
const string &id, const string &pattern, bool linux, bool dvd,
|
||||
void *progress_ptr ) {
|
||||
if ( !FSLib::exists( getDBName() ) )
|
||||
@ -834,7 +834,7 @@ void changeDB( size_t index, const string &path, const string &language,
|
||||
}
|
||||
|
||||
#ifdef GUI
|
||||
void refreshSelectDB( std::unordered_set< size_t > &indexes, bool linux,
|
||||
void refreshSelectDB( std::unordered_set< size_t > indexes, bool linux,
|
||||
void *progress_ptr ) {
|
||||
if ( !FSLib::exists( getDBName() ) )
|
||||
return;
|
||||
|
@ -43,10 +43,10 @@ string userHome();
|
||||
|
||||
void prepareDB( const string &_pattern = TEXT( "" ) );
|
||||
#ifndef GUI
|
||||
void addToDB( string &show, const string &path, const string &language,
|
||||
void addToDB( const string &show, const string &path, const string &language,
|
||||
bool linux, bool dvd );
|
||||
#else
|
||||
void addToDB( string &show, const string &path, const string &language,
|
||||
void addToDB( const string &show, const string &path, const string &language,
|
||||
const string &id, const string &pattern, bool linux, bool dvd,
|
||||
void *progress_ptr );
|
||||
std::vector< std::unordered_map< std::string, std::string > > dbGetShows();
|
||||
@ -67,7 +67,7 @@ void cleanDB();
|
||||
void changeDB( size_t index, const string &path, const string &language,
|
||||
const string &id, bool dvd );
|
||||
#ifdef GUI
|
||||
void refreshSelectDB( std::unordered_set< size_t > &indexes, bool linux,
|
||||
void refreshSelectDB( std::unordered_set< size_t > indexes, bool linux,
|
||||
void *progress_ptr );
|
||||
#endif
|
||||
|
||||
|
@ -568,8 +568,8 @@ void MainWindow::dbAdd() {
|
||||
delete pw;
|
||||
} );
|
||||
|
||||
std::thread t( addToDB, std::ref( show ), m_entry_dir->get_text(),
|
||||
std::ref( language_code ), std::ref( show_id ),
|
||||
std::thread t( addToDB, std::move( show ), m_entry_dir->get_text(),
|
||||
std::move( language_code ), std::move( show_id ),
|
||||
m_entry_pattern->get_text(), !m_check_linux->get_active(),
|
||||
m_check_dvd->get_active(), pw );
|
||||
t.detach();
|
||||
|
@ -280,7 +280,7 @@ bool authenticate( const std::string &api_key ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void singleSeason( const string &path, string &show, int season, string id,
|
||||
void singleSeason( const string &path, const string &show, int season, string id,
|
||||
const string &language, const string &pattern,
|
||||
const bool &linux, const bool &trust,
|
||||
std::map< int, string > *files_ptr, bool print, bool dvd ) {
|
||||
@ -344,7 +344,7 @@ end:
|
||||
}
|
||||
}
|
||||
|
||||
void singleSeason( const string &path, string &show, int season, string id,
|
||||
void singleSeason( const string &path, const string &show, int season, string id,
|
||||
const string &language, const string &pattern,
|
||||
const size_t &flags, std::map< int, string > *files_ptr,
|
||||
bool print ) {
|
||||
|
@ -25,13 +25,13 @@ using char_t = char;
|
||||
|
||||
#endif
|
||||
|
||||
void singleSeason( const string &path, string &show, int season, string id,
|
||||
void singleSeason( const string &path, const string &show, int season, string id,
|
||||
const string &language, const string &pattern,
|
||||
const bool &linux, const bool &trust,
|
||||
std::map< int, string > *files_ptr = nullptr,
|
||||
bool print = true, bool dvd = false );
|
||||
|
||||
void singleSeason( const string &path, string &show, int season, string id,
|
||||
void singleSeason( const string &path, const string &show, int season, string id,
|
||||
const string &language, const string &pattern,
|
||||
const size_t &flags,
|
||||
std::map< int, string > *files_ptr = nullptr,
|
||||
|
Loading…
Reference in New Issue
Block a user