kagu 0.4.2 → 0.4.3
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 +1 -1
- 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: 7a1a026f110e2fd415d6d19a9995ebfdefd8c9b7
|
4
|
+
data.tar.gz: a8690585a73b12e321a268693329782f33972037
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e5327dd17acc6485ebdc5d5fc5c8e3475aed55a554a406f274511598f9768dd9833ac026688f354f13ebd94c9d2bc0230b721d66babc202cd2dbe80a5a03520
|
7
|
+
data.tar.gz: 793de716824423596d29fe77963477c30db6c7f37ed3b8b8ff002220ae3e87d2a1c139b4b9de204332c4a04c4281e10ef8e167b8ecb10b3c9c35a9233f8647f5
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
data/lib/kagu/finder.rb
CHANGED
@@ -32,7 +32,7 @@ module Kagu
|
|
32
32
|
tracks_digests.each_with_index do |hash, digests_index|
|
33
33
|
digests(attributes).each_with_index do |digest, digest_index|
|
34
34
|
tracks = hash[digest].presence || next
|
35
|
-
tracks = tracks.select { |track| !matches.any? { |match| match.include
|
35
|
+
tracks = tracks.select { |track| !matches.any? { |match| match.try(:include?, track) } }
|
36
36
|
next if tracks.empty?
|
37
37
|
index = [digests_index, digest_index].max
|
38
38
|
matches[index] ||= []
|
data/spec/kagu/finder_spec.rb
CHANGED
@@ -121,6 +121,13 @@ describe Kagu::Finder do
|
|
121
121
|
expect(results.first.first.title).to match(/podcast 002/i)
|
122
122
|
end
|
123
123
|
|
124
|
+
it 'does not fails if it does not match last replacements' do
|
125
|
+
finder.reload(replacements: [{ /subsonik (\d+)/ => "subsonik podcast \\1" }, { /\s+/ => '' }])
|
126
|
+
results = finder.find(artist: 'subsonik', title: '002')
|
127
|
+
expect(results.size).to eq(1)
|
128
|
+
expect(results.first.first.title).to match(/podcast 002/i)
|
129
|
+
end
|
130
|
+
|
124
131
|
end
|
125
132
|
|
126
133
|
describe '#ignored' do
|