muzak 0.2.2 → 0.2.3

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: 171a96f96d977d9cb964db7e1e14643117921dbe
4
- data.tar.gz: 9cea9f8e1f6f229b24e6974b2efc698c3a9d5cd9
3
+ metadata.gz: c0f970a0a6e2731b8014245f91e9b97e10bdbfa8
4
+ data.tar.gz: 0c8d58beb2f2bd3b8cf77af94a6a4e8aef753b0c
5
5
  SHA512:
6
- metadata.gz: dae34d10b94fb1f44e689209edef9e72e78ad42f1dcfb0ea50abf56f0e53f95c1317b25b20d964f89bdb7d4e41b974489535831da9a1e414a8de1a53965a72b9
7
- data.tar.gz: 9283f7fa57a368be217d41c8b30e18385481bc4cc08b5a75d9427f5ede6522233f777014299cf7d935ecfb0b6ddaf2ef22aaebff24eef027f8e9f4dc688a594d
6
+ metadata.gz: bd1b4f8bc4af206042d99b6156d1dd90d57cb263d0a2885e8d29b4ce4d25b56ba13358ce1dc23d28142a9f0a9228e419f1816df5aa1619c05a31d2e8b07ba102
7
+ data.tar.gz: 12bc26a48046a905bcd3678b8e829fc5f2a221f13eee34ce0d0d87bcc72add2528c5f37244ce0d272999f2d58647b42558991cbc5fb62d57c0ff2b82a100f7de
@@ -55,23 +55,20 @@ index_file = ARGV.shift || Muzak::INDEX_FILE
55
55
  index_hash = {
56
56
  "tree" => tree,
57
57
  "timestamp" => Time.now.to_i,
58
- "artists" => {},
59
58
  "deep" => OPTS[:deep]
60
59
  }
61
60
 
62
- Dir.entries(tree).each do |artist|
63
- next unless File.directory?(File.join(tree, artist))
64
- next if artist.start_with?(".")
61
+ artist_names = Dir.entries(tree).reject! { |ent| ent.start_with?(".") }
65
62
 
66
- info "indexing '#{artist}'..."
67
-
68
- index_hash["artists"][artist] = {}
69
- index_hash["artists"][artist]["albums"] = {}
63
+ index_hash["artists"] = artist_names.map do |artist|
64
+ [artist, { "albums" => {} }]
65
+ end.to_h
70
66
 
67
+ artist_names.each do |artist|
71
68
  Dir.entries(File.join(tree, artist)).each do |album|
72
69
  next if album.start_with?(".")
73
70
 
74
- info "\tindexing '#{album}'..."
71
+ info "indexing '#{artist}' - '#{album}'..."
75
72
 
76
73
  album_hash = {}
77
74
  album_hash["songs"] = []
@@ -1,6 +1,6 @@
1
1
  module Muzak
2
2
  # Muzak's current version
3
- VERSION = "0.2.2".freeze
3
+ VERSION = "0.2.3".freeze
4
4
 
5
5
  # The root directory for all user configuration, data, etc
6
6
  CONFIG_DIR = File.expand_path("~/.config/muzak").freeze
@@ -80,6 +80,7 @@ module Muzak
80
80
 
81
81
  @socket.close
82
82
  ensure
83
+ @_now_playing = nil
83
84
  instance.event :player_deactivated
84
85
  File.delete(@sock_path) if @sock_path && File.exists?(@sock_path)
85
86
  end
@@ -227,7 +228,7 @@ module Muzak
227
228
  else
228
229
  @result_queue << response
229
230
  end
230
- rescue EOFError # the player is deactivating
231
+ rescue EOFError, IOError # the player is deactivating
231
232
  Thread.exit
232
233
  end
233
234
  end
@@ -76,8 +76,10 @@ module Muzak
76
76
  full
77
77
  end
78
78
 
79
+ # @return [Boolean] whether or not the given object is equal to this one
80
+ # @note compares song paths, not metadata
79
81
  def ==(other)
80
- path == other.path
82
+ other.is_a?(Song) && path == other.path
81
83
  end
82
84
  end
83
85
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muzak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Woodruff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-10 00:00:00.000000000 Z
11
+ date: 2017-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: taglib-ruby