From 4d054d06a773d9dbe121781e6c6db63b065b73be Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 4 Jun 2018 13:05:48 +0900 Subject: [PATCH] Make SoundTrackMedia component more robust --- mixins/SoundTrack.pixy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mixins/SoundTrack.pixy b/mixins/SoundTrack.pixy index d437d541..9eeb24eb 100644 --- a/mixins/SoundTrack.pixy +++ b/mixins/SoundTrack.pixy @@ -17,7 +17,7 @@ component SoundTrackContent(track *arn.SoundTrack, user *arn.User) SoundTrackMedia(track) component SoundTrackMedia(track *arn.SoundTrack) - if track.File != "" + if track.File != "" && track.HasMediaByService("Youtube") .soundtrack-media .soundtrack-play-area.action(data-action="toggleAudio", data-trigger="click", data-audio-src="https://notify.moe/audio/" + track.File, data-soundtrack-id=track.ID) img.soundtrack-image.lazy(data-src="https://img.youtube.com/vi/" + track.MediaByService("Youtube")[0].ServiceID + "/0.jpg", alt=track.Title) @@ -28,7 +28,7 @@ component SoundTrackMedia(track *arn.SoundTrack) .visualizer-box.visualizer-box-1 .visualizer-box.visualizer-box-2 .visualizer-box.visualizer-box-3 - else + else if len(track.Media) > 0 ExternalMedia(track.Media[0]) component SoundTrackFooter(track *arn.SoundTrack, user *arn.User)