Class: Ehbrs::Tools::Runner::Music::Lyrics
- Inherits:
-
Object
- Object
- Ehbrs::Tools::Runner::Music::Lyrics
- Defined in:
- lib/ehbrs/tools/runner/music/lyrics.rb
Constant Summary collapse
- DEFAULT_PROVIDER =
'lyrics.com'
Instance Method Summary collapse
- #container_uncached ⇒ Object
- #file ⇒ Object
- #lyrics_uncached ⇒ Object
- #output_content ⇒ Object
- #provider_name ⇒ Object
- #provider_uncached ⇒ Object
- #run ⇒ Object
- #show_results ⇒ Object
- #start_banner ⇒ Object
Instance Method Details
#container_uncached ⇒ Object
37 38 39 |
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 37 def container_uncached ::EhbrsRubyUtils::Videos::File.from_file(file) end |
#file ⇒ Object
41 42 43 |
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 41 def file parsed.file.to_pathname end |
#lyrics_uncached ⇒ Object
45 46 47 |
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 45 def lyrics_uncached container.lyrics_by_provider(provider) end |
#output_content ⇒ Object
49 50 51 |
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 49 def output_content lyrics.text end |
#provider_name ⇒ Object
57 58 59 |
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 57 def provider_name parsed.provider end |
#provider_uncached ⇒ Object
53 54 55 |
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 53 def provider_uncached ::UltimateLyrics::Provider.by_name(provider_name) end |
#run ⇒ Object
15 16 17 18 |
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 15 def run show_results end |
#show_results ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 20 def show_results if lyrics.found? success 'Lyrics found' run_output else fatal_error 'No lyric found' end end |
#start_banner ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 29 def infov 'File', file %w[artist album track title year].each do |attr| infov attr.humanize, container.tag_file.tag.send(attr) end infov 'Selected provider', provider end |