File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ def show
24
24
return redirect_to podcasts_path
25
25
end
26
26
27
- @youtube = @episode . content . match ( /watch\? v=((\w )*)/ ) [ 1 ]
28
27
@url = request . url
29
28
@title = @episode . title . split ( '-' ) . last . strip
30
29
@date = @episode . published_date . strftime ( "%Y年%-m月%-d日(#{ Podcast ::WDAY2JAPANESE [ @episode . published_date . wday ] } )" )
@@ -36,6 +35,8 @@ def show
36
35
private
37
36
38
37
def convert_shownote ( content )
38
+ youtube_id = @episode . content . match ( /watch\? v=((\w )*)/ ) [ 1 ]
39
+
39
40
shownote = <<~HTML
40
41
< h2 id ='shownote '>
41
42
< a href ='#shownote '> 🎤</ a >
@@ -52,7 +53,7 @@ def convert_shownote(content)
52
53
t = ( t . size == '0:00' . size ) ? '0' + t : t
53
54
t = ( t . size == '00:00' . size ) ? '00:' + t : t
54
55
t = Time . parse ( t ) . seconds_since_midnight . to_i
55
- "- [#{ $1} ](https://youtu.be/#{ @youtube } ?t=#{ t } ) "
56
+ "- [#{ $1} ](https://youtu.be/#{ youtube_id } ?t=#{ t } ) "
56
57
end
57
58
end
58
59
end
You can’t perform that action at this time.
0 commit comments