From a4cfdfcdf6bf687f254fd93e740fb9ef105e42e7 Mon Sep 17 00:00:00 2001 From: danilo silva Date: Sun, 24 May 2020 19:54:35 +0000 Subject: [PATCH] fix: size in bytes of the audio file --- lib/podcast_feed/provider/archive/parser.ex | 1 + lib/podcast_feed_web/templates/feed/feed.xml.eex | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/podcast_feed/provider/archive/parser.ex b/lib/podcast_feed/provider/archive/parser.ex index 2f988ab..d6c78cf 100644 --- a/lib/podcast_feed/provider/archive/parser.ex +++ b/lib/podcast_feed/provider/archive/parser.ex @@ -97,6 +97,7 @@ defmodule PodcastFeed.Provider.Archive.Parser do 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(), + size: file |> Map.get("size"), summary: "", # image: "", #FIXME:! take the image from other files keywords: file |> Map.take(["album", "artist", "genre"]) |> Map.values(), diff --git a/lib/podcast_feed_web/templates/feed/feed.xml.eex b/lib/podcast_feed_web/templates/feed/feed.xml.eex index d814dd5..2a2942a 100644 --- a/lib/podcast_feed_web/templates/feed/feed.xml.eex +++ b/lib/podcast_feed_web/templates/feed/feed.xml.eex @@ -35,7 +35,7 @@ <%= item.link %> <%= item.pubDate |> Calendar.DateTime.Format.rfc2822 %> ]]> - + <%= item.link %> <%= item.length |> format_length %> <%= item.summary %>