Skip to content

Commit

Permalink
6.13.4 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed Nov 4, 2024
1 parent dccc54b commit 2d614ad
Show file tree
Hide file tree
Showing 28 changed files with 518 additions and 1,068 deletions.
12 changes: 0 additions & 12 deletions Licenses_and_permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Apache License 2.0

[com.mikepenz:iconics-core](https://github.com/mikepenz/Android-Iconics/blob/develop/LICENSE) Apache License 2.0

[//]: # ([com.leinardi.android](https://github.com/leinardi/FloatingActionButtonSpeedDial/blob/release/LICENSE) Apache License 2.0)

[com.github.ByteHamster](https://github.com/ByteHamster/SearchPreference/blob/master/LICENSE) MIT License

[com.github.skydoves](https://github.com/skydoves/Only/blob/master/LICENSE) Apache License 2.0
Expand All @@ -36,18 +34,8 @@ Apache License 2.0

[com.annimon](https://github.com/aNNiMON/Lightweight-Stream-API/blob/master/LICENSE) Apache License 2.0

[com.nanohttpd](https://github.com/NanoHttpd/nanohttpd/blob/master/LICENSE.md) BSD 3-Clause "New" or "Revised" License

[org.awaitility](https://github.com/awaitility/awaitility/blob/master/LICENSE) Apache License 2.0

[com.github.mfietz](https://github.com/mfietz/fyydlin/blob/master/LICENSE) Apache License 2.0

[junit](https://junit.org/junit4/license.html) Eclipse Public License 1.0

[org.mockito](https://github.com/mockito/mockito/blob/main/LICENSE) The MIT License

[org.robolectric](https://github.com/robolectric/robolectric/blob/master/LICENSE) The MIT License

[javax.inject](https://github.com/javax-inject/javax-inject) Apache License 2.0

[org.conscrypt](https://github.com/google/conscrypt/blob/master/LICENSE) Apache License 2.0
40 changes: 4 additions & 36 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ plugins {
id('com.github.triplet.play') version '3.9.0' apply false
}

//apply plugin: 'org.jetbrains.compose'

composeCompiler {
enableStrongSkippingMode = true
reportsDestination = layout.buildDirectory.dir("compose_compiler")
Expand All @@ -28,11 +26,8 @@ android {
vectorDrawables.useSupportLibrary false
vectorDrawables.generatedDensities = []

// testApplicationId "ac.mdiq.podcini.tests"
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

versionCode 3020290
versionName "6.13.3"
versionCode 3020291
versionName "6.13.4"

applicationId "ac.mdiq.podcini.R"
def commit = ""
Expand Down Expand Up @@ -178,8 +173,6 @@ android {

dependencies {
implementation libs.androidx.material3.android
// implementation libs.androidx.material3
// implementation libs.androidx.ui.viewbinding
implementation libs.androidx.fragment.compose
// implementation libs.androidx.material.icons.extended

Expand All @@ -189,8 +182,7 @@ dependencies {

def composeBom = libs.androidx.compose.bom
implementation composeBom
// androidTestImplementation composeBom
// implementation libs.androidx.material

implementation libs.androidx.ui.tooling.preview
debugImplementation libs.androidx.ui.tooling
implementation libs.androidx.constraintlayout.compose
Expand Down Expand Up @@ -240,18 +232,14 @@ dependencies {
implementation libs.rxjava3.rxjava
implementation libs.rxandroid

// 5.5.0-b01 is newer than 5.5.0-compose01
implementation libs.iconics.core
implementation libs.iconics.views
implementation libs.google.material.typeface
implementation libs.google.material.typeface.outlined
implementation libs.fontawesome.typeface

// implementation libs.speed.dial
implementation libs.searchpreference
implementation libs.balloon
implementation libs.recyclerviewswipedecorator
implementation libs.stream
// implementation libs.stream

implementation libs.fyydlin

Expand All @@ -263,26 +251,6 @@ dependencies {
playImplementation libs.core.ktx
compileOnly libs.wearable

// this one can not be updated? TODO: need to get an alternative
// androidTestImplementation libs.nanohttpd
//
// androidTestImplementation libs.androidx.espresso.core
// androidTestImplementation libs.androidx.espresso.contrib
// androidTestImplementation libs.androidx.espresso.intents
// androidTestImplementation libs.androidx.runner
// androidTestImplementation libs.androidx.rules
// androidTestImplementation libs.androidx.junit
// androidTestImplementation libs.awaitility

// Non-free dependencies:

// testImplementation libs.androidx.core
// testImplementation libs.awaitility
// testImplementation libs.junit
// testImplementation libs.mockito.inline
// testImplementation libs.robolectric
// testImplementation libs.javax.inject

playImplementation libs.play.services.base
freeImplementation libs.conscrypt.android

Expand Down
18 changes: 0 additions & 18 deletions app/src/main/assets/licenses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
website="https://github.com/google/conscrypt"
license="Apache 2.0"
licenseText="LICENSE_APACHE-2.0.txt" />
<library
name="Floating Action Button Speed Dial"
author="Roberto Leinardi"
website="https://github.com/leinardi/FloatingActionButtonSpeedDial"
license="Apache 2.0"
licenseText="LICENSE_APACHE-2.0.txt" />
<library
name="fyydlin"
author="Martin Fietz"
Expand Down Expand Up @@ -108,12 +102,6 @@
website="https://github.com/square/okio"
license="Apache 2.0"
licenseText="LICENSE_APACHE-2.0.txt" />
<library
name="RecyclerViewSwipeDecorator"
author="Paolo Montalto"
website="https://github.com/xabaras/RecyclerViewSwipeDecorator"
license="Apache 2.0"
licenseText="LICENSE_APACHE-2.0.txt" />
<library
name="RxJava"
author="ReactiveX"
Expand All @@ -126,12 +114,6 @@
website="https://github.com/ByteHamster/SearchPreference"
license="MIT"
licenseText="LICENSE_SEARCHPREFERENCE.txt" />
<library
name="StackBlur"
author="Enrique López Mañas"
website="https://github.com/kikoso/android-stackblur"
license="Apache 2.0"
licenseText="LICENSE_APACHE-2.0.txt" />
<library
name="Triangle Label View"
author="Shota Saito"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ class VistaDownloaderImpl private constructor(val builder: OkHttpClient.Builder)
private fun getCookies(url: String): String {
val youtubeCookie = if (url.contains(YOUTUBE_DOMAIN)) getCookie(YOUTUBE_RESTRICTED_MODE_COOKIE_KEY) else null
// Recaptcha cookie is always added TODO: not sure if this is necessary
return Stream.of(youtubeCookie, getCookie("recaptcha_cookies"))
.filter { obj: String? -> Objects.nonNull(obj) }
.flatMap { cookies: String? -> Arrays.stream(cookies!!.split("; *".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()) }
return listOf(youtubeCookie, getCookie("recaptcha_cookies"))
.filterNotNull()
.flatMap { cookies: String? -> cookies!!.split("; *".toRegex()).dropLastWhile { it.isEmpty() } }
.distinct()
.collect(Collectors.joining("; "))
.joinToString("; ")
// return Stream.of(youtubeCookie, getCookie("recaptcha_cookies"))
// .filter { obj: String? -> Objects.nonNull(obj) }
// .flatMap { cookies: String? -> Arrays.stream(cookies!!.split("; *".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()) }
// .distinct()
// .collect(Collectors.joining("; "))
}

private fun getCookie(key: String): String? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ import java.util.concurrent.TimeUnit

class DownloadServiceInterfaceImpl : DownloadServiceInterface() {
override fun downloadNow(context: Context, item: Episode, ignoreConstraints: Boolean) {
if (item.media?.downloadUrl.isNullOrEmpty()) return
Logd(TAG, "starting downloadNow")
val workRequest: OneTimeWorkRequest.Builder = getRequest(item)
workRequest.setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST)
if (ignoreConstraints) workRequest.setConstraints(Builder().setRequiredNetworkType(NetworkType.CONNECTED).build())
else workRequest.setConstraints(constraints)
if (item.media?.downloadUrl != null)
WorkManager.getInstance(context).enqueueUniqueWork(item.media!!.downloadUrl!!, ExistingWorkPolicy.KEEP, workRequest.build())
WorkManager.getInstance(context).enqueueUniqueWork(item.media!!.downloadUrl!!, ExistingWorkPolicy.KEEP, workRequest.build())
}

override fun download(context: Context, item: Episode) {
if (item.media?.downloadUrl.isNullOrEmpty()) return
Logd(TAG, "starting download")
val workRequest: OneTimeWorkRequest.Builder = getRequest(item)
workRequest.setConstraints(constraints)
if (item.media?.downloadUrl != null)
WorkManager.getInstance(context).enqueueUniqueWork(item.media!!.downloadUrl!!, ExistingWorkPolicy.KEEP, workRequest.build())
WorkManager.getInstance(context).enqueueUniqueWork(item.media!!.downloadUrl!!, ExistingWorkPolicy.KEEP, workRequest.build())
}

override fun cancel(context: Context, media: EpisodeMedia) {
Expand All @@ -84,7 +84,7 @@ class DownloadServiceInterfaceImpl : DownloadServiceInterface() {
workInfoList.forEach { workInfo ->
if (workInfo.tags.contains(WORK_DATA_WAS_QUEUED)) {
val item_ = media.episodeOrFetch()
if (item_ != null) runOnIOScope { removeFromQueueSync(curQueue, item_) }
if (item_ != null) removeFromQueueSync(curQueue, item_)
}
}
WorkManager.getInstance(context).cancelAllWorkByTag(tag)
Expand All @@ -104,7 +104,6 @@ class DownloadServiceInterfaceImpl : DownloadServiceInterface() {
private val isLastRunAttempt: Boolean
get() = runAttemptCount >= 2


override fun doWork(): Result {
Logd(TAG, "starting doWork")
ClientConfigurator.initialize(applicationContext)
Expand Down Expand Up @@ -160,7 +159,6 @@ class DownloadServiceInterfaceImpl : DownloadServiceInterface() {
override fun getForegroundInfoAsync(): ListenableFuture<ForegroundInfo> {
return Futures.immediateFuture(ForegroundInfo(R.id.notification_downloading, generateProgressNotification()))
}

private fun performDownload(media: EpisodeMedia, request: DownloadRequest): Result {
Logd(TAG, "starting performDownload")
if (request.destination == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ object FeedUpdateManager {
if (isAutoUpdateDisabled) WorkManager.getInstance(context).cancelUniqueWork(WORK_ID_FEED_UPDATE)
else {
val workRequest: PeriodicWorkRequest = PeriodicWorkRequest.Builder(FeedUpdateWorker::class.java, updateInterval, TimeUnit.HOURS)
.setConstraints(Builder()
.setRequiredNetworkType(if (isAllowMobileFeedRefresh) NetworkType.CONNECTED else NetworkType.UNMETERED)
.build())
.setConstraints(Builder().setRequiredNetworkType(if (isAllowMobileFeedRefresh) NetworkType.CONNECTED else NetworkType.UNMETERED).build())
.build()
WorkManager.getInstance(context).enqueueUniquePeriodicWork(WORK_ID_FEED_UPDATE,
if (replace) ExistingPeriodicWorkPolicy.REPLACE else ExistingPeriodicWorkPolicy.KEEP, workRequest)
if (replace) ExistingPeriodicWorkPolicy.UPDATE else ExistingPeriodicWorkPolicy.KEEP, workRequest)
}
}

Expand Down Expand Up @@ -137,11 +135,9 @@ object FeedUpdateManager {
builder.show()
}


class FeedUpdateWorker(context: Context, params: WorkerParameters) : Worker(context, params) {
private val notificationManager = NotificationManagerCompat.from(context)


override fun doWork(): Result {
ClientConfigurator.initialize(applicationContext)
val feedsToUpdate: MutableList<Feed>
Expand Down Expand Up @@ -183,7 +179,7 @@ object FeedUpdateManager {
var bigText: String? = ""
if (titles != null) {
contentText = context.resources.getQuantityString(R.plurals.downloads_left, titles.size, titles.size)
bigText = titles.map { "$it" }.joinToString("\n")
bigText = titles.joinToString("\n") { "$it" }
}
return NotificationCompat.Builder(context, NotificationUtils.CHANNEL_ID.downloading.name)
.setContentTitle(context.getString(R.string.download_notification_title_feeds))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ object LockingAsyncExecutor {
coroutineScope.launch {
withContext(Dispatchers.IO) {
lock.lock()
try {
runnable.run()
} finally {
lock.unlock()
}
try { runnable.run() } finally { lock.unlock() }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1415,9 +1415,7 @@ class PlaybackService : MediaLibraryService() {
try {
ChapterUtils.loadChapters(media, context, false)
withContext(Dispatchers.Main) { callback.onChapterLoaded(media) }
} catch (e: Throwable) {
Logd(TAG, "Error loading chapters: ${Log.getStackTraceString(e)}")
}
} catch (e: Throwable) { Logd(TAG, "Error loading chapters: ${Log.getStackTraceString(e)}") }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ class AboutFragment : PreferenceFragmentCompat() {
listAdapter = ContributorsPagerFragment.SimpleIconListAdapter(requireContext(), licenses)
}
}.invokeOnCompletion { throwable ->
if (throwable!= null) {
Toast.makeText(context, throwable.message, Toast.LENGTH_LONG).show()
}
if (throwable!= null) Toast.makeText(context, throwable.message, Toast.LENGTH_LONG).show()
}
}

Expand Down Expand Up @@ -236,9 +234,7 @@ class AboutFragment : PreferenceFragmentCompat() {
listAdapter = SimpleIconListAdapter(requireContext(), translators)
}
}.invokeOnCompletion { throwable ->
if (throwable!= null) {
Toast.makeText(context, throwable.message, Toast.LENGTH_LONG).show()
}
if (throwable!= null) Toast.makeText(context, throwable.message, Toast.LENGTH_LONG).show()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,7 @@ class DownloadsPreferencesFragment : PreferenceFragmentCompat(), OnSharedPrefere
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) throw IOException(response.message)
}
} catch (e: IOException) {
throw e
}
} catch (e: IOException) { throw e }
withContext(Dispatchers.Main) {
txtvMessage.setTextColor(getColorFromAttr(context, R.attr.icon_green))
val message = String.format("%s %s", "{faw_check}", context.getString(R.string.proxy_test_successful))
Expand Down
Loading

0 comments on commit 2d614ad

Please sign in to comment.