Needs review
Project:
Audio
Version:
5.x-1.x-dev
Component:
audio_attach
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Oct 2007 at 18:03 UTC
Updated:
24 Oct 2007 at 22:37 UTC
Jump to comment: Most recent file
Comments
Comment #1
James Andres commentedHad a bug in my original patch, please use this one.
Comment #2
zirafa commentedSounds interesting. What are some potential use cases for this?
Comment #3
James Andres commentedHi zirafa,
I'm really just scratching my own itch, but I thought the patch might be useful to a few other people. Also, I'm getting tired of writing proprietary code and keeping all the useful bits locked away (even though most clients don't mind us releasing bits of code GPL :-). But enough ranting..
The use-case I'm working with is userpoints-esq, as I mentioned above. I can't go into further detail, unfortunately, due to NDA constraints.
This patch is a useful addition purely on the basis that it fits squarely within the Drupal hook philosophy and hardly impacts performance (the attach/remove child/parent functions are only called when users save playlists ... which happens very infrequently, compared to page views).
I should probably also mention there is a much better way to implement this patch. However it's a bit invasive :-D, what I think would be better in the long run is to restructure the audio_attach module to be based on the insert/update hooks. For instance, when the audio_playlist module want's to add a new track to a playlist it should modify the
$node->audio_attacharray and callnode_save(). Then the audio_attach module should catch the save $op and re-save the modified list. In my opinion this would be a better long-term approach. Also, if audio_attach were structured in this way my patch wouldn't be needed, since I could just catch the update and insert ops, along with every other module that wished to do so.Cheers,
James.