Class: Mp3InfoExt
- Inherits:
-
Mp3Info
- Object
- Mp3Info
- Mp3InfoExt
- Defined in:
- lib/lastfm-m3u/mp3_info_ext.rb
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#query_type ⇒ Object
readonly
Returns the value of attribute query_type.
Instance Method Summary collapse
-
#album_found? ⇒ Boolean
ALBUM.
-
#artist_found? ⇒ Boolean
ARTIST.
- #found? ⇒ Boolean
-
#initialize(query, query_type, entry) ⇒ Mp3InfoExt
constructor
A new instance of Mp3InfoExt.
- #tag1_album_found? ⇒ Boolean
- #tag1_artist_found? ⇒ Boolean
- #tag1_title_found? ⇒ Boolean
- #tag2_album_found? ⇒ Boolean
- #tag2_artist_found? ⇒ Boolean
- #tag2_title_found? ⇒ Boolean
-
#title_found? ⇒ Boolean
TITLE.
Constructor Details
#initialize(query, query_type, entry) ⇒ Mp3InfoExt
Returns a new instance of Mp3InfoExt.
6 7 8 9 10 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 6 def initialize(query, query_type, entry) @query = query @query_type = query_type super(entry) end |
Instance Attribute Details
#query ⇒ Object (readonly)
Returns the value of attribute query.
4 5 6 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 4 def query @query end |
#query_type ⇒ Object (readonly)
Returns the value of attribute query_type.
4 5 6 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 4 def query_type @query_type end |
Instance Method Details
#album_found? ⇒ Boolean
ALBUM
33 34 35 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 33 def album_found? tag2_album_found? || tag1_album_found? end |
#artist_found? ⇒ Boolean
ARTIST
20 21 22 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 20 def artist_found? tag2_artist_found? || tag1_artist_found? end |
#found? ⇒ Boolean
12 13 14 15 16 17 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 12 def found? return true if @query_type == :track && title_found? return true if @query_type == :album && album_found? return true if @query_type == :artist && artist_found? return false end |
#tag1_album_found? ⇒ Boolean
41 42 43 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 41 def tag1_album_found? hastag1? && tag1.album.downcase == query.downcase end |
#tag1_artist_found? ⇒ Boolean
28 29 30 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 28 def tag1_artist_found? hastag1? && tag1.artist.downcase == query.downcase end |
#tag1_title_found? ⇒ Boolean
54 55 56 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 54 def tag1_title_found? hastag1? and tag1.title.downcase == query.downcase end |
#tag2_album_found? ⇒ Boolean
37 38 39 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 37 def tag2_album_found? hastag2? && tag2.TALB.downcase == query.downcase end |
#tag2_artist_found? ⇒ Boolean
24 25 26 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 24 def tag2_artist_found? hastag2? && tag2.TPE1.downcase == query.downcase end |
#tag2_title_found? ⇒ Boolean
50 51 52 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 50 def tag2_title_found? hastag2? && tag2.TIT2.downcase == query.downcase end |
#title_found? ⇒ Boolean
TITLE
46 47 48 |
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 46 def title_found? tag2_title_found? || tag1_title_found? end |