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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/subcl/subcl.rb +7 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cce8d7f636cf3a5898c7ce68aa2287a8dcc6673d
4
- data.tar.gz: 1df467a85ba4ab604668844a359704200ee4c88c
3
+ metadata.gz: eafcc67f7917cd55aa322705366dc3361e7e6545
4
+ data.tar.gz: deb40883dc7d4f41a3f3ce57880a25bf2c11b1be
5
5
  SHA512:
6
- metadata.gz: adae72dbd6ab95c0501234706cdeceeb41fece5aacabf5847dd020c060e4d9a3f8cc36010ad34f70bd6c98bbe818b813f509711f98c2d7fd5bd7258ae2064513
7
- data.tar.gz: 8a5219d0d537d6d8450de8518d334084ddcea5be42709c8db0e4871db4bd468fb2bf22c0af3c430b1231176cbad23b46e18b75e674e2c0ec1a150278eb94da8a
6
+ metadata.gz: 476ac05a7de41e4079078e7a2a6e4d1d5c20d5fa5c29766176a0eabd3eda3b58faa2c6bf60a666dcc7bfaa19dff892d19e8a9b3849ed578eee8f21516b44b3ab
7
+ data.tar.gz: 7ac85d384fd3da414123433db4bb59a64995e375fa287d73faf7a7797ad0aaf317af8cebf71493f3d9318ccae12a7a685ec00d9cd31237110c09b180510b5bd0
@@ -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.current
50
- @api.albumart_url(current, size) unless current.empty?
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
- @api.random_songs(query)
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.0
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-21 00:00:00.000000000 Z
11
+ date: 2014-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec