From b6cdf308cbd270f51f0687d73e242c447e049b53 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Mon, 5 Oct 2020 11:33:49 +0200 Subject: [PATCH] Decode float for duration --- src/Core.elm | 2 +- src/Twitch.elm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core.elm b/src/Core.elm index 6c021f9..0ccfea9 100644 --- a/src/Core.elm +++ b/src/Core.elm @@ -54,7 +54,7 @@ resultToMsg result = Ok o -> PlaylistsReceived ( o, Time.utc ) - _ -> + Err _ -> Noop diff --git a/src/Twitch.elm b/src/Twitch.elm index 81424e6..d8fa494 100644 --- a/src/Twitch.elm +++ b/src/Twitch.elm @@ -35,7 +35,7 @@ decodeVideo = Decode.map4 Video (Decode.field "title" Decode.string) (Decode.field "url" Decode.string) - (Decode.field "duration" Decode.int) + (Decode.map Basics.round (Decode.field "duration" Decode.float)) (Decode.maybe (Decode.field "date" Iso8601.decoder))