Skip to content

Commit

Permalink
Fix Id3TagService cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jcraigk committed Nov 8, 2024
1 parent 83a6363 commit 4452956
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/services/id3_tag_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,18 @@ def apply_track_specific_v2_tags(mp3)

def apply_album_art(mp3)
return unless show.album_cover.attached?

# Process variant for ID3 tag
album_cover_variant = show.album_cover.variant(:id3).processed

# Attach album art to ID3 tag
album_art_data = album_cover_variant.download
mp3.tag2.add_picture(album_art_data)
album_cover_variant.blob.purge

# Remove variant blob
blob = album_cover_variant.blob
blob.attachments.each(&:destroy)
blob.purge
end

def comments
Expand Down

0 comments on commit 4452956

Please sign in to comment.