video.rb

Path: app/models/video.rb
Last Update: Fri Nov 23 15:15:45 +1100 2007

The Video class is functionally very similar to the Audio class.

Currently the ferret search does not return media files based on contributors or subjects, but it should. This could be done by creating some extra methods to return the lists of all those involved, and then indexing these methods.

People are contributors to an media file if they helped to create it (recordists etc.). Subjects are animals, places etc. that are mentioned in the Video. The person who narrates a video could be seen as both a conributor and a subject, it is probably worth working what the best practice for such things is.

Using the file_column plugin the files are currently stored in the filesystem in public/audio/url/ according to the default settings. file_column is no longer supported and it would be worth thinking about moving to acts_as_attachment which is easier to maintain and customize.

schema.rb snippet:

  create_table "videos", :force => true do |t|
    t.column "url",                  :string,   :null => false
    t.column "format",               :string
    t.column "width",                :integer
    t.column "height",               :integer
    t.column "type",                 :string
    t.column "description",          :text
    t.column "created_at",           :datetime
    t.column "updated_at",           :datetime
    t.column "recorded_on",          :date
    t.column "restriction",          :string
    t.column "original_format",      :string
    t.column "location_of_original", :string
    t.column "catalogue_ref",        :string
    t.column "copyright_notice_id",  :integer
  end

[Validate]