Skip to content

Commit

Permalink
Merge remote-tracking branch 'master' into 'refresh-button'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rian8337 committed May 5, 2024
2 parents 24ba928 + 96309a6 commit fd9bd95
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/com/reco1l/osu/beatmaplisting/BeatmapDownloader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package com.reco1l.osu.beatmaplisting

import android.os.Environment.DIRECTORY_DOWNLOADS
import android.view.View
import com.reco1l.osu.mainThread
import com.reco1l.framework.net.FileRequest
import com.reco1l.framework.net.IDownloaderObserver
import com.reco1l.osu.mainThread
import com.reco1l.osu.multiplayer.Multiplayer
import com.reco1l.osu.ui.DownloadFragment
import com.reco1l.osu.multiplayer.RoomScene
import com.reco1l.osu.ui.DownloadFragment
import com.reco1l.toolkt.kotlin.async
import com.reco1l.toolkt.kotlin.decodeAsURL
import com.reco1l.toolkt.kotlin.replaceAlphanumeric
Expand All @@ -21,7 +21,6 @@ import ru.nsu.ccfit.zuev.osu.helper.FileUtils
import ru.nsu.ccfit.zuev.osu.helper.StringTable
import ru.nsu.ccfit.zuev.osuplus.R
import java.io.IOException
import java.lang.Exception

object BeatmapDownloader : IDownloaderObserver {

Expand Down Expand Up @@ -57,6 +56,11 @@ object BeatmapDownloader : IDownloaderObserver {
val file = directory?.resolve("$filename.osz")!!

val downloader = FileRequest(file, url)
downloader.buildRequest {

removeHeader("User-Agent")
addHeader("User-Agent", "Chrome/Android")
}

fragment = DownloadFragment()
fragment.setDownloader(downloader) {
Expand Down
6 changes: 6 additions & 0 deletions src/com/reco1l/osu/beatmaplisting/BeatmapListing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ class BeatmapListing : BaseFragment(),
addQueryParameter("offset", offset.toString())
}

request.buildRequest {

removeHeader("User-Agent")
addHeader("User-Agent", "Chrome/Android")
}

val beatmapSets = mirror.search.mapResponse(request.execute().json)
adapter.data.addAll(beatmapSets)

Expand Down

0 comments on commit fd9bd95

Please sign in to comment.