Class: Mp3InfoExt

Inherits:
Mp3Info
  • Object
show all
Defined in:
lib/lastfm-m3u/mp3_info_ext.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#queryObject (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_typeObject (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

Returns:

  • (Boolean)


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

Returns:

  • (Boolean)


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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (Boolean)


46
47
48
# File 'lib/lastfm-m3u/mp3_info_ext.rb', line 46

def title_found?
  tag2_title_found? || tag1_title_found?
end