News:

Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com

Main Menu

Media File Size/Duration

Started by lon22, April 05, 2008, 09:47:14 PM

Previous topic - Next topic

lon22

Does anyone know if there is a field somewhere in a LMCE table that has the duration of a related media file? Basiclly a field that says media X is xx:xx:xx in duration.

I didn't see ay field as such in pluto_media.

thanks

lon22

royw

PlutoMedia.PlaylistEntry.Duration is probably not what you are looking for.

I'd guess the attribute "Run Time".

>> PlutoMedia::AttributeType.find(:all).collect{|c| [c.id, c.Description]}.uniq.each {|a| puts a.join(' ')}
1 Director
2 Performer
3 Album
5 Track
6 ASIN
7 CDDB
8 Genre
9 Ref #
10 Channel
11 Episode
12 Program
13 Title
14 Disc ID
15 Conductor
16 Composer/Writer
17 Studio
18 Rating
19 Release Date
20 Website
21 Chapter
22 Encoding
23 Format
24 Aspect Ratio(s)
25 Audio Encoding
26 Rated
27 DVD Release Date
28 Run Time
29 Keyword
30 Screen Saver For MD
31 Format
32 Region
33 Language
34 Aspect Ratio
35 Number of Discs
36 IMDB
37 Synopsis
38 Producer
39 Executive Producer
40 Purchase Info
41 TV Channel ID
42 TV Program ID
43 TV Series ID
44 Creation Date
45 THX Disk ID

HTH,
Roy

My System: [url="http://wiki.linuxmce.org/index.php/User:Royw"]http://wiki.linuxmce.org/index.php/User:Royw[/url]

lon22

roy,

It doesn't look like the attribute type run time is used for any media in the file attribute table. I would like to get the apprx runtime of a media file.

lon22

royw

Howdy,

As far as I can tell, the duration is not stored in the database.  You might have to query the id3 data directly from the file.

Here's a database dump of one of my mp3 files for 0710 beta 3:

  http://roy.wright.org/linuxmce/553.dump

The dump finds all associations for the selected record and then only the belongs_to (has a reference id column) associations of child records.

HTH,
Roy
My System: [url="http://wiki.linuxmce.org/index.php/User:Royw"]http://wiki.linuxmce.org/index.php/User:Royw[/url]