audio_addict 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/audio_addict/commands/api.rb +4 -6
- data/lib/audio_addict/commands/channels.rb +1 -1
- data/lib/audio_addict/commands/config.rb +6 -6
- data/lib/audio_addict/commands/history.rb +1 -1
- data/lib/audio_addict/commands/log.rb +5 -5
- data/lib/audio_addict/commands/login.rb +1 -1
- data/lib/audio_addict/commands/now.rb +1 -1
- data/lib/audio_addict/commands/playlist.rb +4 -4
- data/lib/audio_addict/commands/set.rb +1 -1
- data/lib/audio_addict/commands/status.rb +1 -1
- data/lib/audio_addict/commands/vote.rb +5 -6
- data/lib/audio_addict/track.rb +1 -2
- data/lib/audio_addict/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e98bede170290fa6e000488a47a72cea69f075d4459eed74e41c2a8a62b1e2d
|
4
|
+
data.tar.gz: a0affe335ff060dc9cb9c1c01bdf52a40d72306790b80ed071d5e01fa5360f48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f0761d4670e92c4f7ca8c3af73f36dce7740cc23f76b8b0377f6764c52749eecea885e78a0671695ad0db162c7ef6c87e334f5f1606de9f6ffe31ea9b22a3b5
|
7
|
+
data.tar.gz: f30f1e8c47646cd1c34ef065c5b223492f5ffc8d72e31aafaf8c83bf7b446c699db6bd76815e009f80ddc7ff518bbb89b575576831578c8f6c220e37344f6cec
|
@@ -14,10 +14,8 @@ module AudioAddict
|
|
14
14
|
example "radio get track_history/channel/1"
|
15
15
|
example "radio post tracks/1/vote/2/up"
|
16
16
|
|
17
|
-
def run
|
17
|
+
def run
|
18
18
|
needs :network
|
19
|
-
@args = args
|
20
|
-
|
21
19
|
response = api.send(api_method, endpoint)
|
22
20
|
puts response.to_yaml
|
23
21
|
end
|
@@ -25,13 +23,13 @@ module AudioAddict
|
|
25
23
|
private
|
26
24
|
|
27
25
|
def api_method
|
28
|
-
return :post if
|
29
|
-
return :delete if
|
26
|
+
return :post if args['post']
|
27
|
+
return :delete if args['delete']
|
30
28
|
return :get
|
31
29
|
end
|
32
30
|
|
33
31
|
def endpoint
|
34
|
-
|
32
|
+
args['ENDPOINT']
|
35
33
|
end
|
36
34
|
|
37
35
|
def api
|
@@ -29,13 +29,13 @@ module AudioAddict
|
|
29
29
|
example "radio config del session_key"
|
30
30
|
example "radio config get listen_key"
|
31
31
|
|
32
|
-
def get_command
|
32
|
+
def get_command
|
33
33
|
key = args['KEY'].to_sym
|
34
34
|
value = Config.properties[key]
|
35
35
|
say value ? "!txtgrn!#{value}" : "!txtred!<Unset>"
|
36
36
|
end
|
37
37
|
|
38
|
-
def set_command
|
38
|
+
def set_command
|
39
39
|
key = args['KEY'].to_sym
|
40
40
|
value = args['VALUE']
|
41
41
|
Config.properties[key] = value
|
@@ -43,14 +43,14 @@ module AudioAddict
|
|
43
43
|
say "!txtgrn!#{key}=#{value}"
|
44
44
|
end
|
45
45
|
|
46
|
-
def del_command
|
46
|
+
def del_command
|
47
47
|
key = args['KEY'].to_sym
|
48
48
|
Config.delete key
|
49
49
|
Config.save
|
50
50
|
say "!txtgrn!Deleted"
|
51
51
|
end
|
52
52
|
|
53
|
-
def show_command
|
53
|
+
def show_command
|
54
54
|
say "!undpur!# #{Config.path}"
|
55
55
|
if File.exist? Config.path
|
56
56
|
puts File.read Config.path
|
@@ -59,12 +59,12 @@ module AudioAddict
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
def edit_command
|
62
|
+
def edit_command
|
63
63
|
editor = ENV['EDITOR'] || 'vi'
|
64
64
|
system "#{editor} #{Config.path}"
|
65
65
|
end
|
66
66
|
|
67
|
-
def guide_command
|
67
|
+
def guide_command
|
68
68
|
key_guide.each do |key, value|
|
69
69
|
say "!txtgrn!#{key}"
|
70
70
|
say word_wrap " #{value}"
|
@@ -28,25 +28,25 @@ module AudioAddict
|
|
28
28
|
example "radio log sort"
|
29
29
|
example "radio log tree --save out.yml"
|
30
30
|
|
31
|
-
def show_command
|
31
|
+
def show_command
|
32
32
|
needs :like_log
|
33
33
|
query = args['SEARCH']
|
34
34
|
puts query ? log.search(query) : log.data
|
35
35
|
end
|
36
36
|
|
37
|
-
def tail_command
|
37
|
+
def tail_command
|
38
38
|
needs :like_log
|
39
39
|
lines = args['--lines'].to_i
|
40
40
|
puts log.data[-lines..-1]
|
41
41
|
end
|
42
42
|
|
43
|
-
def sort_command
|
43
|
+
def sort_command
|
44
44
|
needs :like_log
|
45
45
|
log.sort
|
46
46
|
say "!txtgrn!Sorted"
|
47
47
|
end
|
48
48
|
|
49
|
-
def browse_command
|
49
|
+
def browse_command
|
50
50
|
tree = log.tree
|
51
51
|
|
52
52
|
say ""
|
@@ -61,7 +61,7 @@ module AudioAddict
|
|
61
61
|
browse_command if prompt.yes?("Again?")
|
62
62
|
end
|
63
63
|
|
64
|
-
def tree_command
|
64
|
+
def tree_command
|
65
65
|
yaml = log.tree.to_yaml
|
66
66
|
filename = args['--save']
|
67
67
|
|
@@ -15,7 +15,7 @@ module AudioAddict
|
|
15
15
|
example "radio playlist init MyRockMusic"
|
16
16
|
example "radio playlist generate MyRockMusic"
|
17
17
|
|
18
|
-
def init_command
|
18
|
+
def init_command
|
19
19
|
needs :network, :channel, :listen_key
|
20
20
|
|
21
21
|
require_premium_account
|
@@ -28,16 +28,16 @@ module AudioAddict
|
|
28
28
|
if proceed
|
29
29
|
generate_config outfile
|
30
30
|
say ""
|
31
|
-
generate_command
|
31
|
+
generate_command name
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
def generate_command(
|
35
|
+
def generate_command(name=nil)
|
36
36
|
needs :network, :channel, :listen_key
|
37
37
|
|
38
38
|
require_premium_account
|
39
39
|
|
40
|
-
name
|
40
|
+
name ||= args['NAME']
|
41
41
|
|
42
42
|
infile = "#{name}.yml"
|
43
43
|
outfile = "#{name}.pls"
|
@@ -17,9 +17,8 @@ module AudioAddict
|
|
17
17
|
example "radio vote --all --past"
|
18
18
|
example "radio vote -ap"
|
19
19
|
|
20
|
-
def run
|
20
|
+
def run
|
21
21
|
needs :network, :channel, :session_key
|
22
|
-
@args = args
|
23
22
|
vote_mode == :now ? vote_now : vote_past
|
24
23
|
end
|
25
24
|
|
@@ -34,7 +33,7 @@ module AudioAddict
|
|
34
33
|
end
|
35
34
|
|
36
35
|
def vote_now
|
37
|
-
NowCmd.new.run
|
36
|
+
NowCmd.new(args).run
|
38
37
|
puts ""
|
39
38
|
vote = get_user_vote
|
40
39
|
send_vote vote unless vote == :cancel
|
@@ -76,13 +75,13 @@ module AudioAddict
|
|
76
75
|
end
|
77
76
|
|
78
77
|
def vote_style
|
79
|
-
|
78
|
+
args['--all'] ? :menu : :simple
|
80
79
|
end
|
81
80
|
|
82
81
|
def vote_mode
|
83
|
-
|
82
|
+
args['--past'] ? :past : :now
|
84
83
|
end
|
85
84
|
|
86
85
|
end
|
87
86
|
end
|
88
|
-
end
|
87
|
+
end
|
data/lib/audio_addict/track.rb
CHANGED
data/lib/audio_addict/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: audio_addict
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
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: 2018-12-
|
11
|
+
date: 2018-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colsole
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0.
|
61
|
+
version: '0.6'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0.
|
68
|
+
version: '0.6'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: requires
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|