Fix tag editor not changing tags and can now select multiple items at once.

This commit is contained in:
apoorv569
2021-04-08 00:21:00 +05:30
parent 5c11792df1
commit e38fef36de
4 changed files with 171 additions and 31 deletions
+7 -4
View File
@@ -214,9 +214,8 @@ void TagEditor::OnClickApply(wxCommandEvent& event)
wxString genre = m_GenreText->GetValue();
wxString comment = m_CommentText->GetValue();
wxString type = m_SampleTypeChoice->GetStringSelection();
wxString filename = wxString(m_Filename).AfterLast('/').BeforeLast('.');
std::string sampleType = db.GetSampleType(filename.ToStdString());
std::string sampleType = db.GetSampleType(m_Filename);
wxString warning_msg = "Are you sure you want save these changes?";
wxMessageDialog* msgDialog = new wxMessageDialog(this, warning_msg,
@@ -244,6 +243,10 @@ void TagEditor::OnClickApply(wxCommandEvent& event)
wxLogDebug("Changing artist tag..");
tags.SetArtist(artist.ToStdString());
db.UpdateSamplePack(m_Filename, artist.ToStdString());
wxLogDebug("SAMPLE FILENAME HERE: %s", m_Filename);
info_msg = wxString::Format("Successfully changed artist tag to %s", artist);
}
@@ -274,7 +277,7 @@ void TagEditor::OnClickApply(wxCommandEvent& event)
if (m_SampleTypeCheck->GetValue() && m_SampleTypeChoice->GetStringSelection() != sampleType)
{
wxLogDebug("Changing type tag..");
db.UpdateSampleType(filename.ToStdString(), type.ToStdString());
db.UpdateSampleType(m_Filename, type.ToStdString());
info_msg = wxString::Format("Successfully changed type tag to %s", type);
}
@@ -282,7 +285,7 @@ void TagEditor::OnClickApply(wxCommandEvent& event)
case wxID_NO:
break;
default:
return;
info_msg = "Error, cannot change tag!";
}
m_InfoBar.ShowMessage(info_msg, wxICON_INFORMATION);