File tree Expand file tree Collapse file tree
app/src/main/java/eu/kanade
domain/entries/anime/interactor
domain/src/main/java/tachiyomi/domain/entries/anime/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class SetAnimeViewerFlags(
1818 viewerFlags = anime.viewerFlags
1919 .setFlag(flag, Anime .ANIME_INTRO_MASK )
2020 // Disable skip intro button if length is set to 0
21- .setFlag((flag == 0L ).toLong(), Anime .ANIME_INTRO_DISABLE_MASK ),
21+ .setFlag((flag == 0L ).toLong().addHexZeros( 14 ) , Anime .ANIME_INTRO_DISABLE_MASK ),
2222 ),
2323 )
2424 }
Original file line number Diff line number Diff line change @@ -312,7 +312,13 @@ class AnimeScreen(
312312 }
313313 }
314314 SkipIntroLengthDialog (
315- initialSkipIntroLength = successState.anime.skipIntroLength,
315+ initialSkipIntroLength = if (! successState.anime.skipIntroDisable &&
316+ successState.anime.skipIntroLength == 0
317+ ) {
318+ screenModel.gesturePreferences.defaultIntroLength().get()
319+ } else {
320+ successState.anime.skipIntroLength
321+ },
316322 onDismissRequest = onDismissRequest,
317323 onValueChanged = {
318324 updateSkipIntroLength(it.toLong())
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ class AnimeScreenModel(
9898 private val libraryPreferences : LibraryPreferences = Injekt .get(),
9999 private val trackPreferences : TrackPreferences = Injekt .get(),
100100 internal val playerPreferences : PlayerPreferences = Injekt .get(),
101- private val gesturePreferences : GesturePreferences = Injekt .get(),
101+ internal val gesturePreferences : GesturePreferences = Injekt .get(),
102102 private val trackerManager : TrackerManager = Injekt .get(),
103103 private val trackEpisode : TrackEpisode = Injekt .get(),
104104 private val downloadManager : AnimeDownloadManager = Injekt .get(),
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ import logcat.LogPriority
9999import tachiyomi.core.common.i18n.stringResource
100100import tachiyomi.core.common.util.lang.launchIO
101101import tachiyomi.core.common.util.lang.launchNonCancellable
102+ import tachiyomi.core.common.util.lang.toLong
102103import tachiyomi.core.common.util.lang.withIOContext
103104import tachiyomi.core.common.util.lang.withUIContext
104105import tachiyomi.core.common.util.system.logcat
@@ -1801,11 +1802,12 @@ class PlayerViewModel @JvmOverloads constructor(
18011802 * Updates the skipIntroLength for the open anime.
18021803 */
18031804 fun setAnimeSkipIntroLength (skipIntroLength : Long ) {
1805+ // Skip unnecessary database operation
1806+ if (skipIntroLength == getAnimeSkipIntroLength().toLong()) return
18041807 val anime = currentAnime.value ? : return
18051808 if (! anime.favorite) return
18061809 viewModelScope.launchIO {
18071810 setAnimeViewerFlags.awaitSetSkipIntroLength(anime.id, skipIntroLength)
1808- logcat(LogPriority .INFO ) { " New Skip Intro Length is ${anime.skipIntroLength} " }
18091811 _currentAnime .update { _ -> getAnime.await(anime.id) }
18101812 }
18111813 }
Original file line number Diff line number Diff line change @@ -121,9 +121,9 @@ data class Anime(
121121 const val EPISODE_DISPLAY_MASK = 0x00100000L
122122
123123 const val ANIME_INTRO_MASK = 0x0000000000000FFL
124- const val ANIME_INTRO_DISABLE_MASK = 0x100000000000000L
125124 const val ANIME_AIRING_EPISODE_MASK = 0x000000000FFFF00L
126125 const val ANIME_AIRING_TIME_MASK = 0x0FFFFFFFF000000L
126+ const val ANIME_INTRO_DISABLE_MASK = 0x100000000000000L
127127
128128 fun create () = Anime (
129129 id = - 1L ,
You can’t perform that action at this time.
0 commit comments