Skip to content

Commit c7964d4

Browse files
committed
Fix track insertion
1 parent b4c9860 commit c7964d4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

app/services/id3_tag_service.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def apply_album_art(mp3)
6969

7070
# Process and download the ID3 variant
7171
album_cover_variant = show.album_cover.variant(:id3).processed
72-
album_art_data = album_cover_variant.download
72+
return unless album_art_data = album_cover_variant.download
7373

7474
# Attach album art to ID3 tag
7575
mp3.tag2.add_picture(album_art_data)

app/services/track_inserter.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ def show
3333
end
3434

3535
def insert_new_track
36-
track = Track.new \
36+
track = Track.new(
3737
show:,
3838
title:,
3939
songs: [ Song.find(song_id) ],
4040
position:,
4141
set:
42+
)
4243
track.slug = slug if slug.present?
4344
track.save!
4445
track.mp3_audio.attach(io: File.open(file), filename: File.basename(file))

0 commit comments

Comments
 (0)