Skip to content

Commit eef8aee

Browse files
committed
Twitch: Fix <author> on game feeds.
1 parent f8b4b2f commit eef8aee

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,8 +1012,8 @@
10121012

10131013
@data = JSON.parse(data)
10141014
@user_name = @data["user_name"] || CGI.unescape(user)
1015-
@user_login = @data["user_login"] || CGI.unescape(user)
1016-
@alternate_url = Addressable::URI.parse("https://www.twitch.tv/#{@user_login.downcase}").normalize.to_s
1015+
user_login = @data["user_login"] || CGI.unescape(user)
1016+
@alternate_url = Addressable::URI.parse("https://www.twitch.tv/#{user_login.downcase}").normalize.to_s
10171017
@data["videos"].reject! { |v| v["is_live"] }
10181018

10191019
@title = @user_name

views/twitch.atom.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<title><%= "* " if video["type"] == "highlight" %>[<%= video["duration"].to_duration if video.has_key?("duration") %>] <%= video["title"].to_line.esc %></title>
1515
<link href="https://www.twitch.tv/videos/<%= video["id"] %>" />
1616
<updated><%= Time.parse(video["created_at"]) %></updated>
17-
<author><name><%= @user_login.esc %></name></author>
17+
<author><name><%= (video["user_name"] || @user_name).esc %></name></author>
1818
<content type="html">
1919
<%= <<~EOF.esc
2020
<iframe width="620" height="378" src="#{request.root_url}/twitch-embed.html#autoplay=false&video=#{video["id"]}" allowfullscreen referrerpolicy="no-referrer" style="border: 0;"></iframe>

0 commit comments

Comments
 (0)