I'm working on a WP plugin called WP SoundSystem. It's a plugin designed to run on a "music" website : it handles artists, tracks, albums, playlists... through custom post types and tools. You can see it running on Spiff Radio.
When I publish a new playlist, my function checks every track row from the tracklist and either create a new track post; or returns the ID of the existing track post if it exists (I have a function that checks for the same artist + title + album post metas). Then a list of track IDs is stored as a post meta of the tracklist post.
I designed it like that because I guess it would be a bad idea to add the same track several times; but should better have ONE track with the most accurate informations possible (featured image, audio sources links, etc).
But this brings another problem. I would like to add user-oriented functions to my plugin, among which the ability to create new playlists frontend and/or to add tracks to their existing playlists.
But then, what about the track posts ?
- What if user A adds a track from user B to its playlist; but that user B deletes the track afterwards ? Or something like that ?
- Should I remove the delete_post capability for those users ?
- Should I "transfer" the ownership of the track to user A instead of deleting the post ?
- Who can edit that track post ?
As you can see, I'm hesitant about the way I store tracks, capabilities I should give to my users, and the way this works.
Or maybe that, instead of storing a list of track IDs for a playlist; I should store a list of track datas (artist+title+album) ?
Have you got any advices on this ? Thanks !