Skip to content

Commit

Permalink
5.5.0 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed Jun 10, 2024
1 parent dc144a5 commit 2c23d9f
Show file tree
Hide file tree
Showing 50 changed files with 288 additions and 959 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ The project aims to improve efficiency and provide more useful and user-friendly

* Disabled `usesCleartextTraffic`, so that all content transmission is more private and secure
* Settings/Preferences can now be exported and imported
* Play history/progress can be separately exported/imported as Json files

For more details of the changes, see the [Changelog](changelog.md)

Expand Down
29 changes: 13 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ android {
// Version code schema (not used):
// "1.2.3-beta4" -> 1020304
// "1.2.3" -> 1020395
versionCode 3020149
versionName "5.4.2"
versionCode 3020150
versionName "5.5.0"

def commit = ""
try {
Expand Down Expand Up @@ -220,18 +220,18 @@ android {

dependencies {
implementation "androidx.core:core-ktx:1.12.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1'
implementation 'com.android.volley:volley:1.2.1'

constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
// implementation 'com.android.volley:volley:1.2.1'

// constraints {
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version") {
// because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
// }
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version") {
// because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
// }
// }

implementation "androidx.annotation:annotation:1.8.0"
implementation "androidx.appcompat:appcompat:1.6.1"
Expand Down Expand Up @@ -265,9 +265,6 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp-urlconnection:4.12.0"
implementation 'com.squareup.okio:okio:3.9.0'

// implementation "org.greenrobot:eventbus:3.3.1"
// kapt "org.greenrobot:eventbus-annotation-processor:3.3.1"

implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
implementation "io.reactivex.rxjava2:rxjava:2.2.21"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,6 @@ class DownloadServiceInterfaceImpl : DownloadServiceInterface() {
DBWriter.deleteFeedMediaOfItem(context, media.id) // Remove partially downloaded file
val tag = WORK_TAG_EPISODE_URL + media.download_url
val future: Future<List<WorkInfo>> = WorkManager.getInstance(context).getWorkInfosByTag(tag)
// Observable.fromFuture(future)
// .subscribeOn(Schedulers.io())
// .observeOn(Schedulers.io())
// .subscribe(
// { workInfos: List<WorkInfo> ->
// for (info in workInfos) {
// if (info.tags.contains(WORK_DATA_WAS_QUEUED)) {
// if (media.item != null) DBWriter.removeQueueItem(context, false, media.item!!)
// }
// }
// WorkManager.getInstance(context).cancelAllWorkByTag(tag)
// }, { exception: Throwable ->
// WorkManager.getInstance(context).cancelAllWorkByTag(tag)
// exception.printStackTrace()
// })

CoroutineScope(Dispatchers.IO).launch {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,6 @@ class NextcloudLoginFlow(private val httpClient: OkHttpClient, private val rawHo
poll()
return
}
// startDisposable = Observable.fromCallable {
// val url = URI(hostname.scheme, null, hostname.host, hostname.port, hostname.subfolder + "/index.php/login/v2", null, null).toURL()
// val result = doRequest(url, "")
// val loginUrl = result.getString("login")
// this.token = result.getJSONObject("poll").getString("token")
// this.endpoint = result.getJSONObject("poll").getString("endpoint")
// loginUrl
// }
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(
// { result: String? ->
// val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(result))
// context.startActivity(browserIntent)
// poll()
// }, { error: Throwable ->
// Log.e(TAG, Log.getStackTraceString(error))
// this.token = null
// this.endpoint = null
// callback.onNextcloudAuthError(error.localizedMessage)
// })

val coroutineScope = CoroutineScope(Dispatchers.Main)
coroutineScope.launch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ac.mdiq.podcini.net.sync.model.*
import okhttp3.*
import okhttp3.Credentials.basic
import okhttp3.MediaType.Companion.toMediaType
import org.apache.commons.lang3.StringUtils
import org.json.JSONArray
import org.json.JSONException
import org.json.JSONObject
Expand Down Expand Up @@ -123,7 +124,7 @@ class NextcloudSyncService(private val httpClient: OkHttpClient, baseHosturl: St
val builder = HttpUrl.Builder()
if (hostname.scheme != null) builder.scheme(hostname.scheme!!)
if (hostname.host != null) builder.host(hostname.host!!)
return builder.port(hostname.port).addPathSegments(hostname.subfolder + path)
return builder.port(hostname.port).addPathSegments(StringUtils.stripStart(hostname.subfolder + path, "/"))
}

override fun logout() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,11 +682,6 @@ class LocalMediaPlayer(context: Context, callback: MediaPlayerCallback) : MediaP
createStaticPlayer(context)
}
playbackParameters = exoPlayer!!.playbackParameters
// bufferingUpdateDisposable = Observable.interval(bufferUpdateInterval, TimeUnit.SECONDS)
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe {
// bufferingUpdateListener?.accept(exoPlayer!!.bufferedPercentage)
// }
val scope = CoroutineScope(Dispatchers.Main)
scope.launch {
while (true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,15 +627,6 @@ class PlaybackService : MediaSessionService() {
}

private fun startPlayingFromPreferences() {
// Observable.fromCallable { createInstanceFromPreferences(applicationContext) }
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(
// { playable: Playable? -> startPlaying(playable, false) },
// { error: Throwable ->
// Logd(TAG, "Playable was not loaded from preferences. Stopping service.")
// error.printStackTrace()
// })
scope.launch {
try {
val playable = withContext(Dispatchers.IO) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,6 @@ class PlaybackServiceTaskManager(private val context: Context, private val callb
// chapterLoaderFuture = null

if (!media.chaptersLoaded()) {
// chapterLoaderFuture = Completable.create { emitter: CompletableEmitter ->
// ChapterUtils.loadChapters(media, context, false)
// emitter.onComplete()
// }
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe({ callback.onChapterLoaded(media) },
// { throwable: Throwable? ->
// Logd(TAG, "Error loading chapters: " + Log.getStackTraceString(throwable))
// })

val scope = CoroutineScope(Dispatchers.Main)
scope.launch(Dispatchers.IO) {
try {
Expand Down
Loading

0 comments on commit 2c23d9f

Please sign in to comment.