Use a case insensitive compare in iTunesStore.swift.
This commit is contained in:
1 parent
f46ace054a
commit
6a006291cd
1 file changed
+8
-5
@@ -455,11 +455,14 @@ public struct iTunesStore: MetadataService {
|
||||
if let nodes = try? xml.nodes(forXPath: "//li[@class='copyright']") {
|
||||
for node in nodes {
|
||||
if var copyright = node.stringValue {
|
||||
copyright = copyright.replacingOccurrences(of: ". All Rights Reserved.", with: "")
|
||||
copyright = copyright.replacingOccurrences(of: ". All rights reserved.", with: "")
|
||||
copyright = copyright.replacingOccurrences(of: ". All Rights Reserved", with: "")
|
||||
copyright = copyright.replacingOccurrences(of: ". All rights reserved", with: "")
|
||||
copyright = copyright.replacingOccurrences(of: " by", with: "")
|
||||
if let range = copyright.range(of: ". All Rights Reserved.", options: .caseInsensitive,
|
||||
range: copyright.startIndex ..< copyright.endIndex, locale: nil) {
|
||||
copyright.removeSubrange(range)
|
||||
}
|
||||
if let range = copyright.range(of: " by", options: .caseInsensitive,
|
||||
range: copyright.startIndex ..< copyright.endIndex, locale: nil) {
|
||||
copyright.removeSubrange(range)
|
||||
}
|
||||
metadata[SBMetadataResultCopyright] = copyright
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user