itunes-rm-dups 0.2.0-universal-darwin-9 → 0.3.0-universal-darwin-9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/itunes_dup_handler.rb +12 -7
- metadata +3 -3
data/lib/itunes_dup_handler.rb
CHANGED
@@ -34,7 +34,7 @@ class PossibleDuplicateTrack
|
|
34
34
|
|
35
35
|
def initialize(itunesTrack, md5)
|
36
36
|
@database_id = itunesTrack.databaseID.to_i
|
37
|
-
@unix_path = unixify_path( itunesTrack.location.to_s )
|
37
|
+
@unix_path = unixify_path( itunesTrack.location.to_s ) if itunesTrack.location
|
38
38
|
@md5 = md5
|
39
39
|
end
|
40
40
|
|
@@ -128,8 +128,14 @@ def find_duplicates( tracks, run_limit = nil, mb_limit=nil )
|
|
128
128
|
SkippedFiles << track_file_location
|
129
129
|
next
|
130
130
|
end
|
131
|
-
# This might be a duplicate
|
132
|
-
|
131
|
+
# This might be a duplicate file
|
132
|
+
begin
|
133
|
+
md5_tracks[md5] << PossibleDuplicateTrack.new( track, md5 )
|
134
|
+
rescue
|
135
|
+
puts "Fatal error trying to process track #{track.name} [#{track.databaseID.to_i}]. Please report this bug!"
|
136
|
+
puts track.inspect
|
137
|
+
raise
|
138
|
+
end
|
133
139
|
stop_counter += 1
|
134
140
|
if run_limit && stop_counter > run_limit
|
135
141
|
break
|
@@ -156,17 +162,16 @@ end
|
|
156
162
|
|
157
163
|
def run(options={})
|
158
164
|
# Load the iTunes instance
|
159
|
-
title = "itunes duplicate track remover"
|
160
165
|
width = 80
|
161
166
|
puts "-" * width
|
162
167
|
puts
|
163
|
-
puts
|
168
|
+
puts "itunes duplicate track remover".center(width)
|
164
169
|
puts
|
165
170
|
puts "by daniel choi".center(width)
|
166
171
|
puts "betahouse".center(width)
|
167
172
|
puts "cambridge, ma, usa".center(width)
|
168
173
|
puts
|
169
|
-
puts "
|
174
|
+
puts "http://danielchoi.com/software".center(width)
|
170
175
|
puts
|
171
176
|
puts "-" * width
|
172
177
|
|
@@ -225,8 +230,8 @@ END
|
|
225
230
|
puts "Calculating MD5 digests for all tracks with files..."
|
226
231
|
sleep 2
|
227
232
|
puts
|
228
|
-
tracks_with_dups = find_duplicates( fileTracks, options[:run_limit], mb_limit )
|
229
233
|
puts "Finding duplicates..."
|
234
|
+
tracks_with_dups = find_duplicates( fileTracks, options[:run_limit], mb_limit )
|
230
235
|
puts
|
231
236
|
sleep 2
|
232
237
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itunes-rm-dups
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: universal-darwin-9
|
6
6
|
authors:
|
7
7
|
- Daniel Choi
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-05-
|
12
|
+
date: 2008-05-25 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -45,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
45
45
|
version:
|
46
46
|
requirements: []
|
47
47
|
|
48
|
-
rubyforge_project:
|
48
|
+
rubyforge_project: itunes-rm-dups
|
49
49
|
rubygems_version: 1.0.1
|
50
50
|
signing_key:
|
51
51
|
specification_version: 2
|