ruby-mpd 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/lib/ruby-mpd/playlist.rb +11 -1
- data/lib/ruby-mpd/version.rb +1 -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: b78cfe440cb52c23cdb96e3c920797cec192adf4
|
4
|
+
data.tar.gz: 7bcbd0c9634377e11617dc2e71c9754d8435300f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cc8405f580660de9322ff63eaa01b34d85b593b394f5583fa71a9f158eea97bd1247e7e779053873a4b19740d73ae54402061a3164042078cadae4cf70fcd4e
|
7
|
+
data.tar.gz: 2f529fee81a65c1b676956181c11c3b066f8e0a7c3a4a68ba737efd45e70433a1b7b6c3acd7406f10cd0e75dcfbce6765629a96601cbccf3909317334ce90273
|
data/lib/ruby-mpd/playlist.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "uri"
|
2
|
+
|
1
3
|
class MPD
|
2
4
|
# An object representing an .m3u playlist stored by MPD.
|
3
5
|
#
|
@@ -22,7 +24,15 @@ class MPD
|
|
22
24
|
# Lists the songs in the playlist. Playlist plugins are supported.
|
23
25
|
# @return [Array<MPD::Song>] songs in the playlist.
|
24
26
|
def songs
|
25
|
-
@mpd.send_command(:listplaylistinfo, @name)
|
27
|
+
result = @mpd.send_command(:listplaylistinfo, @name)
|
28
|
+
if result.to_s =~ URI::regexp
|
29
|
+
Song.new({:file => result, :time => 0})
|
30
|
+
else
|
31
|
+
result.map {|hash| Song.new(hash) }
|
32
|
+
end
|
33
|
+
rescue TypeError
|
34
|
+
puts "Files inside Playlist '#{@name}' do not exist!"
|
35
|
+
return nil
|
26
36
|
rescue NotFound
|
27
37
|
return [] # we rescue in the case the playlist doesn't exist.
|
28
38
|
end
|
data/lib/ruby-mpd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-mpd
|
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
|
- Blaž Hrastnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A powerful, modern and feature complete library for the Music Player
|
14
14
|
Daemon.
|