m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/lib/song.rb
diff options
context:
space:
mode:
authorMarcin Chrzanowski <m@m-chrzan.xyz>2021-12-10 14:48:47 +0100
committerMarcin Chrzanowski <m@m-chrzan.xyz>2021-12-10 14:48:47 +0100
commitbf2281d1c948da3d578f8160a077b5381c1a2671 (patch)
tree089db043c23046f1aa2af2300ded06f2f63cdf9f /lib/song.rb
parentbae7995053a3fe0d293e5bd3f9c2770e27e95d8e (diff)
Fix Bandcamp, add Soundcloud embeds
Diffstat (limited to 'lib/song.rb')
-rw-r--r--lib/song.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/song.rb b/lib/song.rb
index 4076956..151fa6c 100644
--- a/lib/song.rb
+++ b/lib/song.rb
@@ -22,10 +22,13 @@ class Song
if metadata['recordings']
metadata['recordings'].each do |recording|
- if recording['type'] == 'youtube'
+ case recording['type']
+ when 'youtube'
song.recordings.push YouTubeRecording.new(recording['link'])
- elsif recording['type'] == 'bandcamp'
- song.recordings.push BandcampRecording.new(recording['link'])
+ when 'bandcamp'
+ song.recordings.push BandcampRecording.new(recording['embed'])
+ when 'soundcloud'
+ song.recordings.push SoundCloudRecording.new(recording['embed'])
end
end
end