fix error

This commit is contained in:
邱博亞 2021-12-30 18:10:42 +08:00
parent 5ea966cac1
commit c45767adbc
1 changed files with 6 additions and 4 deletions

View File

@ -73,6 +73,8 @@ class SiteFeedAnnc
} }
end end
tmp["category"] = cat tmp["category"] = cat
tmp["source_url"] = self.remote_site_url
tmp["source-site"] = self.remote_site_url tmp["source-site"] = self.remote_site_url
tmp["source-site-title"] = (self[:channel_title][locale] rescue "") tmp["source-site-title"] = (self[:channel_title][locale] rescue "")
tmp["params"] = tmp["params"].to_s + "_" + self.feed_id.to_s + "h" tmp["params"] = tmp["params"].to_s + "_" + self.feed_id.to_s + "h"
@ -187,9 +189,9 @@ class SiteFeedAnnc
tmp = data['data'] tmp = data['data']
if tmp["link_to_show"].nil? if tmp["link_to_show"].nil?
if !is_widget if !is_widget
tmp["link_to_show"] = UseSourceUrl && tmp["show_url"] ? (tmp["source-site"] + tmp["show_url"]) : OrbitHelper.url_to_show(tmp["params"]) rescue '' tmp["link_to_show"] = UseSourceUrl && tmp["show_url"] ? (tmp["source_url"] + tmp["show_url"]) : OrbitHelper.url_to_show(tmp["params"]) rescue ''
else else
tmp["link_to_show"] = UseSourceUrl && tmp["show_url"] ? (tmp["source-site"] + tmp["show_url"]) : OrbitHelper.widget_item_url(tmp["params"]) rescue '' tmp["link_to_show"] = UseSourceUrl && tmp["show_url"] ? (tmp["source_url"] + tmp["show_url"]) : OrbitHelper.widget_item_url(tmp["params"]) rescue ''
end end
end end
tmp tmp
@ -209,9 +211,9 @@ class SiteFeedAnnc
next if tmp["is_hidden"] || (!tmp["postdate"].nil? && tmp["postdate"]<Time.now) || tmp['title'].blank? next if tmp["is_hidden"] || (!tmp["postdate"].nil? && tmp["postdate"]<Time.now) || tmp['title'].blank?
if tmp["link_to_show"].nil? if tmp["link_to_show"].nil?
if !is_widget if !is_widget
tmp["link_to_show"] = UseSourceUrl && tmp["show_url"] ? (tmp["source-site"] + tmp["show_url"]) : OrbitHelper.url_to_show(tmp["params"]) rescue '' tmp["link_to_show"] = UseSourceUrl && tmp["show_url"] ? (tmp["source_url"] + tmp["show_url"]) : OrbitHelper.url_to_show(tmp["params"]) rescue ''
else else
tmp["link_to_show"] = UseSourceUrl && tmp["show_url"] ? (tmp["source-site"] + tmp["show_url"]) : OrbitHelper.widget_item_url(tmp["params"]) rescue '' tmp["link_to_show"] = UseSourceUrl && tmp["show_url"] ? (tmp["source_url"] + tmp["show_url"]) : OrbitHelper.widget_item_url(tmp["params"]) rescue ''
end end
end end
tmp tmp