diff --git a/lib/podcast_feed/provider/archive/parser.ex b/lib/podcast_feed/provider/archive/parser.ex index d6c78cf..927c34d 100644 --- a/lib/podcast_feed/provider/archive/parser.ex +++ b/lib/podcast_feed/provider/archive/parser.ex @@ -96,7 +96,7 @@ defmodule PodcastFeed.Provider.Archive.Parser do description: "", pubDate: file |> Map.get("mtime") |> Integer.parse() |> elem(0) |> DateTime.from_unix!(:second), link: Format.compile(@download_url, identifier: identifier, filename: filename) |> URI.encode(), - length: (file |> Map.get("length") |> Float.parse() |> elem(0)) * 100 |> trunc(), + length: (file |> Map.get("length") |> Float.parse() |> elem(0)) |> trunc(), size: file |> Map.get("size"), summary: "", # image: "", #FIXME:! take the image from other files diff --git a/lib/podcast_feed_web/views/feed_view.ex b/lib/podcast_feed_web/views/feed_view.ex index bdb693c..2a2995d 100644 --- a/lib/podcast_feed_web/views/feed_view.ex +++ b/lib/podcast_feed_web/views/feed_view.ex @@ -2,10 +2,8 @@ defmodule PodcastFeedWeb.FeedView do use PodcastFeedWeb, :view def format_length(length) do - length |> IO.inspect - parsed = length / 100 / 60 - min = parsed |> trunc - sec = parsed - min |> Float.floor(2) |> Float.to_string() |> String.split(".") |> Enum.at(1) + min = length / 60 |> trunc() + sec = length - (min * 60) "#{min}:#{sec}" end end