fix(feed): preserve standard media enclosures
This commit is contained in:
parent
96f471a291
commit
d1a7e915ce
6 changed files with 122 additions and 17 deletions
|
|
@ -22,9 +22,13 @@
|
|||
<category term="<%= tag %>"></category>
|
||||
<% end %>
|
||||
|
||||
<%= for attachment <- @data["attachment"] || [] do %>
|
||||
<%= unless attachment_previewable?(attachment) do %>
|
||||
<link rel="enclosure" href="<%= attachment_href(attachment) %>" type="<%= attachment_type(attachment) %>" length="<%= attachment_size(attachment) %>"/>
|
||||
<%= unless @data["sensitive"] do %>
|
||||
<%= for attachment <- @data["attachment"] || [] do %>
|
||||
<%= if size = attachment_size_positive(attachment) do %>
|
||||
<link rel="enclosure" href="<%= escape(attachment_href(attachment) || "") %>" type="<%= escape(attachment_type(attachment) || "application/octet-stream") %>" length="<%= size %>"/>
|
||||
<% else %>
|
||||
<link rel="enclosure" href="<%= escape(attachment_href(attachment) || "") %>" type="<%= escape(attachment_type(attachment) || "application/octet-stream") %>"/>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
|||
|
|
@ -18,11 +18,14 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= for attachment <- @data["attachment"] || [] do %>
|
||||
<%= size = attachment_size_positive(attachment) %>
|
||||
<%= unless attachment_previewable?(attachment) do %>
|
||||
<enclosure url="<%= attachment_href(attachment) %>" type="<%= attachment_type(attachment) %>" length="<%= size || 0 %>" />
|
||||
<%= unless @data["sensitive"] do %>
|
||||
<%= with [attachment | _] <- @data["attachment"] || [] do %>
|
||||
<%= size = attachment_size_positive(attachment) %>
|
||||
<enclosure url="<%= escape(attachment_href(attachment) || "") %>" type="<%= escape(attachment_type(attachment) || "application/octet-stream") %>" length="<%= size || 0 %>" />
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= for attachment <- @data["attachment"] || [] do %>
|
||||
<%= media_content_xml(attachment, @data["sensitive"]) %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
|||
|
|
@ -25,9 +25,13 @@
|
|||
<category term="<%= tag %>"></category>
|
||||
<% end %>
|
||||
|
||||
<%= for attachment <- @data["attachment"] || [] do %>
|
||||
<%= unless attachment_previewable?(attachment) do %>
|
||||
<link rel="enclosure" href="<%= attachment_href(attachment) %>" type="<%= attachment_type(attachment) %>" length="<%= attachment_size(attachment) %>"/>
|
||||
<%= unless @data["sensitive"] do %>
|
||||
<%= for attachment <- @data["attachment"] || [] do %>
|
||||
<%= if size = attachment_size_positive(attachment) do %>
|
||||
<link rel="enclosure" href="<%= escape(attachment_href(attachment) || "") %>" type="<%= escape(attachment_type(attachment) || "application/octet-stream") %>" length="<%= size %>"/>
|
||||
<% else %>
|
||||
<link rel="enclosure" href="<%= escape(attachment_href(attachment) || "") %>" type="<%= escape(attachment_type(attachment) || "application/octet-stream") %>"/>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,14 @@
|
|||
<description><%= activity_description(@data) %></description>
|
||||
<content:encoded><![CDATA[<%= rss_content_encoded(@data) %>]]></content:encoded>
|
||||
|
||||
<%= for attachment <- @data["attachment"] || [] do %>
|
||||
<%= size = attachment_size_positive(attachment) %>
|
||||
<%= unless attachment_previewable?(attachment) do %>
|
||||
<enclosure url="<%= attachment_href(attachment) %>" type="<%= attachment_type(attachment) %>" length="<%= size || 0 %>"/>
|
||||
<%= unless @data["sensitive"] do %>
|
||||
<%= with [attachment | _] <- @data["attachment"] || [] do %>
|
||||
<%= size = attachment_size_positive(attachment) %>
|
||||
<enclosure url="<%= escape(attachment_href(attachment) || "") %>" type="<%= escape(attachment_type(attachment) || "application/octet-stream") %>" length="<%= size || 0 %>"/>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= for attachment <- @data["attachment"] || [] do %>
|
||||
<%= media_content_xml(attachment, @data["sensitive"]) %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue