Class: LastfmM3u::FileSearch
- Defined in:
- lib/lastfm-m3u/search/file_search.rb
Instance Attribute Summary collapse
-
#root_dir ⇒ Object
Returns the value of attribute root_dir.
Attributes inherited from Base
Instance Method Summary collapse
- #find(query, options = {}) ⇒ Object
-
#initialize(root_dir) ⇒ FileSearch
constructor
A new instance of FileSearch.
Constructor Details
#initialize(root_dir) ⇒ FileSearch
Returns a new instance of FileSearch.
11 12 13 14 |
# File 'lib/lastfm-m3u/search/file_search.rb', line 11 def initialize(root_dir) @root_dir = Pathname root_dir super() end |
Instance Attribute Details
#root_dir ⇒ Object
Returns the value of attribute root_dir.
9 10 11 |
# File 'lib/lastfm-m3u/search/file_search.rb', line 9 def root_dir @root_dir end |
Instance Method Details
#find(query, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/lastfm-m3u/search/file_search.rb', line 16 def find(query, ={}) query_type = [:query_type] || :track file_or_id3 = [:search_type] || :both prefer_flac = [:prefer_flac] || true files = find_unique_files(query, query_type, file_or_id3) if prefer_flac files = flac_files(files) || files end $logger.debug "#{query} => #{files}" files end |