Closed (fixed)
Project:
Audio
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
2 Dec 2005 at 09:12 UTC
Updated:
24 Mar 2006 at 09:15 UTC
Jump to comment: Most recent file
Was wondering if this module could be enhanced/changed to use the filemanager API to manage all the audio files. I think, this gives the administrator a greater flexibility to manage various kinds of files on the filesystem... and also plan for the diskspace.
| Comment | File | Size | Author |
|---|---|---|---|
| #58 | getid3.zip | 358.28 KB | drewish |
| #15 | audio.db_fetch_object.patch | 914 bytes | toemaz |
| #4 | audio.theme | 2.43 KB | drewish |
| #3 | audio.mysql | 770 bytes | drewish |
| #2 | audio.module | 32.14 KB | drewish |
Comments
Comment #1
drewish commentedHere's a patch, based on my forms api update (http://drupal.org/node/38880), that uses filemanager as a backend. I started working on it but got busy on other stuff so I don't really rememeber what works and what doesn't. I'll put it up here as a starting point.
Comment #2
drewish commentedWell I've got a big chunk of it working. The previewing works and the ID3 tags are read and written correctly.
It's getting close to a full rewrite so I won't bother with a patch (the patch is bigger than the module).
The database table is different so I changed the name, it'll probably get changed again so don't put in anything you're concerned about ;)
Comment #3
drewish commentedhere's the db
Comment #4
drewish commentedand here's a file with the themes in it. i got sick of them being in the way.
Comment #5
q0rban commentedwow.. this is a great idea.. look forward to trying it out! thanks for all your work on this drewish....
Comment #6
q0rban commentedhmmm... i don't know... for some reason when you said filemanager.module i was thinking upload.module... i've yet to use the filemanager module, so I'm trying it out now on 4.7.beta2....
a few concerns:
what happened to the flash play button?
when i click on play i receive this error:
Comment #7
drewish commentedq0rban, i haven't looked at any of the flash stuff yet.
i think the streaming stuff may be borkd too. i've got some patches for the filemanager module that need to get commited. i may just fork a copy and put it up in a sandbox.
Comment #8
drewish commentedI've put the module in progress up in my sandbox: http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/drewish/audio/
Feedback is very welcome.
Comment #9
drewish commentedI've made quite a few improvements to the branch of the audio module in my sandbox.
One thing I'm pretty happy with is the ability to browse for audio by ID3 tags. You try it out on a website I'm working on: http://131.252.78.131:8080/audio/by/
Comment #10
Colin Brumelle commentedBrowsing by ID3 tags is sweet! Great looking site BTW...
Comment #11
boris mann commentedWhile filemanager may offer interesting functionality, I have two concerns:
1. Audio is not complex enough to have to depend on anything other than core functionality
2. Why don't you just submit patches against the core File API rather than depending on a contrib module?
The File API is definitely in need of some work. Let's make core that mutch better and move things forward for everyone.
And drewish...thanks for all the awesome work you've put into audio.module.
Comment #12
drewish commentedI think it's right to question the use of the filemanager module. The two things that made the decision for me were:
The upload module may be able to do both of these when I made the choice, I either couldn't figure it out, or it wasn't do-able.
I'd really like to see some changes made to the upload module but I'm probably not the one to do it ;) That, and I wanted to get the module working for a site I'm buillding. I didn't/don't have time to do the politicking needed to get the major changes made in 4.7 that upload would need. I know that Ber has talked about a "betterupload" module that builds on the improvements in filemanager. It seems like it's still in the planning stages but it looks very promising.
Comment #13
drewish commentedI'm thinking about changing the way the node's title is handled. I'd like to have it generated from the file's metatdata. Perhaps using a setting that's passed to t() so the admin can choose the what will be used to construct the title.
Does anyone have any thoughs on this? How do people use the title field?
Comment #14
q0rban commentedI know we've discussed this before, but I think it makes sense to have a seperate field for the title... The audio file is still basically an attachment to a node, so It makes the audio node type much more versatile... Having it automatically set the title from the metadata, although it may save a step, takes away some of the flexibility of the audio.module IMO...
The real question is, are we willing to answer all the support topics entitled "How do I change the title of an audio node?"
Or, maybe there's another way... Can we create a way to attach audio to other content types, for instance a 'page'? or even giving users the ability to attach audio files to forum posts.. wow, that would be awesome.. that way you can create any node that has the audio file, metadata, and flash player attached to it. If a user were to create an audio node, it will fill all the fields from the metadata (including the title), but other node types (obviously) have user submitted title fields... I don't know if there are hooks for this or not...
cheers
Comment #15
toemaz commentedHi drewish,
I'm glad I read your issue this morning. I was actually planning to do the same thing: use filemanager with the audio module. So, I'm on board to test the audio fork in your sandbox!
I'm testing on a LAMP (php 4.11) and Drupal 4.7 beta 3.
Yet, I had already one minor (php version related) bug which I made a patch for (see attached).
Comment #16
toemaz commentedDrewish,
Is it possible to commit your audio table structure in your sandbox or post it? It seems you latest sandbox audio module is not compliant with the audio.mysql file you posted earlier in this issue.
Thx
Comment #17
drewish commentedq0rban, you talked me into what's probably the best of both worlds. I just checked in a whole mess of code. The big new feature is that the titles can now use the meta data as variables like "%title by %artist". You can set the default title in admin/settings/audio. But, if you just want to type in a title you can do that.
On your second point of letting other nodes encapsulate the audio node, I'd like to keep that in mind but I think it'll probably happen when a more generic upload/attachment module is built. Perhaps it'll be Ber's betterupload module.
toemaz, sorry, that .mysql file is pretty old. the easiest thing to do is drop those tables and then use update.php to install and upgrade the tables (i think i added docs for it in the INSTALL.txt file). Thanks, for the patch but I ended up deleting the code you'd fixed. I found the redirect when there was just a single node confusing.
Comment #18
toemaz commentedOk, thx for the tip. It worked well.
Comment #19
toemaz commentedbugreport for drewish sandbox module:
In your menu hook, this item doesn't work
$items[] = array(
'path' => 'audio/user', 'title' => t("user's audio files"),
'access' => user_access('access content'),
'type' => MENU_NORMAL_ITEM,
'callback' => 'audio_page_user');
Or you want to change it into
'path' => 'audio/user/'.$user->uid, 'title' => t("my audio files"),
Or I don't know what the reason is for the menu item
Comment #20
q0rban commentedAlso, when editing existing audio files, the title gets replaced with the following:
audio_default_title_formatunder '#default_value', should the FALSE state be a call to the
variable_get()function? Not sure why$node->title_formatis evaluating as FALSE anyways, unless it's set as nothing ('')cheers
Comment #21
q0rban commentedI also receive the following error when submitting new audio or editing existing audio:
Comment #22
toemaz commentedcfr. previous bug: I reproduced the same fault.
Comment #23
drewish commentedtoemaz, that audio/user path isn't working right now. I want to try to move the user pages and feeds into a separate menu item. If you've got any ideas I'd like to hear them. I've committed the other patches you sent.
q0rban, thanks for pointing that out, I'd only half finished the change. It's fixed. Also, if you figure out anything about setting the flash button's background color let me know.
Regarding the "Bad arguments. in /modules/audio/getid3/write.php on line 465." warnings. That's a bug in the getID3 package. Rather than checking if there's values for the ID3v1 tags, just just try to suppress the warnings. I'll open a bug on their site when I get a chance.
Thanks for the feedback, please keep it coming.
Comment #24
drewish commentedOne additional datapoint on the whole filemanager dependency issue. Based on this posting, it looks like filemanger is one of the most popular Drupal 4.6 modules. That'd make it much less of a burden for lots of sites.
Comment #25
drewish commentedJust a follow up on #21 and #22, I've posted a bug report and patch the getID3. I expect that it'll be included in the 1.7.6 release.
Comment #26
drewish commentedSorry, one more post. Wanted to mention a couple of other things:
Comment #27
toemaz commentedVery nice. Be sure you don't push it to far ;-) Better to have a nice stable release...
I'm following your updates!
Comment #28
q0rban commentedThis is all awesome...
Comment #29
toemaz commentedWhen right clicking on the 'download audio file' link and save the link location, the saved filename is 'download audio file.htm'.
Changing the extension to mp3 (if it is an mp3 file), solves the problem if you want to open it locally.
But, is there no solution to push another filename? Through the header somehow? (I remember this should be possible, but it has been some time ago). Since you are using the filemanager, this issue is perhaps a filemanager issue.
Comment #30
Colin Brumelle commented"The button itself accepts parameters for the colors during various states (somthigg like playing, stopped, downloading, etc), I want to make it easier for themes to specify these colors."
Can we tie this into the style sheet perhaps? I think that is the best place for color parameters... Maybe just pick off the same color as whatever parent element the flash player is sitting in? I can't imagine why anyone would ever want to see a different colored ugly box around their player, and I can't wait to get rid of the box!
Comment #31
drewish commented[I had a nice response all written up but Drupal though it was an XSS attack and discarded my preview. That'll teach me not to copy and paste.]
All it takes to get rid of the white box is adding
< param name="wmode" value="transparent" / >to the player's <object> element. We can commit this to 4.6 if you'd like.In regards to the button coloring. The colors are specified either in the parameters.as file or in the URL passed to the player. The parameters are:
I don't think we'll be able to pull these values from a style sheet. My thought was that a theme could override theme_audio_mp3_player() and then call it and pass in the colors that they it would like to use.
Comment #32
metapunk commentedI was trying to use this module but it wouldn't recognize the uploaded file.
It just gave the error: A file must be provided.
Acidfree works to upload pictures but this is not working at all. Anyone have any suggestions ?
Comment #33
q0rban commentedMy only guess would be to try using the filemanager.module in drewish's sandbox... I think he has some patches on the clean version..
Comment #34
drewish commentedmetapunk, most everything (besides the streaming) should work with the HEAD version of filemanager. Older versions may not work.
Make sure you've got the current version of Drupal, filemanager from HEAD or my sandbox and the audio module from my sandbox.
If you're still having problems with it, please contact me via my user profile.
Comment #35
drewish commentedOkay, it looks like metapunk's problems may be related to PHP's upload_max_filesize and post_max_size variables. Both of these limit the sizes of file uploads. I'm going to try to add some code the audio form to print these limits.
Oh, one other thing. I added calls to db_rewrite_sql() in the browsing code so now permissions will be honored, i.e. you won't see meta data for nodes you can't view.
Comment #36
drewish commentedThe description of the upload button now displays the maximum allowed upload.
Comment #37
q0rban commentedMaybe filemanager should display that under any upload button, instead of just the audio module... Or is that not possible?
cheers...
Comment #38
drewish commentedfilemanager doesn't really provide the upload code, it just handles keeping track of files and the space they take up. i the code to compute the maximum upload really seems like something that should be in core some place.
Comment #39
drewish commentedI'm thinking that the node teaser needs to be reworked. The default of (roughly) %title by %artist isn't as useful now that the title can be built from variables. Any one have any suggestions on what it should be?
Comment #40
drewish commentedA couple of updates:
Comment #41
toemaz commented1. I little problem came up with your latest sandbox version. Whenever I want to add/edit a audio node, I get the following error:
warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\xx\xx\includes\bootstrap.inc on line 714.
Can anyone reproduce it?
2. Another little one:
When editing an audio node by changing the audio file, the 'current file' name in the 'audio file' fieldset: $form['audio_fileinfo']['filename']
is not being changed into the new filename.
3. 'Allow file downloads' checkbox does not preserve its value when previewing the form (after clicking the preview button).
Afterall, minor bugs, but might be annoying. Anyhow, great work Drewish!
Comment #42
drewish commentedtoemaz, Thanks for the feedback.
I can confirm #1. Not sure what the cause is. I'd just attibuted it to the lastest updates to Drupal HEAD. I'll look into it.
On #2, I don't think the filename will stick until you save. Not sure if there's an easy fix for that but it would be a good thing to fix.
#3, Hadn't seen that. I think there may still be a bug with checkboxes in HEAD. I'll let it settle down a bit before tackling that one.
Comment #43
toemaz commentedIt actually does (I just checked it again). I couldn't check out the code yet... might be something with the filemanager.
Comment #44
toemaz commentedPossible solution for #3:
'#default_value' => ($node->audio_fileinfo['downloadable'] == 1 ? true : false),
But I guess there is a much better way.
Comment #45
drewish commentedI've changed the way the default_value for the download link is set, it's pretty much what you suggested toemaz.
I'm not clear now, are you still having a problem with the filename not updating?
That htmlspecialchars() warning looks like it's because we don't use a title in the proper manner. I'm working on a fix for that.
Comment #46
drewish commentedI was wrong about the htmlspecialchars warning, it was due to the form's id tag. It was getting merged in with an existing one and being put into an array which check_plain wasn't expecting. I removed the id and the warning is gone (and the form still has an id).
I did a little testing on that filename issue. I think that's a problem with filemanager. I'll open an issue over there.
Keep 'em coming,
andrew
Comment #47
drewish commentedBeen working on a few different things:
Comment #48
drewish commentedComment #49
toemaz commentedSo far as I tested, it works fine!
I'm using your latest sandbox version all the time. So keep on going ;-)
Comment #50
drewish commentedgreat, i'm glad to hear it. i'm currently trying to track down a bug that prevents you from removing comment tags. please let me know if you run into anything wierd with additional id3 tags.
Comment #51
toemaz commentedAlright. Didn't test the tag's so far. Will keep my eye on it.
BTW seems like the filemanager maintainer replied on a lot of open issues. Good evolution for this audio module according to me, knowing filemanager has a future.
Comment #52
drewish commentedNext up:
* hook_search, using zirafa's patch as a starting place
* probably implement hooks for the views module, i think it''ll open up a lot of functionality.
Comment #53
ju.ri commentedhello,
for some reason the .install thing doesnt work on my 4.7b4 system (yet). could you maybe provide the .mysql file so i could still install the module? many thanks!
Comment #54
q0rban commentedComment #55
ju.ri commentedjeez i changed the title.. hope this changes it back. sorry
Comment #56
drewish commentedyeah, i guess the hook_install didn't make it into beta4. if you open up the .install file in audio_install() you'll find a copy of the database schema.
Comment #57
drewish commentedBryght has hired me to remove the filemanger dependency. Most of the work is complete (stay away from revisions though) and checked into my sandbox. I want to do a bit more testing before committing it back to the "official" module.
To use this, due to a recent change in the core file tables, you must be running a recent version of HEAD (update 173 or greater). I've added an update to audio.install that migrates existing audio nodes from filemanager to core. You won't even see the update if you're not running a new enough version of Drupal.
Warning: I've tested it but I won't guarantee that the upgrade will work for you. If this scares you, make a backup of your database and files directory first.
Comment #58
drewish commentedI've found a few different bugs in the getID3 library. The maintainer has fixed most of them but hasn't released a newer version. He sent me a current copy of the development version which I'm attaching. If you run into fatal errors with the 1.7.5 version, try using this instead.
Comment #59
q0rban commentedreceive this error when running the update script:
Using update 174 of drupal and your most recent sandbox version..
Comment #60
drewish commentedi forgot to mention that i've fixed the update. q0rban reported back via email that it worked for him.
also, i'm starting work on supporting the views module.
Comment #61
drewish commented* Something with the uploads was "fixed" in core. I've made some changes to get it working. The uploads are now moved to drupal's temp directory and then when the node is saved to files/audio.
* Improved reporting of ID3 read write errors and warnings. This may be annoying but it'll help trackdown errors in the getID3 library.
Comment #62
q0rban commentedI receive the following error when trying to edit an audio node:
Comment #63
drewish commentedq0rban, thanks. that's what i get for committing without doing that final testing. it should be fixed, i've also improved the warning messages.
Comment #64
drewish commentedfollowing moshe's suggestion, i've moved the audio files to their own table. now there's no more conflicts with the upload module over who owns what file. revision should work now but you'll get copies of each file. the revisions aren't playable or downloadable as the urls use the node id not the version id. i'll probably need to break backwards compatiblity to get that working.
we're getting pretty close to commitable.
Comment #65
drewish commentedwell, i've gone and done it. the re-write has been committed to HEAD.
anyone who's been using my sandbox version should update to the latest version, then run Drupal's update.php script to make sure their tables are up to speed. once that's finished, remove the sandbox audio module and checkout a clean copy from HEAD.
please open new issues for any bugs you find from this point on.
Comment #66
zirafa commentedquick question: did you update the 4.6 branch before committing the 4.7 changes, or is it possible to do that?
Comment #67
drewish commentedthere's a branch for 4.6, this is commited to head. there's a bug in the project module that's screwing with the listed release (http://drupal.org/node/47158).
Comment #68
Colin Brumelle commentedNicely done!
Thanks for commiting to head.
C
Comment #69
(not verified) commented