Jump to:

3448 Posts in 1062 Topics by 738 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Create Dataobjects from folder contents and pull ID3 tags in db

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1478 Views
  • Howard
    Avatar
    Community Member
    215 Posts

    Create Dataobjects from folder contents and pull ID3 tags in db Link to this post

    Hi there,

    This is a tricky problem that I am facing for my churches website. They currently have a site that is built pretty much in HTML with a little php thrown in so I'm moving it all to SS. We want to podcast each weeks message so I'll create a dataobject for each message and attach a file to it. That I will be able to handle but ideally I would write a function that looks at a folder and creates a dataobject for any files in the folder that arn't currently associated with a dataobject. I imagine this is similar to how the AssetAdmin does this but I'm not sure where to start.

    As a second issue ideally I would be able to pull the ID3 tags from the audio files into the fields in the dataobject, ie pull in the Artist, Album etc...

    Any ideas - even just a point in the right direction?

    Thanks

  • joshy
    Avatar
    Community Member
    57 Posts

    Re: Create Dataobjects from folder contents and pull ID3 tags in db Link to this post

    Hiya,

    To push a new item into an existing DataObjectSet you'll need to $do->push() it in. What you will have to do in reality is create a completely new one and then merge the two.

    In terms of ID3, http://getid3.sourceforge.net/ and http://us3.php.net/manual/en/book.id3.php will help you there.

    Cheers,

    Josh

    1478 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.