Skip to content

Commit

Permalink
6.5.8 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed Sep 9, 2024
1 parent 24cb13c commit e3f7c31
Show file tree
Hide file tree
Showing 32 changed files with 1,292 additions and 1,507 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ An open source podcast instrument, attuned to Puccini ![Puccini](./images/Puccin
[<img src="./images/external/getItf-droid.png" alt="F-Droid" height="50">](https://f-droid.org/packages/ac.mdiq.podcini.R/)
[<img src="./images/external/amazon.png" alt="Amazon" height="40">](https://www.amazon.com/%E8%B4%BE%E8%A5%BF%E6%9E%97-Podcini-R/dp/B0D9WR8P13)

## Announcement

#### Podcini.R version 6.5 as a major step forward brings YouTube channels in the app. They can be searched, subscribed and played from within Podcini. For more see the changelogs
#### If you are migrating from Podcini version 5, please read the migrationTo5.md file for migration instructions.
#### For Podcini to show up on car's HUD with Android Auto, please read AnroidAuto.md for instructions.

This project is based on a fork of [AntennaPod](<https://github.com/AntennaPod/AntennaPod>) as of Feb 5 2024.
This project evolves from a fork of [AntennaPod](<https://github.com/AntennaPod/AntennaPod>) as of Feb 5 2024.

Compared to AntennaPod this project:

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ android {
testApplicationId "ac.mdiq.podcini.tests"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

versionCode 3020241
versionName "6.5.7"
versionCode 3020242
versionName "6.5.8"

applicationId "ac.mdiq.podcini.R"
def commit = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ac.mdiq.podcini.playback.base.MediaPlayerBase
import ac.mdiq.podcini.playback.base.MediaPlayerBase.MediaPlayerInfo
import ac.mdiq.podcini.playback.base.MediaPlayerCallback
import ac.mdiq.podcini.playback.base.PlayerStatus
import ac.mdiq.podcini.playback.service.LocalMediaPlayer
import ac.mdiq.podcini.playback.service.PlaybackService.LocalMediaPlayer
import ac.mdiq.podcini.storage.model.*
import ac.mdiq.podcini.storage.model.VolumeAdaptionSetting
import androidx.test.annotation.UiThreadTest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.test.podcini.service.playback

import ac.mdiq.podcini.playback.base.PlayerStatus
import ac.mdiq.podcini.playback.service.TaskManager
import ac.mdiq.podcini.playback.service.TaskManager.PSTMCallback
import ac.mdiq.podcini.playback.service.PlaybackService.TaskManager
import ac.mdiq.podcini.playback.service.PlaybackService.TaskManager.PSTMCallback
import ac.mdiq.podcini.preferences.SleepTimerPreferences.setShakeToReset
import ac.mdiq.podcini.preferences.SleepTimerPreferences.setVibrate
import ac.mdiq.podcini.storage.model.Feed
Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
android:enabled="true"
android:exported="true"
tools:ignore="ExportedService">

<intent-filter>
<action android:name="androidx.media3.session.MediaLibraryService"/>
<action android:name="android.media.browse.MediaBrowserService"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ac.mdiq.podcini.net.download.service.DefaultDownloaderFactory
import ac.mdiq.podcini.net.download.service.DownloadRequestCreator.create
import ac.mdiq.podcini.net.download.service.DownloadRequest
import ac.mdiq.podcini.net.feed.parser.FeedHandler
import ac.mdiq.podcini.net.feed.parser.FeedHandlerResult
import ac.mdiq.podcini.net.feed.parser.FeedHandler.FeedHandlerResult
import ac.mdiq.podcini.net.utils.NetworkUtils.isAllowMobileFeedRefresh
import ac.mdiq.podcini.net.utils.NetworkUtils.isFeedRefreshAllowed
import ac.mdiq.podcini.net.utils.NetworkUtils.isNetworkRestricted
Expand Down
26 changes: 7 additions & 19 deletions app/src/main/kotlin/ac/mdiq/podcini/net/feed/parser/FeedHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class FeedHandler {
Logd(TAG, "Recognized type Atom")
val strLang = xpp.getAttributeValue("http://www.w3.org/XML/1998/namespace", "lang")
if (strLang != null) feed.language = strLang

return Type.ATOM
}
RSS_ROOT -> {
Expand Down Expand Up @@ -113,8 +112,7 @@ class FeedHandler {
e.printStackTrace()
} finally {
if (reader != null) {
try {
reader.close()
try { reader.close()
} catch (e: IOException) {
Logd(TAG, "IOException: $reader")
e.printStackTrace()
Expand All @@ -130,8 +128,7 @@ class FeedHandler {
if (feed.fileUrl == null) return null

val reader: Reader
try {
reader = XmlStreamReader(File(feed.fileUrl!!))
try { reader = XmlStreamReader(File(feed.fileUrl!!))
} catch (e: FileNotFoundException) {
Logd(TAG, "FileNotFoundException: " + feed.fileUrl)
e.printStackTrace()
Expand Down Expand Up @@ -218,10 +215,6 @@ class FeedHandler {
state.namespaces[uri] = Itunes()
Logd(TAG, "Recognized ITunes namespace")
}
// uri == YouTube.NSURI && prefix == YouTube.NSTAG -> {
// state.namespaces[uri] = YouTube()
// Logd(TAG, "Recognized YouTube namespace")
// }
uri == SimpleChapters.NSURI && prefix.matches(SimpleChapters.NSTAG.toRegex()) -> {
state.namespaces[uri] = SimpleChapters()
Logd(TAG, "Recognized SimpleChapters namespace")
Expand Down Expand Up @@ -289,21 +282,16 @@ class FeedHandler {
type = Type.INVALID
}

// fun getMessage(): String? {
// return if (message != null) {
// message!!
// } else if (type == TypeGetter.Type.INVALID) {
// "Invalid type"
// } else {
// "Type $type not supported"
// }
// }

companion object {
private const val serialVersionUID = 9105878964928170669L
}
}

class FeedHandlerResult(
@JvmField val feed: Feed,
@JvmField val alternateFeedUrls: Map<String, String>,
val redirectUrl: String)

companion object {
private val TAG: String = FeedHandler::class.simpleName ?: "Anonymous"
private const val ATOM_ROOT = "feed"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object MimeTypeUtils {
fun isMediaFile(type: String?): Boolean {
return if (type == null) false
else type.startsWith("audio/") || type.startsWith("video/") || type == "application/ogg"
|| type == "application/octet-stream" || type == "application/x-shockwave-flash"
|| type == "application/octet-stream"
}

@JvmStatic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ class PlaybackServiceStarter(private val context: Context, private val media: Pl

private var shouldStreamThisTime = false
private var callEvenIfRunning = false
val intent: Intent
get() {
val launchIntent = Intent(context, PlaybackService::class.java)
// launchIntent.putExtra(PlaybackServiceConstants.EXTRA_PLAYABLE, media as Parcelable)
launchIntent.putExtra(EXTRA_ALLOW_STREAM_THIS_TIME, shouldStreamThisTime)
return launchIntent
}

/**
* Default value: false
Expand All @@ -33,14 +40,6 @@ class PlaybackServiceStarter(private val context: Context, private val media: Pl
return this
}

val intent: Intent
get() {
val launchIntent = Intent(context, PlaybackService::class.java)
// launchIntent.putExtra(PlaybackServiceConstants.EXTRA_PLAYABLE, media as Parcelable)
launchIntent.putExtra(EXTRA_ALLOW_STREAM_THIS_TIME, shouldStreamThisTime)
return launchIntent
}

fun start() {
Logd("PlaybackServiceStarter", "starting PlaybackService")
if (curEpisode != null) EventFlow.postEvent(FlowEvent.PlayEvent(curEpisode!!, FlowEvent.PlayEvent.Action.END))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package ac.mdiq.podcini.playback.base

//import ac.mdiq.podcini.preferences.UserPreferences.videoPlaybackSpeed
import ac.mdiq.podcini.playback.base.InTheatre.curMedia
import ac.mdiq.podcini.playback.base.InTheatre.curState
import ac.mdiq.podcini.preferences.UserPreferences
import ac.mdiq.podcini.preferences.UserPreferences.Prefs
import ac.mdiq.podcini.preferences.UserPreferences.appPrefs
import ac.mdiq.podcini.preferences.UserPreferences.setPlaybackSpeed
import ac.mdiq.podcini.preferences.UserPreferences.videoPlaybackSpeed
import ac.mdiq.podcini.storage.model.EpisodeMedia
import ac.mdiq.podcini.storage.model.FeedPreferences
import ac.mdiq.podcini.storage.model.MediaType
Expand Down Expand Up @@ -311,7 +311,7 @@ abstract class MediaPlayerBase protected constructor(protected val context: Cont

val audioPlaybackSpeed: Float
get() {
try { return appPrefs.getString(UserPreferences.Prefs.prefPlaybackSpeed.name, "1.00")!!.toFloat()
try { return appPrefs.getString(Prefs.prefPlaybackSpeed.name, "1.00")!!.toFloat()
} catch (e: NumberFormatException) {
Log.e(TAG, Log.getStackTraceString(e))
setPlaybackSpeed(1.0f)
Expand Down Expand Up @@ -367,20 +367,15 @@ abstract class MediaPlayerBase protected constructor(protected val context: Cont
@JvmStatic
fun getCurrentPlaybackSpeed(media: Playable?): Float {
var playbackSpeed = FeedPreferences.SPEED_USE_GLOBAL
val mediaType: MediaType? = media?.getMediaType()
if (media != null) {
playbackSpeed = curState.curTempSpeed
if (playbackSpeed == FeedPreferences.SPEED_USE_GLOBAL && media is EpisodeMedia) {
val prefs_ = media.episodeOrFetch()?.feed?.preferences
if (prefs_ != null) playbackSpeed = prefs_.playSpeed
}
}
if (mediaType != null && playbackSpeed == FeedPreferences.SPEED_USE_GLOBAL) playbackSpeed = getPlaybackSpeed(mediaType)
if (playbackSpeed == FeedPreferences.SPEED_USE_GLOBAL) playbackSpeed = audioPlaybackSpeed
return playbackSpeed
}

fun getPlaybackSpeed(mediaType: MediaType): Float {
return if (mediaType == MediaType.VIDEO) videoPlaybackSpeed else audioPlaybackSpeed
}
}
}
Loading

0 comments on commit e3f7c31

Please sign in to comment.