Skip to content

Commit

Permalink
tags with underscores are now displayed correctly in moebooru
Browse files Browse the repository at this point in the history
  • Loading branch information
Yochyo committed Jul 10, 2019
1 parent 1fa7f7f commit 1a5992e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions app/src/main/java/de/yochyo/yummybooru/TODO.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package de.yochyo.yummybooru
//TODO Auto mode bei server hinzufügen
//Tags und Subs als eine Klasse?
//Optimizations
//TODO search[name] Allows searching for multiple tags with exact given names, separated by commas. e.g. search[name]=touhou,original,k-on! would return the three listed tags. anstatt von manuellem durchsuchen
//TODO auto-updater
//TODO Statt LiveData events benutzen
//TODO beim Profiler ist die CPU belastung heavy
//TODO downloader braucht ne lock, synchronisieren
Expand All @@ -17,7 +17,6 @@ package de.yochyo.yummybooru
//TODO Previewactivity select pictures to download
//TODO Wenn man den ausgewählten server ändert, wo wird der wieder ausgewählt
//Bugs
//TODO service muss unabhängig von der ganzen app sein, es gab in yande.re einen abstürz♠
//TODO when z.B. ein download crasht, muss ein event (oder awaitPicture...) abgebrochen werden
//TODO bitmap = BitmapFactory.decodeStream(stream)!! in downloader schlägt selten fehl //wahrscheinlich weil mein png/jpg
//Nettes zeug für irgendwann
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/de/yochyo/yummybooru/api/api/MoebooruApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MoebooruApi(url: String) : Api(url) {
override val name: String = "moebooru"
override fun urlGetTag(name: String): String = "${url}tag.json?name=$name*"
override fun urlGetTags(beginSequence: String): String {
return "${url}tag.json?name=$beginSequence*&limit=${Api.searchTagLimit}&search[order]=count"
return "${url}tag.json?name=$beginSequence*&limit=${searchTagLimit}&search[order]=count"
}

override fun urlGetPosts(page: Int, tags: Array<String>, limit: Int): String {
Expand Down Expand Up @@ -89,7 +89,7 @@ class MoebooruApi(url: String) : Api(url) {

if (type != Tag.UNKNOWN) {
val nameSubstring = subStringType.substring(subStringType.indexOf("href=\"/post?") + 12)
val name = nameSubstring.substring(nameSubstring.indexOf(">") + 1, nameSubstring.indexOf("<"))
val name = nameSubstring.substring(nameSubstring.indexOf(">") + 1, nameSubstring.indexOf("<")).replace(" ", "_")
tags += Tag(name, type)
}
} catch (e: Exception) {
Expand Down

0 comments on commit 1a5992e

Please sign in to comment.