Move player notification settings into appearance section

This commit is contained in:
Koitharu 2021-05-24 19:32:56 +03:00
parent da9bd1d420
commit e0c674bc9e
No known key found for this signature in database
GPG key ID: 8E861F8CE6E7CE27
7 changed files with 23 additions and 19 deletions

View file

@ -71,12 +71,12 @@ class SubscriptionManager(context: Context) {
fun updateNotificationMode(serviceId: Int, url: String?, @NotificationMode mode: Int): Completable {
return subscriptionTable().getSubscription(serviceId, url!!)
.flatMapCompletable { entity: SubscriptionEntity ->
Completable.fromAction {
entity.notificationMode = mode
subscriptionTable().update(entity)
}.andThen(rememberLastStream(entity))
}
.flatMapCompletable { entity: SubscriptionEntity ->
Completable.fromAction {
entity.notificationMode = mode
subscriptionTable().update(entity)
}.andThen(rememberLastStream(entity))
}
}
fun updateFromInfo(subscriptionId: Long, info: ListInfo<StreamInfoItem>) {
@ -110,11 +110,11 @@ class SubscriptionManager(context: Context) {
private fun rememberLastStream(subscription: SubscriptionEntity): Completable {
return ExtractorHelper.getChannelInfo(subscription.serviceId, subscription.url, false)
.map { channel -> channel.relatedItems.map { stream -> StreamEntity(stream) } }
.flatMapCompletable { entities ->
Completable.fromAction {
database.streamDAO().upsertAll(entities)
}
}.onErrorComplete()
.map { channel -> channel.relatedItems.map { stream -> StreamEntity(stream) } }
.flatMapCompletable { entities ->
Completable.fromAction {
database.streamDAO().upsertAll(entities)
}
}.onErrorComplete()
}
}

View file

@ -60,7 +60,7 @@ public class AppearanceSettingsFragment extends BasePreferenceFragment {
@Override
public boolean onPreferenceTreeClick(final Preference preference) {
if (preference.getKey().equals(captionSettingsKey) && CAPTIONING_SETTINGS_ACCESSIBLE) {
if (captionSettingsKey.equals(preference.getKey()) && CAPTIONING_SETTINGS_ACCESSIBLE) {
try {
startActivity(new Intent(Settings.ACTION_CAPTIONING_SETTINGS));
} catch (final ActivityNotFoundException e) {