Fix tag ordering in humanized_essential_tag_string.

* Pick the largest character or copyright tags by post count. Previously
  we picked the tags with the longest names, which was nonsensical.

* Remove tag cateogory logic from config file. We can't avoid hardcoding
  some knowledge about tag categories here, so there's no point in trying.

This affects tab titles on post show pages as well as filenames in
downloaded images.
This commit is contained in:
evazion
2019-10-26 02:26:43 -05:00
parent ac775e2bdd
commit 3a544ba5e0
4 changed files with 51 additions and 91 deletions

View File

@@ -24,11 +24,6 @@ class TagCategory
@@short_name_mapping ||= Hash[Danbooru.config.full_tag_config_info.map {|k,v| [v["short"],k]}]
end
# Returns a hash mapping for humanized_essential_tag_string (models/post.rb)
def humanized_mapping
@@humanized_mapping ||= Hash[Danbooru.config.full_tag_config_info.map {|k,v| [k,v["humanized"]]}]
end
# Returns a hash mapping for split_tag_list_html (presenters/tag_set_presenter.rb)
def header_mapping
@@header_mapping ||= Hash[Danbooru.config.full_tag_config_info.map {|k,v| [k,v["header"]]}]
@@ -58,10 +53,6 @@ class TagCategory
@@short_name_list ||= short_name_mapping.keys
end
def humanized_list
Danbooru.config.humanized_tag_category_list
end
def split_header_list
Danbooru.config.split_tag_header_list
end