subcl 1.1.0 → 1.1.1
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 +4 -4
- data/lib/subcl/subcl.rb +7 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eafcc67f7917cd55aa322705366dc3361e7e6545
|
4
|
+
data.tar.gz: deb40883dc7d4f41a3f3ce57880a25bf2c11b1be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 476ac05a7de41e4079078e7a2a6e4d1d5c20d5fa5c29766176a0eabd3eda3b58faa2c6bf60a666dcc7bfaa19dff892d19e8a9b3849ed578eee8f21516b44b3ab
|
7
|
+
data.tar.gz: 7ac85d384fd3da414123433db4bb59a64995e375fa287d73faf7a7797ad0aaf317af8cebf71493f3d9318ccae12a7a685ec00d9cd31237110c09b180510b5bd0
|
data/lib/subcl/subcl.rb
CHANGED
@@ -3,6 +3,7 @@ class Subcl
|
|
3
3
|
attr_accessor :player, :api, :notifier
|
4
4
|
|
5
5
|
def initialize(options = {})
|
6
|
+
#TODO merge options and configs
|
6
7
|
@options = {
|
7
8
|
:interactive => true,
|
8
9
|
:tty => true,
|
@@ -22,6 +23,8 @@ class Subcl
|
|
22
23
|
exit 4
|
23
24
|
end
|
24
25
|
|
26
|
+
@configs[:random_song_count] = @options[:random_song_count] if @options[:random_song_count]
|
27
|
+
|
25
28
|
@player = @options[:mock_player] || Player.new
|
26
29
|
|
27
30
|
@api = @options[:mock_api] || SubsonicAPI.new(@configs)
|
@@ -46,8 +49,8 @@ class Subcl
|
|
46
49
|
end
|
47
50
|
|
48
51
|
def albumart_url(size = nil)
|
49
|
-
current = @player.
|
50
|
-
@api.albumart_url(current, size)
|
52
|
+
current = @player.current_song
|
53
|
+
@api.albumart_url(current.file, size) if current
|
51
54
|
end
|
52
55
|
|
53
56
|
def queue(query, type, inArgs = {})
|
@@ -72,7 +75,8 @@ class Subcl
|
|
72
75
|
songs = case type
|
73
76
|
when :randomSong
|
74
77
|
begin
|
75
|
-
@
|
78
|
+
count = query.empty? ? @configs[:random_song_count] : query
|
79
|
+
@api.random_songs(count)
|
76
80
|
rescue ArgumentError
|
77
81
|
raise ArgumentError, "random-songs takes an integer as argument"
|
78
82
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: subcl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Latzer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|