Class: Ehbrs::Tools::Runner::Music::Lyrics

Inherits:
Object
  • Object
show all
Defined in:
lib/ehbrs/tools/runner/music/lyrics.rb

Constant Summary collapse

DEFAULT_PROVIDER =
'lyrics.com'

Instance Method Summary collapse

Instance Method Details

#container_uncachedObject



41
42
43
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 41

def container_uncached
  ::EhbrsRubyUtils::Videos::File.from_file(file)
end

#fileObject



45
46
47
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 45

def file
  parsed.file.to_pathname
end

#lyrics_uncachedObject



49
50
51
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 49

def lyrics_uncached
  container.lyrics_by_provider(provider)
end

#output_contentObject



53
54
55
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 53

def output_content
  lyrics.text
end

#provider_nameObject



61
62
63
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 61

def provider_name
  parsed.provider
end

#provider_uncachedObject



57
58
59
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 57

def provider_uncached
  ::UltimateLyrics::Provider.by_name(provider_name)
end

#runObject



19
20
21
22
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 19

def run
  start_banner
  show_results
end

#show_resultsObject



24
25
26
27
28
29
30
31
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 24

def show_results
  if lyrics.found?
    success 'Lyrics found'
    run_output
  else
    fatal_error 'No lyric found'
  end
end

#start_bannerObject



33
34
35
36
37
38
39
# File 'lib/ehbrs/tools/runner/music/lyrics.rb', line 33

def start_banner
  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