Skip to content
This repository has been archived by the owner on Aug 26, 2019. It is now read-only.

Commit

Permalink
调整类别识别
Browse files Browse the repository at this point in the history
  • Loading branch information
seven332 committed Jun 14, 2014
1 parent ae90c1b commit 30c46bd
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/com/hippo/ehviewer/ehclient/EhClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1672,26 +1672,28 @@ else if (cat >= 0 && cat <= 9)
ListUrls.UNKNOWN
};

private static String CATEGORY_STRINGS[] = {
"misc",
"doujinshi",
"manga",
"artistcg",
"gamecg",
"imageset",
"cosplay",
"asianporn",
"non-h",
"western",
"unknown"
private static String CATEGORY_STRINGS[][] = {
new String[]{"misc"},
new String[]{"doujinshi"},
new String[]{"manga"},
new String[]{"artistcg", "Artist CG Sets"},
new String[]{"gamecg", "Game CG Sets"},
new String[]{"imageset", "Image Sets"},
new String[]{"cosplay", "Asian Porn"},
new String[]{"asianporn"},
new String[]{"non-h"},
new String[]{"western"},
new String[]{"unknown"}
};

public static int getType(String type) {
int i;
for (i = 0; i < CATEGORY_STRINGS.length - 1; i++) {
if (CATEGORY_STRINGS[i].equalsIgnoreCase(type))
break;
for (String str : CATEGORY_STRINGS[i])
if (str.equalsIgnoreCase(type))
return CATEGORY_VALUES[i];
}

return CATEGORY_VALUES[i];
}

Expand All @@ -1701,7 +1703,7 @@ public static String getType(int type) {
if (CATEGORY_VALUES[i] == type)
break;
}
return CATEGORY_STRINGS[i];
return CATEGORY_STRINGS[i][0];
}


Expand Down

0 comments on commit 30c46bd

Please sign in to comment.