MP3 Shop / Download previews

Posts: 88
Joined: 01/02/2008
Bug Finder

1st post Smiling

I've been researching for a little while now and it seems that there is a fair amount of demand for MP3 shops (well at least i have a client who wants one), while both e-commerce and ubercart support file downloads (still both implementations are a little clunky, e.g. you cant upload at product creation) i haven't yet found a nice way to generate previews - 30 second clips for customers to try before they buy.

I spoke with Ryan who's pointed me in the right direction on a few bits, so i am going to forge ahead.

My key points for a basic MP3 shop are.

* File (mp3) products - well thats a given.

* MP3 preview (perhaps automatic) of say 30 seconds.
Ryan said : "My immediate thoughts are that your best bet would be to use either custom code or an existing app for the preview..." - Sounds about right to me.

* Album grouping, allowing for album or single track purchase.
Ryan said : "your best bet is going to be to offer full album products and individual track products. You can use CCK to add node references on the track products to the full album product." - Right!

* (ideal, but not required) Multi format options, like sub products, but selecting say WMA, MP3 or WAV
Ryan said : "For selecting format, I'd use the attribute module and add a format attribute to your downloads. The options would be the different formats, and I'd append the format type on the end of the SKU, like -MP3 or something. Based on the SKU, you can unlock a different download upon purchase, which is exactly what you need." - Cool !

So i guess i wanted say hi and that i'm headed down this path over the next week and will try to keep you updated on the progress - so any ideas other people in the community might have on where to take it / how to do it are very welcome.

Drayen.

Posts: 332
Joined: 08/07/2007
Administrator

Here's a few comments I have:

*Uploading of Files With the uc_file I wanted to keep file management to a minimum. Thus, I only added 2 operations possible @ admin/store/products/files, deleting and uploading. For a large amount of files, I figured admins would prefer uploading directly to file directory rather than using forms. After uploading, admins will see these new files show up in autocomplete file field when adding a file download feature.

*Album and Format Grouping If your file download directory has album MP3s placed in their own separate directories, you can specify the directory in the file field. This will allow customers to download all files in the specified directory. Using attribute adjustments, you can create a file download for an album directory and individual tracks that correspond with the SKU for the entire album as well as individual tracks. Mutli-format albums would work similarly to this method.

*MP3 Preview uc_file has a build in hook that would allow you to do this with some custom code. Using the hook, hook_file_action, you can add a new action to the file manager @ admin/store/products/files. In your case you could create an action "Create MP3 preview". Using the hook, it could open an MP3 file and copy the first 30 seconds of data to a file in Drupal's public directory.

--

-Shawn Conn: If the Name Don't Rhyme It Ain't Mine

Posts: 88
Joined: 01/02/2008
Bug Finder

Thanks Shawn,

The album stuff is very interesting, i like the idea of doing it that way. Your uploading files description makes sense, i expect the client will upload via ftp and doing the preview bit via the hook_file_action, not fully dug into it yet, but i assume there would be a way to have this generate preview on demand e.g. if the file has been uploaded via ftp.

Will be digging into this more today, around on #drupal and #drupal-support if your about fire me a msg Smiling

Posts: 332
Joined: 08/07/2007
Administrator

You know, I hadn't thought of that. I've just committed to bazaar an addition to hook_file_action that allows for a $op == 'insert' that fires just after a new file has been inserted into the uc_file table. This will allow for previews to be generated automatically. See the API page above for reference.

--

-Shawn Conn: If the Name Don't Rhyme It Ain't Mine

Posts: 88
Joined: 01/02/2008
Bug Finder

Cool! Yeah i think thats a very nice addition.

I've in fact taken another route for now, as the client wanted to see something asap (but we may revert to the auto-generated method). Here is what i've done so far.

2 new content types, made into products.

* product_track
- title
- body
- audio CCK (for preview)
- attribute for MP3/WMA/OGG etc

* product_album
- title
- body
- image
- node reference (multi) for track listing

At this stage the main 2 obvious problems facing me are :
- node reference just shows a text link, not a teaser / preview + add to cart link => fixable with theming i think
- node reference only giving 3 auto complete boxes by default, so you need 3 or 4 page refreshes to put a full album list together. => not sure how to fix this... anyone?

While thinking about this, i noticed that this CCK node reference solution could be a very nice way to offer complementary products on other shops. e.g. linking mp3 player to new head phones etc...

I did consider using CCK view reference, but it wouldn't have been able to give me the control over the track listing order that i would need.

As always i'm in #drupal / #drupal-support / #drupal-dojo if anyone has any bright ideas how to fix my 2 problems.

Drayen.

Posts: 88
Joined: 01/02/2008
Bug Finder

so im a bit further forward, i chatted with a few of the folks on #drupal about this and brenda003 came up with the suggestion of using http://drupal.org/project/relativity to link nodes together, which is perfect really. Teaser view, easy linking of products together - very very good.

The only thing it doesn't do, is allow re-ordering of the related nodes, but i think thats only a bounty away.

The site is moving forwards very fast now!

Posts: 14
Joined: 10/07/2007

Hi Drayen

I am in the progress of making a record shop for my own label as well, very nice to read about your development, please keep on writing, I will ad stuff if I find out something that can help.
As soon as you have a site link that I/we can look at and comment please post it.

Keep posting Smiling
/August

Posts: 88
Joined: 01/02/2008
Bug Finder

Will do, just demo'ed the site to the client. They were very impressed Smiling I have it running on my laptop (accessible via dyndns) but don't really want to put the URL out there for crawlers to grab.

If you want to see it please come onto #drupal and message me, i would be happy to show it to you.

I've just put up a bounty for a feature on the relativity module http://drupal.org/node/206236 which will sort out my remaining issues with it (ordering and problems when the catalog gets large). If you can spare some cash please pledge a bit to see if we can get this development sorted. ** someone else just matched my $50 bounty!!

Posts: 88
Joined: 01/02/2008
Bug Finder

So heres the idea, users buy a subscription to say "hot tracks" that gives them the "hot tracks subscriber" role, then once a week (say Friday 3pm) the system will automate the purchase of all products with the "hot track" tax term added in the last week for free (the products are normally chargeable).

The role 4 purchase thing is easy (thanks for that), the automated purchase i was figuring on writing my own module to deal with that with a cron hook. The only bit i'm unsure of is having a 0 price on the transaction, i was thinking the discount module might be a way to go (http://www.ubercart.org/contrib/143), but if its being fired off from a module - might it just be faster/simpler another way?

Thanks

Drayen

Posts: 45
Joined: 12/24/2007

I also wnat to create a big mp3-shop - now i collect different ideas.
I think - it will be good to create "MP3-shop" installing profile for drupal

Posts: 1
Joined: 03/01/2008

I'm actually heading down the same path myself.

I've messed around with setting up albums as a product kits and individual songs as products. Since it appears that the product kit prices are the total of the products included I've just priced them so that they add up to the desired total. I then set the kit so that it can only be bought as a unit. It's a little clunky, but it should get the job done.

I'm looking for a good way to tag the albums and songs with artist info so that they're easily searchable

Posts: 88
Joined: 01/02/2008
Bug Finder

Buy using relativity you get to set the price (and have a single zip) for the album product, it also means from a track you can have a link back to its parent album.

For tagging taxonomy comes in handy - i set up several fields, artist, year, genre, style and record label.

Posts: 25
Joined: 12/19/2007

drayen@drupal.org wrote:
I've just put up a bounty for a feature on the relativity module http://drupal.org/node/206236 which will sort out my remaining issues with it (ordering and problems when the catalog gets large). If you can spare some cash please pledge a bit to see if we can get this development sorted. ** someone else just matched my $50 bounty!!

Thanks for your notes here on getting this set up -- it's been very useful as I've been also setting up a CD shop. In regards to sorting the output of relativity, I discovered you don't need a bounty, the ability is already there! Under node relativity display settings (admin/settings/relativity/display) there is the rendering option for children nodes. And since you can use a view as the rendering option you have all the sort power of views at your fingertips.

An example view that I created for my track previews has the following: Page View enabled in Table mode, Fields of Title and Audio player, Filters is Published and Node type, Arguments is "Relativity: Parent Node ID" (this is the really important one!), Sort is "Product: List order". Works like a charm.

Posts: 88
Joined: 01/02/2008
Bug Finder

That is a work around for the track ordering problem, but not a perfect solution, there may be cases where a given track is part of 2 or more "albums" and wants to be the first track on one, and the last on another.

It doesn't cover the large data set problem.


2. I am a little concerned about the adding existing nodes method, when the site has a full catalog of tracks (say 2000) that add screen is going to get very full, perhaps an auto-complete field here instead? Similar request to http://drupal.org/node/132082

Glad you liked the thread, did you find any other hints / tips? I'm in #ubercart quite a bit, drop in and say hi Smiling

I have a few more bits to do on the site, but hope to have it live sometime this month... will post a link once its live.

Posts: 12
Joined: 03/22/2008

working on a similar project however i do not need access to a truncated/split audio preview.

the previews are allowed to be the same file as the downloads. is there a way to allow a visitor to listen to the files in /downloads/band/album/*.mp3s?

i would like to have the XSPF player (button) as a CCK field/link to the mp3?

so in the table it would be: mp3-player-button/link associated with download....track #...title...etc

help?

the XSPF player is here http://musicplayer.sourceforge.net/

Posts: 88
Joined: 01/02/2008
Bug Finder

Dr wits, you might want to think about that a little. If they can play the track, they can download it - without paying for it.

For the player i used the "1 pixel out" player which is really easy to get working with the CCK fields.

Posts: 12
Joined: 03/22/2008

drayen how did you get the audio player to work with the cck field? you use that audio module?

perhaps i can embed the player in a link field?

sorry i'm away from home/drupal/test-server... so i'm just trying to load my brain before i get back to working on the site tomorrow.

thanks for your help

while i'm at it... it seems from reading these forums that it would be best to keep a different sku for the hard-copies vs mp3-versions?
something like LABEL-001 and LABEL-001-MP3? can anybody foresee a problem with this method?

Posts: 1315
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

That's how I would do it - keep the SKUs as separate adjustments. That way you can decide whether or not to separate the mp3 download from the product. You'll have the option to allow purchase of both the mp3 when the hard-copy is purchased, or force them to purchase one of the options (and keep the hard copy separate from the mp3 version). Hope that makes sense.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 3
Joined: 07/13/2008

I'm on the path of doing the same thing here. I've got quite a way on my project.
So I've set up the audio files as Product, Albums as Product Kit. I've added a computed field to the Product Kit that displays a view of Products referencing to the kit, using nodereference. This gives me a nice display of all the individual audio files belonging to an album, with the 1pixelout player for the 30-second samples I've added and a direct button for "add to cart" for the individual tracks.
I've also created a genre view using views bonus pack Grid view. This displays up to 16 albums in a grid, showing their covers in an ImageCached fashion, sorted by publishing year. Very nice overview.

I've also added a content type Band, with each product kit referencing to an artist. Using the same method for showing audio tracks for albums, I can display a list of albums this artist has produced. Views+nodereference+cck is extremely powerful.

Instead of using taxonomy for labels, I've made a content type for them. This allows me to display all the albums that have referenced to a specific label, inside the label's node.

One feature I still want to enable is to create a playlist of all the mp3-files purchased, and send this playlist to a flash-player, preferably in a popup screen, to have a playlist of all purchased media and play it while surfing the site (or any other site..).