imp3 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +7 -2
- data/VERSION +1 -1
- data/bin/imp3 +17 -0
- data/lib/imp3.rb +1 -1
- data/lib/imp3/cli.rb +16 -3
- data/lib/imp3/commands.rb +2 -0
- data/lib/imp3/commands/artists.rb +8 -3
- data/lib/imp3/commands/genres.rb +8 -4
- data/lib/imp3/config.rb +1 -1
- metadata +52 -25
data/README.rdoc
CHANGED
@@ -2,10 +2,15 @@
|
|
2
2
|
|
3
3
|
iMp3 is an application for batch processing and fixing common issues when dealing with a large iTunes library
|
4
4
|
|
5
|
+
== LIMITATIONS
|
6
|
+
|
7
|
+
Due an Snow Leopard bug, this application will fail to process more than 65536 (2^16) song at once.
|
8
|
+
In order to avoid this limitation, you can select the desired tracks to process in iTunes and then call iMp3 with _--selection_ switch
|
9
|
+
|
5
10
|
== REQUIREMENTS
|
6
11
|
|
7
|
-
* Mac OS X
|
8
|
-
* iTunes
|
12
|
+
* Mac OS X
|
13
|
+
* iTunes
|
9
14
|
|
10
15
|
== INSTALL
|
11
16
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/bin/imp3
CHANGED
@@ -16,6 +16,23 @@ default_command :help
|
|
16
16
|
|
17
17
|
global_option('-s', '--selection', "Apply only to current iTunes selection") { IMP3::CLI.instance.source_origin = :selection }
|
18
18
|
|
19
|
+
command "albums compilations" do |c|
|
20
|
+
c.syntax = 'albums compilations [options]'
|
21
|
+
c.description = 'Finds compilations and tags tracks not tagged as it'
|
22
|
+
c.when_called do |args, options|
|
23
|
+
IMP3::CLI.instance.albums_compilations_command(options)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
command "albums fetch-artwork" do |c|
|
28
|
+
c.syntax = 'albums fetch-artwork [options]'
|
29
|
+
c.description = 'Fetch last.fm album artwork'
|
30
|
+
c.option '--flush-cache', 'Re-create last.fm album artwork cache'
|
31
|
+
c.when_called do |args, options|
|
32
|
+
IMP3::CLI.instance.albums_fetch_artwork_command(options)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
19
36
|
command "genres list" do |c|
|
20
37
|
c.syntax = 'genres list'
|
21
38
|
c.description = 'Lists all genres tagged in iTunes'
|
data/lib/imp3.rb
CHANGED
data/lib/imp3/cli.rb
CHANGED
@@ -34,15 +34,28 @@ class IMP3::CLI
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def tracks
|
37
|
+
return @tracks if @tracks
|
38
|
+
|
37
39
|
case source_origin
|
38
40
|
when :library
|
39
|
-
@
|
40
|
-
@library.tracks
|
41
|
+
@source = itunes.sources.find {|s| s.kind == OSA::ITunes::ESRC::LIBRARY }.playlists[0].tracks
|
41
42
|
when :selection
|
42
|
-
itunes.selection
|
43
|
+
@source = itunes.selection
|
43
44
|
else
|
44
45
|
raise "Invalid source origin: #{source_origin}"
|
45
46
|
end
|
47
|
+
|
48
|
+
@tracks = []
|
49
|
+
begin
|
50
|
+
progress_bar @source do |track, bar|
|
51
|
+
bar.refresh :title => "Scanning track #{track.object_id}"
|
52
|
+
@tracks << track
|
53
|
+
bar.increment
|
54
|
+
end
|
55
|
+
rescue
|
56
|
+
raise "Unable to retrieve tracks, please make sure iTunes is open."
|
57
|
+
end
|
58
|
+
@tracks
|
46
59
|
end
|
47
60
|
|
48
61
|
def artists
|
data/lib/imp3/commands.rb
CHANGED
@@ -27,9 +27,14 @@ module IMP3::Commands::Artists
|
|
27
27
|
|
28
28
|
unless track.artist.eql?(artist_names[normalized_artist_name])
|
29
29
|
tagged += 1
|
30
|
-
puts "Tagging track #{track.
|
31
|
-
|
32
|
-
|
30
|
+
puts "Tagging track #{track.object_id} with artist name '#{artist_names[normalized_artist_name]}'"
|
31
|
+
begin
|
32
|
+
track.artist = artist_names[normalized_artist_name]
|
33
|
+
rescue => e
|
34
|
+
errors += 1
|
35
|
+
puts "Error: #{e}"
|
36
|
+
end
|
37
|
+
|
33
38
|
end
|
34
39
|
end
|
35
40
|
|
data/lib/imp3/commands/genres.rb
CHANGED
@@ -28,12 +28,16 @@ module IMP3::Commands::Genres
|
|
28
28
|
genre = (cache.artist_genres[normalized_artist_name] - config.ignore_genres).first
|
29
29
|
|
30
30
|
if track.genre.eql?(genre)
|
31
|
-
bar.refresh(:title => "Skipping track #{track.
|
31
|
+
bar.refresh(:title => "Skipping track #{track.object_id}. Genre is already '#{genre}'")
|
32
32
|
else
|
33
|
-
bar.refresh(:title => "Tagging track #{track.
|
33
|
+
bar.refresh(:title => "Tagging track #{track.object_id} with genre '#{genre}'")
|
34
34
|
tagged += 1
|
35
|
-
|
36
|
-
|
35
|
+
begin
|
36
|
+
track.genre = genre
|
37
|
+
rescue => e
|
38
|
+
errors += 1
|
39
|
+
bar.refresh(:title => "Error: #{e}")
|
40
|
+
end
|
37
41
|
end
|
38
42
|
end
|
39
43
|
|
data/lib/imp3/config.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imp3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 5
|
9
|
+
version: 0.1.5
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- "V\xC3\xADctor Mart\xC3\xADnez"
|
@@ -9,59 +14,79 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-21 00:00:00 +01:00
|
13
18
|
default_executable: imp3
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: commander
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ~>
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 4
|
29
|
+
- 0
|
30
|
+
- 2
|
23
31
|
version: 4.0.2
|
24
|
-
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
- !ruby/object:Gem::Dependency
|
26
35
|
name: terminal-table
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - ~>
|
32
40
|
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 1
|
43
|
+
- 4
|
44
|
+
- 2
|
33
45
|
version: 1.4.2
|
34
|
-
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
35
48
|
- !ruby/object:Gem::Dependency
|
36
49
|
name: nokogiri
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
52
|
requirements:
|
41
53
|
- - ~>
|
42
54
|
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 1
|
57
|
+
- 4
|
58
|
+
- 1
|
43
59
|
version: 1.4.1
|
44
|
-
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
45
62
|
- !ruby/object:Gem::Dependency
|
46
63
|
name: pbosetti-rubyosa
|
47
|
-
|
48
|
-
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
prerelease: false
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
66
|
requirements:
|
51
67
|
- - ~>
|
52
68
|
- !ruby/object:Gem::Version
|
69
|
+
segments:
|
70
|
+
- 0
|
71
|
+
- 5
|
72
|
+
- 3
|
53
73
|
version: 0.5.3
|
54
|
-
|
74
|
+
type: :runtime
|
75
|
+
version_requirements: *id004
|
55
76
|
- !ruby/object:Gem::Dependency
|
56
77
|
name: friendly_id
|
57
|
-
|
58
|
-
|
59
|
-
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
prerelease: false
|
79
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
60
80
|
requirements:
|
61
81
|
- - ~>
|
62
82
|
- !ruby/object:Gem::Version
|
83
|
+
segments:
|
84
|
+
- 2
|
85
|
+
- 3
|
86
|
+
- 3
|
63
87
|
version: 2.3.3
|
64
|
-
|
88
|
+
type: :runtime
|
89
|
+
version_requirements: *id005
|
65
90
|
description: An application for batch processing and fixing common issues when dealing with a large iTunes library
|
66
91
|
email: knoopx@gmail.com
|
67
92
|
executables:
|
@@ -101,18 +126,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
101
126
|
requirements:
|
102
127
|
- - ">="
|
103
128
|
- !ruby/object:Gem::Version
|
129
|
+
segments:
|
130
|
+
- 0
|
104
131
|
version: "0"
|
105
|
-
version:
|
106
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
133
|
requirements:
|
108
134
|
- - ">="
|
109
135
|
- !ruby/object:Gem::Version
|
136
|
+
segments:
|
137
|
+
- 0
|
110
138
|
version: "0"
|
111
|
-
version:
|
112
139
|
requirements: []
|
113
140
|
|
114
141
|
rubyforge_project:
|
115
|
-
rubygems_version: 1.3.
|
142
|
+
rubygems_version: 1.3.6
|
116
143
|
signing_key:
|
117
144
|
specification_version: 3
|
118
145
|
summary: Application for batch processing and fixing common issues when dealing with a large iTunes library
|