Skip to content

Commit

Permalink
MP3: Remove uneeded guard when ID3Tag tries to find an unknown genre (#…
Browse files Browse the repository at this point in the history
…125)

The guard `rescue nil` can now be safely removed since the original issue
is fixed by krists/id3tag#19

related with: #118
  • Loading branch information
alex-quiterio authored and julik committed Jun 18, 2018
1 parent 3e7a574 commit be4d032
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion format_parser.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gem::Specification.new do |spec|

spec.add_dependency 'ks', '~> 0.0.1'
spec.add_dependency 'exifr', '~> 1.0'
spec.add_dependency 'id3tag', '~> 0.10'
spec.add_dependency 'id3tag', '~> 0.10', '>= 0.10.1'
spec.add_dependency 'faraday', '~> 0.13'
spec.add_dependency 'measurometer', '~> 1'

Expand Down
5 changes: 1 addition & 4 deletions lib/parsers/mp3_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ def self.new(wrapped)
def to_h
tag = __getobj__
MEMBERS.each_with_object({}) do |k, h|
# ID3Tag sometimes raises when trying to find an unknown genre.
# If this guard is removed, it fails when trying to do a gsub on a nil,
# in /lib/id3tag/frames/v2/genre_frame/genre_parser_pre_24.rb:25:in `just_genres'
value = tag.public_send(k) rescue nil
value = tag.public_send(k)
h[k] = value if value
end
end
Expand Down

0 comments on commit be4d032

Please sign in to comment.