audio_addict 0.4.4 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ee6cc11f55f2390f92e1aabaa149f244efa69568cac99c4a884bd535f7b71e0
4
- data.tar.gz: cb54f67c5cc82adf075cae1245f065e701abd4be33dfccee1d9a3c8e0fd0228b
3
+ metadata.gz: d7d324a3657ae9b16cc367a39bbbdf23be19880471dc199fd1762dc163c63b36
4
+ data.tar.gz: eb20e965b292d3802fcc1d8c0b0c9416dc23bc1b24b91fc88c58a0835bb33029
5
5
  SHA512:
6
- metadata.gz: f290d478a534b461396b468b328c6f241e86e94a03364441bdbc746d0881f408213a234aa032f64f53828a7e1c3bff9613be37da4f8309ca6380fa080b60d767
7
- data.tar.gz: 4257ac323735ffc9c938ea8f5ef54e2c121b93773cf449dbe0e5c649bfe3566d9700c5711e1f590e459c6ded755e427f45816bd3a3892ec8618a0d4cc12f75e7
6
+ metadata.gz: 6b9d46c654ce1096e59f40261577dd6b86500a410e7e894aaf03d1f1358bc8aaf5bc8ddff327864897efb4226c5eab9195ec1a666a78dd52aa4b56cfb48128da
7
+ data.tar.gz: e85d2e9509c20a181163a6b8d444754d6836e1900504f9a862c9fde04fc6cedf4edf9dc8ccd6708039d30fb6f8945f2616b85139862fa56f8ca38da3bde124d8
data/bin/radio CHANGED
@@ -11,20 +11,20 @@ rescue Interrupt, AudioAddict::Interrupt, TTY::Reader::InputInterrupt
11
11
  say "\nGoodbye"
12
12
  exit 1
13
13
  rescue AudioAddict::ConfigError => e
14
- say '!undred!ERROR: Missing Configuration Values'
14
+ say 'ru`ERROR: Missing Configuration Values`'
15
15
  say "#{e.message}:"
16
16
  e.missing_keys.each do |key|
17
- say "- !txtblu!#{key}"
17
+ say "- b`#{key}`"
18
18
  end
19
19
  say ''
20
- say 'Run !txtpur!radio config guide!txtrst! for more information'
20
+ say 'Run m`radio config guide` for more information'
21
21
  exit 1
22
22
  rescue => e
23
23
  if ENV['DEBUG']
24
24
  puts e.backtrace.reverse
25
25
  say ''
26
26
  end
27
- say "!undred!ERROR: #{e.class}"
27
+ say "ru`ERROR: #{e.class}`"
28
28
  say e.message
29
29
  exit 1
30
30
  end
@@ -20,7 +20,7 @@ module AudioAddict
20
20
  def run
21
21
  needs :network
22
22
 
23
- say "!undgrn!#{radio.name}\n"
23
+ say "gu`#{radio.name}`\n"
24
24
 
25
25
  search = args['SEARCH']
26
26
 
@@ -39,7 +39,7 @@ module AudioAddict
39
39
  def show_verbose(channels)
40
40
  channels.each do |channel|
41
41
  say ''
42
- say "!txtgrn!#{channel.name.ljust 22} !txtrst!# #{channel.key}"
42
+ say "g`#{channel.name.ljust 22} `# #{channel.key}"
43
43
  say ''
44
44
  say word_wrap channel.description.to_s
45
45
  say ''
@@ -50,7 +50,7 @@ module AudioAddict
50
50
 
51
51
  say 'Similar Channels:'
52
52
  similar.each do |key, similar_channel|
53
- say "- !txtblu!#{similar_channel.name.ljust 20}!txtrst! # #{key}"
53
+ say "- b`#{similar_channel.name.ljust 20}` # #{key}"
54
54
  end
55
55
  say ''
56
56
  end
@@ -58,7 +58,7 @@ module AudioAddict
58
58
 
59
59
  def show_compact(channels)
60
60
  channels.each do |channel|
61
- say "!txtblu!#{channel.key.rjust 25} !txtgrn!#{channel.name.strip}"
61
+ say "b`#{channel.key.rjust 25}` g`#{channel.name.strip}`"
62
62
  end
63
63
  end
64
64
  end
@@ -36,7 +36,7 @@ module AudioAddict
36
36
  def get_command
37
37
  key = args['KEY'].to_sym
38
38
  value = Config.properties[key]
39
- say value ? "!txtgrn!#{value}" : '!txtred!<Unset>'
39
+ say value ? "g`#{value}`" : 'r`<Unset>`'
40
40
  end
41
41
 
42
42
  def set_command
@@ -44,22 +44,22 @@ module AudioAddict
44
44
  value = args['VALUE']
45
45
  Config.properties[key] = value
46
46
  Config.save
47
- say "!txtgrn!#{key}=#{value}"
47
+ say "g`#{key}=#{value}`"
48
48
  end
49
49
 
50
50
  def del_command
51
51
  key = args['KEY'].to_sym
52
52
  Config.delete key
53
53
  Config.save
54
- say '!txtgrn!Deleted'
54
+ say 'g`Deleted`'
55
55
  end
56
56
 
57
57
  def show_command
58
- say "!undpur!# #{Config.path}"
58
+ say "mu`# #{Config.path}`"
59
59
  if File.exist? Config.path
60
60
  puts File.read Config.path
61
61
  else
62
- say '!txtred!File Not Found'
62
+ say 'r`File Not Found`'
63
63
  end
64
64
  end
65
65
 
@@ -70,7 +70,7 @@ module AudioAddict
70
70
 
71
71
  def guide_command
72
72
  key_guide.each do |key, value|
73
- say "!txtgrn!#{key}"
73
+ say "g`#{key}`"
74
74
  say word_wrap " #{value}"
75
75
  say ''
76
76
  end
@@ -88,12 +88,12 @@ module AudioAddict
88
88
 
89
89
  def verify_and_show_keys(keys, critical: false)
90
90
  problems = 0
91
- prefix = critical ? '!txtred!Error !txtrst!' : '!txtylw!Warning!txtrst!'
91
+ prefix = critical ? 'r`Error `' : 'y`Warning`'
92
92
 
93
93
  keys.each do |key, command|
94
94
  unless Config.has_key? key
95
95
  problems += 1
96
- say "#{prefix} : Key !txtgrn!#{key}!txtrst! is not set. Fix with !txtpur!radio #{command}!txtrst!."
96
+ say "#{prefix} : Key g`#{key}` is not set. Fix with m`radio #{command}`."
97
97
  end
98
98
  end
99
99
 
@@ -102,11 +102,11 @@ module AudioAddict
102
102
 
103
103
  def key_guide
104
104
  {
105
- email: "Last email used for logging in.\nUsually set with !txtpur!radio login!txtrst!.",
106
- session_key: "Used for authentication.\nUsually set with !txtpur!radio login!txtrst!.",
107
- listen_key: "Used for generating playlists.\nUsually set with !txtpur!radio login!txtrst!.",
108
- network: "Specify the AudioAddict network you are currently listening to.\nUsually set with !txtpur!radio set!txtrst!.",
109
- channel: "Specify the AudioAddict channel you are currently listening to.\nUsually set with !txtpur!radio set!txtrst!.",
105
+ email: "Last email used for logging in.\nUsually set with m`radio login`.",
106
+ session_key: "Used for authentication.\nUsually set with m`radio login`.",
107
+ listen_key: "Used for generating playlists.\nUsually set with m`radio login`.",
108
+ network: "Specify the AudioAddict network you are currently listening to.\nUsually set with m`radio set`.",
109
+ channel: "Specify the AudioAddict channel you are currently listening to.\nUsually set with m`radio set`.",
110
110
  like_log: "Specify the path to store all your positive votes.\nIf this is not set, votes will only be sent to AudioAddict and not logged locally.",
111
111
  cache_dir: "Specify the path to store API response cache.\nDefault: ~/.audio_addict/cache",
112
112
  cache_life: "Specify the cache life period.\nDefault: 6h.",
@@ -30,12 +30,12 @@ module AudioAddict
30
30
  def current_command
31
31
  needs :network, :channel
32
32
 
33
- say '!txtblu!Downloading !txtrst!: ... '
33
+ say 'b`Downloading` : ... '
34
34
 
35
35
  track = current_channel.current_track
36
36
  query = track.search_string
37
37
 
38
- resay "!txtblu!Downloading !txtgrn!: #{query}"
38
+ say "b`Downloading` : g`#{query}`", replace: true
39
39
 
40
40
  Youtube.new(query).get count
41
41
  end
@@ -48,7 +48,7 @@ module AudioAddict
48
48
  data.each do |line|
49
49
  _network, _channel, artist, song = line.split(' :: ')
50
50
  query = "#{artist}, #{song}"
51
- say "\n!txtblu!Downloading !txtgrn!: #{query}"
51
+ say "\nb`Downloading` : g`#{query}`"
52
52
  Youtube.new(query).get count
53
53
  end
54
54
  end
@@ -56,7 +56,7 @@ module AudioAddict
56
56
  def search_command
57
57
  query = args['QUERY']
58
58
 
59
- say "\n!txtblu!Downloading !txtgrn!: #{query}"
59
+ say "\nb`Downloading` : g`#{query}`"
60
60
  Youtube.new(query).get count
61
61
  end
62
62
 
@@ -10,10 +10,10 @@ module AudioAddict
10
10
 
11
11
  def run
12
12
  needs :network, :channel
13
- say "!undgrn!#{radio.name} > #{current_channel.name}"
13
+ say "gu`#{radio.name} > #{current_channel.name}`"
14
14
  say ''
15
15
  tracks.each do |track|
16
- say "!txtgrn! #{track.artist.rjust max_artist_len}!txtrst! : !txtblu!#{track.title}"
16
+ say "g` #{track.artist.rjust max_artist_len}` : b`#{track.title}`"
17
17
  end
18
18
  end
19
19
 
@@ -45,7 +45,7 @@ module AudioAddict
45
45
  def sort_command
46
46
  needs :like_log
47
47
  log.sort
48
- say '!txtgrn!Sorted'
48
+ say 'g`Sorted`'
49
49
  end
50
50
 
51
51
  def browse_command
@@ -59,7 +59,7 @@ module AudioAddict
59
59
  per_page: page_size
60
60
 
61
61
  say 'Songs:'
62
- tree[network][channel][artist].each { |song| say "- !txtgrn!#{song}" }
62
+ tree[network][channel][artist].each { |song| say "- g`#{song}`" }
63
63
  say ''
64
64
 
65
65
  browse_command if prompt.yes?('Again?')
@@ -71,7 +71,7 @@ module AudioAddict
71
71
 
72
72
  if filename
73
73
  File.write filename, yaml
74
- say "!txtgrn!Saved #{filename}"
74
+ say "g`Saved #{filename}`"
75
75
  else
76
76
  puts yaml
77
77
  end
@@ -84,7 +84,7 @@ module AudioAddict
84
84
  end
85
85
 
86
86
  def page_size
87
- @page_size ||= detect_terminal_size[1] - 4
87
+ @page_size ||= terminal_height - 4
88
88
  end
89
89
  end
90
90
  end
@@ -12,7 +12,7 @@ module AudioAddict
12
12
  proceed = true
13
13
 
14
14
  if radio.api.logged_in?
15
- say "!txtylw!You are already logged in as !undylw!#{Config.email}"
15
+ say "y`You are already logged in as` yu`#{Config.email}`"
16
16
  proceed = prompt.yes? 'Login again?'
17
17
  end
18
18
 
@@ -28,9 +28,9 @@ module AudioAddict
28
28
  if user && pass
29
29
  say 'Logging in... '
30
30
  radio.api.login user, pass
31
- resay '!txtgrn!Saved'
31
+ say 'g`Saved`', replace: true
32
32
  else
33
- say '!txtred!Cancelled'
33
+ say 'r`Cancelled`'
34
34
  end
35
35
  end
36
36
  end
@@ -11,13 +11,13 @@ module AudioAddict
11
11
  def run
12
12
  needs :network, :channel
13
13
 
14
- say "!txtblu! Network !txtrst!: !txtgrn!#{radio.name}!txtrst! # #{radio.network}"
15
- say "!txtblu! Channel !txtrst!: !txtgrn!#{current_channel.name}!txtrst! # #{current_channel.key}"
16
- say '!txtblu! Track !txtrst!: ... '
14
+ say "b` Network `: g`#{radio.name}` # #{radio.network}"
15
+ say "b` Channel `: g`#{current_channel.name}` # #{current_channel.key}"
16
+ say 'b` Track `: ... '
17
17
 
18
18
  track = current_channel.current_track
19
- resay "!txtblu! Track !txtrst!: !txtgrn!#{track.title.strip}"
20
- say "!txtblu! By !txtrst!: !txtgrn!#{track.artist.strip}"
19
+ say "b` Track `: g`#{track.title.strip}`", replace: true
20
+ say "b` By `: g`#{track.artist.strip}`"
21
21
  end
22
22
  end
23
23
  end
@@ -26,7 +26,7 @@ module AudioAddict
26
26
  name = args['NAME']
27
27
  outfile = "#{name}.yml"
28
28
 
29
- say "!txtred!Warning!txtrst!: !txtgrn!#{outfile}!txtrst! already exists!" if File.exist? outfile
29
+ say "r`Warningr`: g`#{outfile}` already exists!" if File.exist? outfile
30
30
  proceed = prompt.yes? "Create #{outfile}?"
31
31
  return unless proceed
32
32
 
@@ -46,11 +46,11 @@ module AudioAddict
46
46
  outfile = "#{name}.pls"
47
47
 
48
48
  if File.exist? infile
49
- say "!txtred!Warning!txtrst!: !txtgrn!#{outfile}!txtrst! already exists!" if File.exist? outfile
49
+ say "r`Warning`: g`#{outfile}` already exists!" if File.exist? outfile
50
50
  proceed = prompt.yes? "Create #{outfile}?"
51
51
  generate_playlist infile, outfile if proceed
52
52
  else
53
- say "!txtred!Cannot find #{infile}"
53
+ say "r`Cannot find #{infile}`"
54
54
  end
55
55
  end
56
56
 
@@ -68,7 +68,7 @@ module AudioAddict
68
68
  data[:channels] = channels
69
69
 
70
70
  File.write outfile, data.to_yaml
71
- say "Saved !txtgrn!#{outfile}"
71
+ say "Saved g`#{outfile}`"
72
72
  end
73
73
 
74
74
  def generate_playlist(infile, outfile)
@@ -92,7 +92,7 @@ module AudioAddict
92
92
  output = "#{output.join("\n")}\n"
93
93
 
94
94
  File.write outfile, output
95
- say "Saved !txtgrn!#{outfile}"
95
+ say "Saved g`#{outfile}`"
96
96
  end
97
97
 
98
98
  def template_params(channel_key)
@@ -59,7 +59,7 @@ module AudioAddict
59
59
  elsif radio.search(channel).any?
60
60
  channel_menu channel
61
61
  else
62
- say "!txtred!Invalid channel: #{radio.name} > #{channel}"
62
+ say "r`Invalid channel: #{radio.name} > #{channel}`"
63
63
  end
64
64
  end
65
65
 
@@ -100,13 +100,13 @@ module AudioAddict
100
100
  def save_channel(channel, echo: true)
101
101
  Config.channel = channel
102
102
  Config.save
103
- say "Channel : !txtgrn!#{radio.name} > #{current_channel.name}!txtrst! # #{channel}" if echo
103
+ say "Channel : g`#{radio.name} > #{current_channel.name}` # #{channel}" if echo
104
104
  end
105
105
 
106
106
  def save_network(network, echo: true)
107
107
  Config.network = network
108
108
  Config.save
109
- say "Network : !txtgrn!#{radio.name}!txtrst! # #{network}" if echo
109
+ say "Network : g`#{radio.name}` # #{network}" if echo
110
110
  end
111
111
  end
112
112
  end
@@ -42,7 +42,7 @@ module AudioAddict
42
42
  def send_vote(vote, track = nil)
43
43
  say 'Voting... '
44
44
  current_channel.vote vote, track: track
45
- resay '!txtgrn!Voted'
45
+ say 'g`Voted`', replace: true
46
46
  end
47
47
 
48
48
  def tracks
@@ -1,3 +1,3 @@
1
1
  module AudioAddict
2
- VERSION = '0.4.4'
2
+ VERSION = '0.4.6'
3
3
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audio_addict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-16 00:00:00.000000000 Z
11
+ date: 2023-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.8.1
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: 0.7.0
22
+ version: '2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.8.1
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: 0.7.0
32
+ version: '2'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: httparty
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -44,28 +50,28 @@ dependencies:
44
50
  requirements:
45
51
  - - "~>"
46
52
  - !ruby/object:Gem::Version
47
- version: 0.3.3
53
+ version: '0.3'
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
58
  - - "~>"
53
59
  - !ruby/object:Gem::Version
54
- version: 0.3.3
60
+ version: '0.3'
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: mister_bin
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: 0.7.3
67
+ version: '0.7'
62
68
  type: :runtime
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
72
  - - "~>"
67
73
  - !ruby/object:Gem::Version
68
- version: 0.7.3
74
+ version: '0.7'
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: requires
71
77
  requirement: !ruby/object:Gem::Requirement
@@ -151,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
157
  - !ruby/object:Gem::Version
152
158
  version: '0'
153
159
  requirements: []
154
- rubygems_version: 3.4.3
160
+ rubygems_version: 3.4.5
155
161
  signing_key:
156
162
  specification_version: 4
157
163
  summary: AudioAddict Command Line