Instead of using spoiler boolean and spoiler_text, simply check for non-blank spoiler_text
Federate spoiler_text using warning attribute on <content /> instead of a <category term="spoiler" /> Clean up schema file from accidental development migrations
This commit is contained in:
@@ -103,6 +103,7 @@ class ProcessFeedService < BaseService
|
||||
url: url(entry),
|
||||
account: account,
|
||||
text: content(entry),
|
||||
spoiler_text: content_warning(entry),
|
||||
created_at: published(entry)
|
||||
)
|
||||
|
||||
@@ -223,6 +224,10 @@ class ProcessFeedService < BaseService
|
||||
xml.at_xpath('./xmlns:content', xmlns: TagManager::XMLNS).content
|
||||
end
|
||||
|
||||
def content_warning(xml = @xml)
|
||||
xml.at_xpath('./xmlns:content', xmlns: TagManager::XMLNS)['warning']
|
||||
end
|
||||
|
||||
def published(xml = @xml)
|
||||
xml.at_xpath('./xmlns:published', xmlns: TagManager::XMLNS).content
|
||||
end
|
||||
|
Reference in New Issue
Block a user