Support setting tags on songs imported from CSV #1341
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1262. Adds support for setting song tags from CSV, via new column(s).
Code notes
In the code, I needed to create
Service_Component_Tags andService_Component_Taggings only if they didn't already exist. So I copied thecreateIfNewpattern I found inPerson_Note.createIfNew()is a candidate for being moved up to DB_Object. For that to work, there would need to be a way for each object to tell it "which of my columns are unique". Possibly we could use_getUniqueKeys()(currently only used for FK creation). Anyway, this is a bigger refactoring I didn't tackle.Testing
Sample file
For basic testing, go to Services -> Component Library -> Import, and download the Sample file:
The imported songs are now tagged:
Detailed testing
This song CSV illustrates setting 0, 1 or 2 tags via multiple columns:
Imported songs are tagged as expected:



