mr_eko 0.3.1 → 0.3.2
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.
- data/README.md +6 -3
- data/bin/mreko +14 -4
- data/lib/mr_eko/song.rb +2 -2
- data/lib/mr_eko.rb +1 -1
- data/mr_eko.gemspec +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -4,8 +4,11 @@ MrEko analyzes your music and lets you ask him in-depth questions about it. He
|
|
4
4
|
|
5
5
|
Example:
|
6
6
|
--------
|
7
|
-
# Scan
|
8
|
-
mreko scan ~/Music
|
7
|
+
# Scan a directory, recursively:
|
8
|
+
mreko scan ~/Music/iTunes
|
9
|
+
|
10
|
+
# Scan a set of files
|
11
|
+
mreko scan jakob-semaphore.mp3 pelican-drought.mp3
|
9
12
|
|
10
13
|
# Output a PLS playlist of fast, minor-key music
|
11
14
|
mreko playlist --tempo '>120' --mode minor --format pls > rainy_day_suicidal_playlist.pls
|
@@ -16,7 +19,7 @@ Example:
|
|
16
19
|
Requirements:
|
17
20
|
-------------
|
18
21
|
* [ffmpeg](http://www.ffmpeg.org/download.htmlr) in your path.
|
19
|
-
* an [Echonest API token](http://developer.echonest.com/) which goes here: ~/.
|
22
|
+
* an [Echonest API token](http://developer.echonest.com/) which goes here: ~/.mreko/echonest_api.key
|
20
23
|
|
21
24
|
Notes:
|
22
25
|
------
|
data/bin/mreko
CHANGED
@@ -13,10 +13,11 @@ def parse_options
|
|
13
13
|
options = { :format => :text }
|
14
14
|
|
15
15
|
OptionParser.new do |opts|
|
16
|
-
opts.banner = "Usage: #{$0} [options]"
|
16
|
+
opts.banner = "Usage: #{$0} scan|playlist [options]"
|
17
17
|
|
18
18
|
opts.separator ""
|
19
|
-
opts.separator "
|
19
|
+
opts.separator "Playlist options:"
|
20
|
+
|
20
21
|
opts.on("-p", "--preset NAME", String, "Select a preset. Options are (#{MrEko::Presets::FACTORY.keys.join(', ')})") do |preset|
|
21
22
|
options[:preset] = preset
|
22
23
|
end
|
@@ -65,7 +66,6 @@ def parse_options
|
|
65
66
|
end
|
66
67
|
|
67
68
|
opts.separator ""
|
68
|
-
opts.separator "Common options:"
|
69
69
|
|
70
70
|
# No argument, shows at tail. This will print an options summary.
|
71
71
|
opts.on_tail("-h", "--help", "Show this message") do
|
@@ -84,7 +84,17 @@ options = parse_options
|
|
84
84
|
case ARGV[0]
|
85
85
|
when 'scan'
|
86
86
|
ARGV.shift
|
87
|
-
|
87
|
+
|
88
|
+
files = ARGV.map do |arg|
|
89
|
+
if File.directory?(arg)
|
90
|
+
Dir.glob("#{arg}/**/*.mp3")
|
91
|
+
else
|
92
|
+
File.expand_path arg
|
93
|
+
end
|
94
|
+
end.flatten
|
95
|
+
|
96
|
+
puts "Found #{files.length} MP3s to process..."
|
97
|
+
files.each do |file|
|
88
98
|
MrEko::Song.create_from_file!(file, options)
|
89
99
|
end
|
90
100
|
when 'playlist'
|
data/lib/mr_eko/song.rb
CHANGED
@@ -196,8 +196,8 @@ class MrEko::Song < Sequel::Model
|
|
196
196
|
File.expand_path File.join(MrEko::FINGERPRINTS_DIR, "#{md5}.json")
|
197
197
|
end
|
198
198
|
|
199
|
-
# @param [ID3Lib::Tag]
|
200
|
-
# @return [ID3Lib::Tag]
|
199
|
+
# @param [Array<ID3Lib::Tag>]
|
200
|
+
# @return [Array<ID3Lib::Tag>]
|
201
201
|
def self.clean_tags(tags)
|
202
202
|
ic = Iconv.new("utf-8", "ucs-2")
|
203
203
|
|
data/lib/mr_eko.rb
CHANGED
@@ -19,7 +19,7 @@ EKO_ENV = ENV['EKO_ENV'] || 'development'
|
|
19
19
|
Sequel.default_timezone = :utc
|
20
20
|
|
21
21
|
module MrEko
|
22
|
-
VERSION = '0.3.
|
22
|
+
VERSION = '0.3.2'
|
23
23
|
USER_DIR = File.join(ENV['HOME'], ".mreko")
|
24
24
|
FINGERPRINTS_DIR = File.join(USER_DIR, 'fingerprints')
|
25
25
|
LOG_DIR = File.join(USER_DIR, 'logs')
|
data/mr_eko.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'mr_eko'
|
16
|
-
s.version = '0.3.
|
16
|
+
s.version = '0.3.2'
|
17
17
|
s.date = '2011-11-30'
|
18
18
|
s.rubyforge_project = 'mr_eko'
|
19
19
|
|
metadata
CHANGED