Bug 311794 - Additional information for audio files always shows duration of 00:00:00
Summary: Additional information for audio files always shows duration of 00:00:00
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: general (show other bugs)
Version: 2.1.85
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: investigated
Depends on:
Blocks:
 
Reported: 2012-12-16 18:54 UTC by Hrvoje Senjan
Modified: 2013-01-09 15:26 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10


Attachments
Example (151.84 KB, image/png)
2012-12-16 18:54 UTC, Hrvoje Senjan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hrvoje Senjan 2012-12-16 18:54:15 UTC
If one enables add. info for Music files, they are always shown with mentioned duration.

Reproducible: Always

Steps to Reproduce:
As said


Expected Results:  
Should show the actual duration

Using git master, not sure since when this regressed (probably since port to nepomuk-core), cause i don't usually have it turned on.
Comment 1 Hrvoje Senjan 2012-12-16 18:54:51 UTC
Created attachment 75870 [details]
Example
Comment 2 Frank Reininghaus 2012-12-16 18:57:55 UTC
Thanks for the report. I assume you are using the master branch or one of the 4.10 betas?
Comment 3 Vishesh Handa 2012-12-16 19:01:47 UTC
(In reply to comment #2)
> Thanks for the report. I assume you are using the master branch or one of
> the 4.10 betas?

Frank. I don't think this is a bug in Nepomuk. We report the duration in seconds. You need to convert it properly.
Comment 4 Hrvoje Senjan 2012-12-16 19:20:19 UTC
(In reply to comment #2)
> Thanks for the report. I assume you are using the master branch or one of
> the 4.10 betas?

I am using git master, with the exception of dolphin, which is at 4.9.90, cause of bug 311769
Comment 5 Frank Reininghaus 2012-12-17 13:33:40 UTC
(In reply to comment #3)
> Frank. I don't think this is a bug in Nepomuk. We report the duration in
> seconds. You need to convert it properly.

All right, sorry about that. I just looked through the sources and found the following in the API docs for KNepomukRolesProvider::durationFromValue(int value):

    /**
     * @return Duration in the format HH::MM::SS for the value given
     *         in milliseconds.
     */

I wonder why Peter assumed that the value we get from http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#duration is measured in miliseconds. Is there some public documentation that says that it's in seconds?
Comment 6 Vishesh Handa 2012-12-22 11:32:11 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > Frank. I don't think this is a bug in Nepomuk. We report the duration in
> > seconds. You need to convert it properly.
> 
> All right, sorry about that. I just looked through the sources and found the
> following in the API docs for KNepomukRolesProvider::durationFromValue(int
> value):
> 
>     /**
>      * @return Duration in the format HH::MM::SS for the value given
>      *         in milliseconds.
>      */
> 
> I wonder why Peter assumed that the value we get from
> http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#duration is
> measured in miliseconds. Is there some public documentation that says that
> it's in seconds?

Actually it is supposed to be an xsd:duration type. We however do not have support for that and save the time in seconds instead. If you want I'll add some public docs saying that we use seconds.
Comment 7 Frank Reininghaus 2012-12-23 14:36:26 UTC
Thanks for the clarification!

(In reply to comment #6)
> If you want I'll add some public docs saying that we use seconds.

No, not necessary. I had just been wondering if there had been some public docs saying that it's milliseconds because I don't understand why Dolphin's code apparently had been written with that assumption in mind. We'll just have to modify KNepomukRolesProvider::durationFromValue(int) then, which should be quite straightforward.
Comment 8 Emmanuel Pescosta 2013-01-09 15:26:41 UTC
Git commit d23631d0410057b3d3b74f92596a51e5f64c48e2 by Emmanuel Pescosta.
Committed on 09/01/2013 at 16:24.
Pushed by emmanuelp into branch 'KDE/4.10'.

Show the real audio file duration in additional informations

Big Thanks to Frank Reininghaus and Vishesh Handa!
REVIEW: 108281
FIXED-IN: 4.10

M  +1    -1    dolphin/src/kitemviews/private/knepomukrolesprovider.cpp
M  +1    -1    dolphin/src/kitemviews/private/knepomukrolesprovider.h

http://commits.kde.org/kde-baseapps/d23631d0410057b3d3b74f92596a51e5f64c48e2