Skip to content

Commit

Permalink
6.10.0 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed Oct 10, 2024
1 parent 971a45c commit 9ce9b3f
Show file tree
Hide file tree
Showing 30 changed files with 369 additions and 419 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ An open source podcast instrument, attuned to Puccini ![Puccini](./images/Puccin
[<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)
[<img src="./images/external/getItOpenapk.png" alt="OpenAPK" height="50">](https://www.openapk.net/podcini/ac.mdiq.podcini/)

#### Podcini.R 6.10 allows creating synthetic podcast and shelving any episdes to any synthetic podcasts
#### Podcini.R version 6.5 as a major step forward brings YouTube contents in the app. Channels can be searched, received from share, subscribed. Since 6.6, podcasts, playlists as well as single media from Youtube and YT Music can be shared to Podcini. For more see the Youtube section below or the changelogs
That means finally: [Nessun dorma](https://www.youtube.com/watch?v=cWc7vYjgnTs)
#### For Podcini to show up on car's HUD with Android Auto, please read AnroidAuto.md for instructions.
Expand All @@ -29,10 +30,11 @@ Compared to AntennaPod this project:
4. Boasts new UI's including streamlined drawer, subscriptions view and player controller,
5. Supports multiple, virtual and circular play queues associable to any podcast
6. Auto-download is governed by policy and limit settings of individual feed
7. Features synthetic podcasts while supporting channels, playlists, single media from YouTube and YT Music, as well as normal podcasts and plain RSS,
8. Allows adding personal notes and 5-level rating on every episode
9. Offers Readability and Text-to-Speech for RSS contents,s
10. Features `instant sync` across devices without a server.
7. Features synthetic podcasts and allows episodes to be shelved to any synthetic podcast
8. Supports channels, playlists, single media from YouTube and YT Music, as well as normal podcasts and plain RSS,
9. Allows adding personal notes and 5-level rating on every episode
10. Offers Readability and Text-to-Speech for RSS contents,s
11. Features `instant sync` across devices without a server.

The project aims to profit from modern frameworks, improve efficiency and provide more useful and user-friendly features.

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 3020268
versionName "6.9.3"
versionCode 3020269
versionName "6.10.0"

applicationId "ac.mdiq.podcini.R"
def commit = ""
Expand Down
21 changes: 12 additions & 9 deletions app/src/main/kotlin/ac/mdiq/podcini/storage/database/Episodes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import androidx.annotation.OptIn
import androidx.core.app.NotificationManagerCompat
import androidx.documentfile.provider.DocumentFile
import androidx.media3.common.util.UnstableApi
import io.realm.kotlin.ext.isManaged
import kotlinx.coroutines.Job
import java.io.File
import java.util.*
Expand Down Expand Up @@ -247,14 +248,14 @@ object Episodes {
}
}

@JvmStatic
fun setFavorite(episode: Episode, stat: Boolean?) : Job {
Logd(TAG, "setFavorite called $stat")
return runOnIOScope {
val result = upsert(episode) { it.rating = if (stat ?: !it.isFavorite) Episode.Rating.FAVORITE.code else Episode.Rating.NEUTRAL.code }
EventFlow.postEvent(FlowEvent.RatingEvent(result, result.rating))
}
}
// @JvmStatic
// fun setFavorite(episode: Episode, stat: Boolean?) : Job {
// Logd(TAG, "setFavorite called $stat")
// return runOnIOScope {
// val result = upsert(episode) { it.rating = if (stat ?: !it.isFavorite) Episode.Rating.FAVORITE.code else Episode.Rating.NEUTRAL.code }
// EventFlow.postEvent(FlowEvent.RatingEvent(result, result.rating))
// }
// }

fun setRating(episode: Episode, rating: Int) : Job {
Logd(TAG, "setRating called $rating")
Expand Down Expand Up @@ -283,7 +284,9 @@ object Episodes {
@OptIn(UnstableApi::class)
suspend fun setPlayStateSync(played: Int, resetMediaPosition: Boolean, episode: Episode) : Episode {
Logd(TAG, "setPlayStateSync called played: $played resetMediaPosition: $resetMediaPosition ${episode.title}")
val result = upsert(episode) {
var episode_ = episode
if (!episode.isManaged()) episode_ = realm.query(Episode::class).query("id == $0", episode.id).first().find() ?: episode
val result = upsert(episode_) {
if (played >= PlayState.NEW.code && played <= PlayState.BUILDING.code) it.playState = played
else {
if (it.playState == PlayState.PLAYED.code) it.playState = PlayState.UNPLAYED.code
Expand Down
46 changes: 27 additions & 19 deletions app/src/main/kotlin/ac/mdiq/podcini/storage/database/Feeds.kt
Original file line number Diff line number Diff line change
Expand Up @@ -423,17 +423,11 @@ object Feeds {
var feed = getFeed(feedId, true)
if (feed != null) return feed

feed = Feed()
feed.id = feedId
if (music) feed.title = "YTMusic Syndicate" + if (video) "" else " Audio"
else feed.title = "Youtube Syndicate" + if (video) "" else " Audio"
val name = if (music) "YTMusic Syndicate" + if (video) "" else " Audio"
else "Youtube Syndicate" + if (video) "" else " Audio"
feed = createSynthetic(feedId, name)
feed.type = Feed.FeedType.YOUTUBE.name
feed.hasVideoMedia = video
feed.downloadUrl = null
feed.fileUrl = File(feedfilePath, getFeedfileName(feed)).toString()
feed.preferences = FeedPreferences(feed.id, false, FeedPreferences.AutoDeleteAction.GLOBAL, VolumeAdaptionSetting.OFF, "", "")
feed.preferences!!.keepUpdated = false
feed.preferences!!.queueId = -2L
feed.preferences!!.videoModePolicy = if (video) VideoMode.WINDOW_VIEW else VideoMode.AUDIO_ONLY
upsertBlk(feed) {}
EventFlow.postEvent(FlowEvent.FeedListEvent(FlowEvent.FeedListEvent.Action.ADDED))
Expand All @@ -456,21 +450,35 @@ object Feeds {
EventFlow.postStickyEvent(FlowEvent.FeedUpdatingEvent(false))
}

private fun getMiscSyndicate(): Feed {
var feedId: Long = 11
var feed = getFeed(feedId, true)
if (feed != null) return feed

feed = Feed()
feed.id = feedId
feed.title = "Misc Syndicate"
feed.type = Feed.FeedType.RSS.name
fun createSynthetic(feedId: Long, name: String): Feed {
val feed = Feed()
var feedId_ = feedId
if (feedId_ <= 0) {
var i = 100L
while (true) {
if (getFeed(i++) != null) continue
feedId_ = --i
break
}
}
feed.id = feedId_
feed.title = name
feed.author = "Yours Truly"
feed.downloadUrl = null
feed.fileUrl = File(feedfilePath, getFeedfileName(feed)).toString()
feed.preferences = FeedPreferences(feed.id, false, FeedPreferences.AutoDeleteAction.GLOBAL, VolumeAdaptionSetting.OFF, "", "")
feed.preferences!!.keepUpdated = false
feed.preferences!!.queueId = -2L
// feed.preferences!!.videoModePolicy = if (video) VideoMode.WINDOW_VIEW else VideoMode.AUDIO_ONLY
return feed
}

private fun getMiscSyndicate(): Feed {
val feedId: Long = 11
var feed = getFeed(feedId, true)
if (feed != null) return feed

feed = createSynthetic(feedId, "Misc Syndicate")
feed.type = Feed.FeedType.RSS.name
upsertBlk(feed) {}
EventFlow.postEvent(FlowEvent.FeedListEvent(FlowEvent.FeedListEvent.Action.ADDED))
return feed
Expand Down
196 changes: 0 additions & 196 deletions app/src/main/kotlin/ac/mdiq/podcini/ui/actions/EpisodeMenuHandler.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ object MenuItemUtils {
* context menu was created from. This assigns the listener to every menu item,
* so that the correct fragment is always called first and can consume the click.
*
*
* Note that Android still calls the onContextItemSelected methods of all fragments
* when the passed listener returns false.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ShareReceiverActivity : AppCompatActivity() {
CustomTheme(this) {
confirmAddYoutubeEpisode(listOf(sharedUrl!!), showDialog.value, onDismissRequest = {
showDialog.value = false
// finish()
finish()
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import ac.mdiq.podcini.preferences.UserPreferences.rewindSecs
import ac.mdiq.podcini.preferences.UserPreferences.setShowRemainTimeSetting
import ac.mdiq.podcini.preferences.UserPreferences.shouldShowRemainingTime
import ac.mdiq.podcini.preferences.UserPreferences.videoPlayMode
import ac.mdiq.podcini.storage.database.Episodes.setFavorite
import ac.mdiq.podcini.storage.database.RealmDB.upsert
import ac.mdiq.podcini.storage.model.Episode
import ac.mdiq.podcini.storage.model.EpisodeMedia
Expand Down
Loading

0 comments on commit 9ce9b3f

Please sign in to comment.