1. heliostatic
  2. ebook-renamer

Commits

heliostatic  committed 95e0b4b

deleting number strings if there are more than two fields"
;

  • Participants
  • Parent commits c628d12
  • Branches master

Comments (0)

Files changed (1)

File lib/extensions/book_cleaner.rb

View file
  • Ignore whitespace
     end
 
     def clean_fields(fields)
-      fields.map { |f| f.gsub(/_\s/, ': ').gsub('_', ' ').titlecase.strip }
+      fields = fields.map { |f| f.gsub(/_\s/, ': ').gsub('_', ' ').titlecase.strip }
+      if fields.size > 2
+        fields = fields.delete_if { |f| f =~ /.*\d+.*/ }
+      end
+      fields
     end
 
     def check_author(fields)