Discrepancy with what is listed in Media Storage and Picker

Topics: Core, General
Dec 4, 2013 at 10:38 PM
Edited Dec 4, 2013 at 10:40 PM
crosspost: http://stackoverflow.com/questions/20388462/media-storage-and-media-picker-in-orchard-cms

We just noticed that some files listed when visiting folders under Media Storage are not always listed in the Media Picker modal. I did some tinkering myself and found out that if you upload files via Media Storage -> Select Folder -> Add Media, it doesn't get listed at all, as opposed to going onto Media Picker -> Select Folder -> Import.

Correct me if I'm wrong but I remember one of the changes in 1.7 is that media is now treated as a Content Type as opposed to having the picker just crawl through folders. Does this have anything to do with it? (i.e. Media Storage just uploads the file, Media Picker import adds the CT and lists it)

Any piece of information would be highly appreciated, thanks!
Dec 5, 2013 at 1:22 AM
I'm having all sorts of trouble with this. Why would you have 2 media methods, i.e. one database, the other OS based? I would have thought if you were going to use a content type, it would function exactly the same way as Media Picker, by just using SQL equivalent logic?

Dec 5, 2013 at 1:42 AM
A Media is a content item, because it lets you add custom properties, have drafts, events, workflows and more I can't remember right now.
Do you disagree with the advantages ?

A media can be an image file, it is most of the time, why would we store them in the database as they will be better served by the web server directly from a file. It will be faster, and won't impact the database size or perf. Some media don't rely on files, and it's ok too, for instance oembed media. Some other media have huge files, like videos, which would definitely not be in the db.

Now, how do we handle the synchronization between the two, is by explicitly importing content items and linking them to files. Thus adding a file to a folder is not sufficient, you then need to import this file. If you look into the thread where we designed the module, you will find a suggestion to create a module listing the files in the media folder which can be imported. This would help you if you have lots of files in the media folder and you forgot to import them. Please note that the Upgrade module will do it for you for free.

Also, if you have the Media Library module enabled, I suggest you disable the Media module. Unless you have a reason not to do so.
Dec 5, 2013 at 2:10 AM
Thanks for the feedback. I agree with the advantages presented by the module. I'll change my methods and use your suggested implementation. An excellent addition to the project and I enjoy the Orchard platform, with over 40 sites now in production.

Kind regards,
Paul King