Skip to content

Conversation

@jefft
Copy link
Contributor

@jefft jefft commented Sep 3, 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

@jefft jefft force-pushed the push-1262-song-csvimport-tags branch from b427954 to 3625808 Compare September 5, 2025 07:24
@jefft jefft force-pushed the push-1262-song-csvimport-tags branch 2 times, most recently from 2716c12 to 0c0bc33 Compare September 17, 2025 10:31
@jefft jefft force-pushed the push-1262-song-csvimport-tags branch from 0c0bc33 to 0bd63d9 Compare September 26, 2025 05:57
@jefft jefft force-pushed the push-1262-song-csvimport-tags branch 2 times, most recently from 2061162 to 050c144 Compare October 14, 2025 06:09
@jefft jefft force-pushed the push-1262-song-csvimport-tags branch from 050c144 to 3859897 Compare October 17, 2025 02:59
@jefft jefft closed this by deleting the head repository Oct 27, 2025
@jefft
Copy link
Contributor Author

jefft commented Oct 28, 2025

Replaced by #1341

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