Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove uneeded guard when ID3Tag tries to find an unknown genre #125

Merged
merged 1 commit into from
Jun 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_development_dependency 'rspec', '~> 3.0'
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