[grilo-plugins] lua-factory: Add duration support to Apple Trailers



commit 5e498fa767475d42a1f0e028eba5d5f6b1192821
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jul 23 18:30:18 2015 +0200

    lua-factory: Add duration support to Apple Trailers

 src/lua-factory/sources/grl-appletrailers.lua |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/lua-factory/sources/grl-appletrailers.lua b/src/lua-factory/sources/grl-appletrailers.lua
index f02eab1..b6a344b 100644
--- a/src/lua-factory/sources/grl-appletrailers.lua
+++ b/src/lua-factory/sources/grl-appletrailers.lua
@@ -199,6 +199,8 @@ function parse_results(results)
     media.thumbnail = item.poster.xlarge[1]
     media.url = item.preview.large[1]
     media.size = item.preview.filesize
+    local mins, secs = item.info.runtime[1]:match('(%d):(%d)')
+    media.duration = tonumber(mins) * 60 + tonumber(secs)
 
     if skip > 0 then
       skip = skip - 1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]