From ef8be9b14864d32dac1d7ef0179631f810578de5 Mon Sep 17 00:00:00 2001 From: Androz2091 Date: Sat, 18 Jan 2020 18:40:06 +0100 Subject: [PATCH] song: add duration property --- docs/Song.html | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/Song.js | 5 ++++ 2 files changed, 74 insertions(+) diff --git a/docs/Song.html b/docs/Song.html index fb8a336..a886aee 100644 --- a/docs/Song.html +++ b/docs/Song.html @@ -289,6 +289,75 @@ + + + + +
+

duration :Number

+ + + + +
+

Song duration.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
Type:
+ + + + + +
diff --git a/src/Song.js b/src/Song.js index 8b576bf..84dd212 100644 --- a/src/Song.js +++ b/src/Song.js @@ -12,6 +12,11 @@ class Song { * @type {string} */ this.name = video.title; + /** + * Song duration. + * @type {Number} + */ + this.duration = ((video.duration.hours*3600)+(video.duration.minutes*60)+(video.duration.seconds)) * 100; /** * Raw informations about the song. * @type {Object}