Skip to content

Conversation

@jefft
Copy link
Contributor

@jefft jefft commented Oct 28, 2025

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 and Service_Component_Taggings only if they didn't already exist. So I copied the createIfNew pattern I found in Person_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:

image

The imported songs are now tagged:

image image

Detailed testing

This song CSV illustrates setting 0, 1 or 2 tags via multiple columns:

Title,Tag 1,Tag 2
Tagged Test Song 1,TagOne,
Untagged Test Song 2,,
Tagged Test Song 3,TagTwo,
Tagged Test Song 4,TagOne,TagTwo
image

Imported songs are tagged as expected:
image
image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Component Library importer should support setting tags

1 participant