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