Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ kotlin {
// Using experimental flatMapLatest for Paging 3
// Using experimental Material 3 compose APIs
freeCompilerArgs.add("-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi,androidx.compose.material3.ExperimentalMaterial3Api")
// Opt-in to constructor parameter annotations also applying to properties
// https://youtrack.jetbrains.com/issue/KT-73255
freeCompilerArgs.add("-Xannotation-default-target=param-property")
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2023 Uwe Trottmann
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright © 2021 Uwe Trottmann <uwe@uwetrottmann.com>

package com.battlelancer.seriesguide.provider

Expand Down Expand Up @@ -45,7 +45,7 @@ object SqliteDatabaseTestHelper {
seasonTvdbId,
showTvdbId,
seasonNumber,
SgEpisode2.EPISODE_UNKNOWN_RELEASE.toLong()
SgEpisode2.EPISODE_UNKNOWN_RELEASE
)
db.insertWithOnConflict(
SeriesGuideDatabase.Tables.EPISODES, null, values,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright © 2025 Google Inc. All Rights Reserved.
// SPDX-FileCopyrightText: Copyright © 2026 Uwe Trottmann <uwe@uwetrottmann.com>

// Original file by Google Inc. licensed under Apache-2.0 copied from FirebaseUI-Android
// https://github.com/firebase/FirebaseUI-Android
Expand Down Expand Up @@ -77,7 +78,7 @@ internal fun DefaultMfaEnrollmentContent(
}

!state.error.isNullOrBlank() -> {
snackbarHostState.showSnackbar(state.error!!)
snackbarHostState.showSnackbar(state.error)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2021-2025 Uwe Trottmann
// SPDX-FileCopyrightText: Copyright © 2021 Uwe Trottmann <uwe@uwetrottmann.com>

package com.battlelancer.seriesguide.lists

Expand Down Expand Up @@ -36,14 +36,14 @@ class ListsPagerAdapter(

override fun getItemId(position: Int): Long {
return if (position < items.size) {
items[position].id!!.toLong()
items[position].id!!
} else {
RecyclerView.NO_ID
}
}

override fun containsItem(itemId: Long): Boolean {
return items.find { it.id!!.toLong() == itemId } != null
return items.find { it.id!! == itemId } != null
}

override fun getItemCount(): Int {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2017-2024 Uwe Trottmann
// SPDX-FileCopyrightText: Copyright © 2017 Uwe Trottmann <uwe@uwetrottmann.com>

package com.battlelancer.seriesguide.movies.search

Expand Down Expand Up @@ -187,7 +187,7 @@ class MoviesSearchActivity : BaseMessageActivity() {
val hasLanguage = it.originalLanguage != null
isChipIconVisible = hasLanguage
text = if (hasLanguage) {
LanguageTools.buildLanguageDisplayName(it.originalLanguage!!)
LanguageTools.buildLanguageDisplayName(it.originalLanguage)
} else {
getString(R.string.filter_language)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class ShowsDiscoverPagingFragment : BaseAddShowsFragment() {
val hasLanguage = it.originalLanguage != null
isChipIconVisible = hasLanguage
text = if (hasLanguage) {
LanguageTools.buildLanguageDisplayName(it.originalLanguage!!)
LanguageTools.buildLanguageDisplayName(it.originalLanguage)
} else {
getString(R.string.filter_language)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ class AddShowTask(
)
}

fun failed(context: Context, showTmdbId: Int, showTitle: String?): OnShowAddedEvent {
return OnShowAddedEvent(
showTmdbId,
context.getString(R.string.add_error, showTitle),
false
)
}

fun failedDetails(
context: Context,
showTmdbId: Int,
Expand Down Expand Up @@ -208,7 +200,6 @@ class AddShowTask(
ShowResult.TMDB_ERROR -> PROGRESS_ERROR_TMDB
ShowResult.HEXAGON_ERROR -> PROGRESS_ERROR_HEXAGON
ShowResult.DATABASE_ERROR -> PROGRESS_ERROR_DATA
else -> PROGRESS_ERROR
}
}
}
Expand Down Expand Up @@ -253,8 +244,6 @@ class AddShowTask(

PROGRESS_EXISTS -> OnShowAddedEvent.exists(context, showTmdbId, showTitle)

PROGRESS_ERROR -> OnShowAddedEvent.failed(context, showTmdbId, showTitle)

PROGRESS_ERROR_TMDB -> OnShowAddedEvent.failedDetails(
context, showTmdbId, showTitle,
context.getString(R.string.api_error_generic, context.getString(R.string.tmdb))
Expand Down Expand Up @@ -328,7 +317,6 @@ class AddShowTask(
companion object {
private const val PROGRESS_EXISTS = 0
private const val PROGRESS_SUCCESS = 1
private const val PROGRESS_ERROR = 2
private const val PROGRESS_ERROR_TMDB = 3
private const val PROGRESS_ERROR_DOES_NOT_EXIST = 4
private const val PROGRESS_ERROR_HEXAGON = 6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,13 @@ class TraktEpisodeSync(
syncSeasons: MutableList<SyncSeason>,
isInitialSync: Boolean
): Boolean {
val traktEpisodes = TraktTools.buildTraktEpisodesMap(traktSeason.episodes)
val traktEpisodesOrNull = traktSeason.episodes
if (traktEpisodesOrNull == null) {
Timber.e("processCollectedTraktEpisodes: episodes is null")
return false
}

val traktEpisodes = TraktTools.buildTraktEpisodesMap(traktEpisodesOrNull)

val helper = SgRoomDatabase.getInstance(context).sgEpisode2Helper()
val localEpisodes = helper.getEpisodesForTraktSync(seasonId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class TraktMovieSync(
builder.withValue(Movies.WATCHED, true)
builder.withValue(
Movies.PLAYS,
if (playsOnTrakt!! >= 1) playsOnTrakt else 1
if (playsOnTrakt >= 1) playsOnTrakt else 1
)
changed = true
}
Expand All @@ -155,7 +155,7 @@ class TraktMovieSync(
if (inCollection != inCollectionOnTrakt
|| inWatchlist != inWatchlistOnTrakt
|| watched != isWatchedOnTrakt
|| (isWatchedOnTrakt && playsOnTrakt!! >= 1 && plays != playsOnTrakt)) {
|| (isWatchedOnTrakt && playsOnTrakt >= 1 && plays != playsOnTrakt)) {
// Mirror Trakt collection, watchlist, watched flag and plays.
// Note: unneeded (not watched or in any list) movies
// are removed in a later sync step.
Expand All @@ -165,7 +165,7 @@ class TraktMovieSync(
.withValue(Movies.IN_WATCHLIST, inWatchlistOnTrakt)
.withValue(Movies.WATCHED, isWatchedOnTrakt)
val playsValue: Int = if (isWatchedOnTrakt) {
if (playsOnTrakt!! >= 1) playsOnTrakt else 1
if (playsOnTrakt >= 1) playsOnTrakt else 1
} else 0
op.withValue(Movies.PLAYS, playsValue)
batch.add(op.build())
Expand Down
9 changes: 3 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,9 @@ androidx-test-runner = "androidx.test:runner:1.7.0"
# Also look for compatible Gradle and Android Plugin versions:
# https://kotlinlang.org/docs/gradle-configure-project.html#apply-the-plugin
# Also coroutines version must be compatible.
# 2.2.21 is compatible with Gradle 7.6.3–8.14 and AGP 7.3.1–8.11.1
# Can't update to 2.3 as Room 2.8.4 requires 2.2 metadata for processing with kapt (and can't switch
# to KSP because it's broken if Gradle user directory and project directory are on different drives:
# https://github.com/UweTrottmann/SeriesGuide/pull/1137, https://github.com/google/ksp/issues/1079).
kotlin = { id = "org.jetbrains.kotlin.android", version = "2.2.21" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version = "2.2.21" }
# 2.4.10 is compatible with Gradle 7.6.3–9.5.0 and AGP 8.5.2–9.1.0
kotlin = { id = "org.jetbrains.kotlin.android", version = "2.4.10" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version = "2.4.10" }
# https://developer.android.com/build/releases/gradle-plugin
android = { id = "com.android.application", version = "9.3.1" }
# https://github.com/gradle-nexus/publish-plugin/releases
Expand Down
Loading