muzak 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d627d0c95c41896f1c8acb0b47403f240924571
4
- data.tar.gz: 11f8e33ea6d45befe35fdffcc20b1cba87a05b7a
3
+ metadata.gz: fc187bfa8da7fb7a6622bf25b063aed6ab25062b
4
+ data.tar.gz: 85fea7679610e4f949be1b87ca8f141ba1c17d90
5
5
  SHA512:
6
- metadata.gz: e6581bb5f6a785076619b44596f09ab3835a47be33e23e0e0bd1b1b032caee4ceefde24144abbc23c0e09d4158abc86ee7e33fbb04a09e1c3d91b336aded6ded
7
- data.tar.gz: 6c46c4694d1cfbb67e2e9cbfdbd2eb02899747cef65d10a195efd8daccb27dcc0b39a737108923e11d8470b73bb7f4b59761755936a6095d095b93a263151ec2
6
+ metadata.gz: 3b74e7a470a49f5fa099d89ae843b1d3eb0b3384136da673a0eecefa0c2b007a914a87bf6c0878e31c02943397ee3b475fbbdbce26b195c2e5581129927c41c2
7
+ data.tar.gz: 62e8301ff354acc40ffd9d0ea858d899c9addc5fe776103e85681de2654fb1ecb57c6fe29006343a34807cb0061008a0540887e31a0d9b659350544861a3c3e5
@@ -12,5 +12,5 @@ require_relative "muzak/instance"
12
12
  # The primary namespace for muzak.
13
13
  module Muzak
14
14
  # Muzak's current version
15
- VERSION = "0.4.1".freeze
15
+ VERSION = "0.4.2".freeze
16
16
  end
@@ -41,6 +41,8 @@ module Muzak
41
41
  # @return [void]
42
42
  # @note Does nothing is playback is already in progress.
43
43
  def play
44
+ return unless running?
45
+
44
46
  @mpd.play
45
47
  end
46
48
 
@@ -48,7 +50,9 @@ module Muzak
48
50
  # @return [void]
49
51
  # @note Does nothing is playback is already paused.
50
52
  def pause
51
- @mpd.pause
53
+ return unless running?
54
+
55
+ @mpd.pause = 1
52
56
  end
53
57
 
54
58
  # @return [Boolean] whether or not MPD is currently playing.
@@ -146,7 +150,7 @@ module Muzak
146
150
  def load_song(song)
147
151
  path = song.path.sub("#{Config.music}/", "")
148
152
  @mpd.add(path)
149
- @mpd.play if Config.autoplay
153
+ @mpd.play if Config.autoplay && !playing?
150
154
  end
151
155
  end
152
156
  end
@@ -43,6 +43,8 @@ module Muzak
43
43
  # @return [void]
44
44
  # @note Does nothing is playback is already in progress.
45
45
  def play
46
+ return unless running?
47
+
46
48
  @vlc.play
47
49
  end
48
50
 
@@ -50,6 +52,8 @@ module Muzak
50
52
  # @return [void]
51
53
  # @note Does nothing is playback is already paused.
52
54
  def pause
55
+ return unless running?
56
+
53
57
  @vlc.pause
54
58
  end
55
59
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muzak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Woodruff