summaryrefslogtreecommitdiff
path: root/src/song.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/song.c')
-rw-r--r--src/song.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/song.c b/src/song.c
index faaa208ca..bc6cb11c4 100644
--- a/src/song.c
+++ b/src/song.c
@@ -80,3 +80,12 @@ song_get_uri(const struct song *song)
return g_strconcat(directory_get_path(song->parent),
"/", song->uri, NULL);
}
+
+double
+song_get_duration(const struct song *song)
+{
+ if (song->tag == NULL)
+ return 0;
+
+ return song->tag->time;
+}