kagu 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/kagu/finder.rb +3 -2
- data/spec/kagu/finder_spec.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c64b2bce11df1db7eef71c7aa0a3de60c0e6246f
|
4
|
+
data.tar.gz: 004ebcd692535602f6ec4a16d0775f8ef2d18ba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dca79d485bd293043ce57b9e39babe9a5d86c8ee470f25640c8c2ad8ccf4e4129b05b3ca01adf8443955dfad2a207518dbeacf06bbcdab7b0e57f484f2ce8df
|
7
|
+
data.tar.gz: 485d551b04e5d8793ab28db422a2713f02dd578ab48e455cec64d73517d6e2f7d2a32567acceffdf2ef8445068f55fece8eae1cccdc17e66e2f31be384034924
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
data/lib/kagu/finder.rb
CHANGED
@@ -116,8 +116,9 @@ module Kagu
|
|
116
116
|
@tracks_digests ||= begin
|
117
117
|
[].tap do |tracks_digests|
|
118
118
|
tracks.each do |track|
|
119
|
-
digests(artist: track.artist, title: track.title)
|
120
|
-
|
119
|
+
digests = digests(artist: track.artist, title: track.title)
|
120
|
+
next if digests.any? { |digest| ignored.include?(digest) }
|
121
|
+
digests.each_with_index do |digest, index|
|
121
122
|
tracks_digests[index] ||= {}
|
122
123
|
tracks_digests[index][digest] ||= []
|
123
124
|
tracks_digests[index][digest].push(track)
|
data/spec/kagu/finder_spec.rb
CHANGED
@@ -114,6 +114,13 @@ describe Kagu::Finder do
|
|
114
114
|
expect(finder.find(artist: 'korn', title: 'ball tongue')).not_to be_empty
|
115
115
|
end
|
116
116
|
|
117
|
+
it 'does not include ignored tracks for each digest' do
|
118
|
+
finder.reload(replacements: { 'blind' => 'foo' })
|
119
|
+
expect {
|
120
|
+
finder.reload(ignored: 'korn foo', replacements: { 'blind' => 'foo' })
|
121
|
+
}.to change { finder.find(artist: 'korn', title: 'blind').size }.to(0)
|
122
|
+
end
|
123
|
+
|
117
124
|
it 'finds for some tracks with replacements as regexp' do
|
118
125
|
finder.reload(replacements: { /subsonik (\d+)/ => "subsonik podcast \\1" })
|
119
126
|
results = finder.find(artist: 'subsonik', title: '002')
|