mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-28 16:11:01 +00:00
feat: banner and cover for airing notifications
This commit is contained in:
@@ -146,7 +146,8 @@ class SubscriptionHelper {
|
||||
val isAdult: Boolean,
|
||||
val id: Int,
|
||||
val name: String,
|
||||
val image: String?
|
||||
val image: String?,
|
||||
val banner: String? = null
|
||||
) : java.io.Serializable
|
||||
|
||||
private const val SUBSCRIPTIONS = "subscriptions"
|
||||
@@ -188,7 +189,8 @@ class SubscriptionHelper {
|
||||
media.isAdult,
|
||||
media.id,
|
||||
media.userPreferredName,
|
||||
media.cover
|
||||
media.cover,
|
||||
media.banner
|
||||
)
|
||||
data[media.id] = new
|
||||
}
|
||||
|
||||
@@ -122,7 +122,9 @@ class SubscriptionNotificationTask : Task {
|
||||
SubscriptionStore(
|
||||
media.name,
|
||||
text.first,
|
||||
media.id
|
||||
media.id,
|
||||
image = media.image,
|
||||
banner = media.banner
|
||||
)
|
||||
)
|
||||
PrefManager.setVal(PrefName.UnreadCommentNotifications,
|
||||
@@ -238,9 +240,7 @@ class SubscriptionNotificationTask : Task {
|
||||
if (newStore.size >= 100) {
|
||||
newStore.remove(newStore.minByOrNull { it.time })
|
||||
}
|
||||
if (newStore.any { it.title == notification.title && it.content == notification.content}) {
|
||||
return
|
||||
}
|
||||
|
||||
newStore.add(notification)
|
||||
PrefManager.setVal(PrefName.SubscriptionNotificationStore, newStore)
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ data class SubscriptionStore(
|
||||
val mediaId: Int,
|
||||
val type: String = "SUBSCRIPTION",
|
||||
val time: Long = System.currentTimeMillis(),
|
||||
val image: String? = "",
|
||||
val banner: String? = "",
|
||||
) : java.io.Serializable {
|
||||
companion object {
|
||||
private const val serialVersionUID = 1L
|
||||
|
||||
Reference in New Issue
Block a user