mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-27 18:40:12 -05:00
2b8dc58b7f
* Change RSS feeds - Use date and time for titles instead of ellipsized text - Use full content in body, even when there is a content warning - Use media extensions * Change feed icons and add width and height attributes to custom emojis * Fix custom emoji animate on hover breaking * Fix tests
30 lines
600 B
Ruby
30 lines
600 B
Ruby
# frozen_string_literal: true
|
|
|
|
class RSS::MediaContent < RSS::Element
|
|
def initialize(url, type, size)
|
|
super()
|
|
|
|
@root = create_element('media:content') do |content|
|
|
content['url'] = url
|
|
content['type'] = type
|
|
content['fileSize'] = size
|
|
end
|
|
end
|
|
|
|
def medium(str)
|
|
@root['medium'] = str
|
|
end
|
|
|
|
def rating(str)
|
|
append_element('media:rating', str) do |rating|
|
|
rating['scheme'] = 'urn:simple'
|
|
end
|
|
end
|
|
|
|
def description(str)
|
|
append_element('media:description', str) do |description|
|
|
description['type'] = 'plain'
|
|
end
|
|
end
|
|
end
|