Skip to content
Snippets Groups Projects
Commit 277431a5 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Store the length (in seconds) of the recordings.

parent 2feea6a1
No related branches found
No related tags found
No related merge requests found
require "mp3info"
class RecordingsController < ApplicationController
def index
list
......@@ -89,9 +91,11 @@ class RecordingsController < ApplicationController
filename + "| pvftowav " +
"| lame -h - " + mp3file)
record_time = Time.at(timestamp.to_i)
mp3info = Mp3Info.new(mp3file)
recording = Recording.new(:cid => cid,
:when => timestamp,
:file => mp3file,
:length => mp3info.length,
:seen => 0,
:archived => 0)
recording.save!
......
......@@ -15,6 +15,7 @@ class Initial < ActiveRecord::Migration
t.column :when, :datetime
t.column :user_id, :integer
t.column :file, :string
t.column :length, :string
t.column :seen, :integer
t.column :archived, :integer
t.column :created_on, :timestamp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment