muzak 0.2.2 → 0.2.3
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/bin/muzak-index +6 -9
- data/lib/muzak/const.rb +1 -1
- data/lib/muzak/player/mpv.rb +2 -1
- data/lib/muzak/song.rb +3 -1
- 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: c0f970a0a6e2731b8014245f91e9b97e10bdbfa8
|
4
|
+
data.tar.gz: 0c8d58beb2f2bd3b8cf77af94a6a4e8aef753b0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd1b4f8bc4af206042d99b6156d1dd90d57cb263d0a2885e8d29b4ce4d25b56ba13358ce1dc23d28142a9f0a9228e419f1816df5aa1619c05a31d2e8b07ba102
|
7
|
+
data.tar.gz: 12bc26a48046a905bcd3678b8e829fc5f2a221f13eee34ce0d0d87bcc72add2528c5f37244ce0d272999f2d58647b42558991cbc5fb62d57c0ff2b82a100f7de
|
data/bin/muzak-index
CHANGED
@@ -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).
|
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
|
-
|
67
|
-
|
68
|
-
|
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 "
|
71
|
+
info "indexing '#{artist}' - '#{album}'..."
|
75
72
|
|
76
73
|
album_hash = {}
|
77
74
|
album_hash["songs"] = []
|
data/lib/muzak/const.rb
CHANGED
data/lib/muzak/player/mpv.rb
CHANGED
@@ -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
|
data/lib/muzak/song.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2017-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: taglib-ruby
|