Skip to content

Commit

Permalink
Glance app widget
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbel committed Feb 23, 2024
1 parent 346e72b commit e64efcb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ exceptions:
- 'MalformedURLException'
- 'NumberFormatException'
- 'ParseException'
- 'SerializationException'
allowedExceptionNameRegex: '_|(ignore|expected).*'
ThrowingExceptionFromFinally:
active: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal class MovieRepositoryImpl @Inject constructor(
override suspend fun movieDetails(pagingKey: String, movieId: Int): MovieDb {
return try {
movieDao.movieById(pagingKey, movieId) ?: movieService.movie(movieId, localeController.language).mapToMovieDb
} catch (e: Exception) {
} catch (ignored: Exception) {
throw MovieDetailsException
}
}
Expand All @@ -76,7 +76,7 @@ internal class MovieRepositoryImpl @Inject constructor(
movieDao.removeMovies(MovieDb.MOVIES_WIDGET)
movieDao.insertMovies(moviesDb)
movieDao.moviesMini(MovieDb.MOVIES_WIDGET, MovieResponse.DEFAULT_PAGE_SIZE)
} catch (e: Exception) {
} catch (ignored: Exception) {
movieDao.moviesMini(MovieDb.MOVIES_WIDGET, MovieResponse.DEFAULT_PAGE_SIZE).ifEmpty {
throw MoviesUpcomingException
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import androidx.compose.animation.core.updateTransition
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ internal object MoviesGlanceStateDefinition: GlanceStateDefinition<MoviesWidgetS
override suspend fun readFrom(input: InputStream): MoviesWidgetState {
return try {
Json.decodeFromString(MoviesWidgetState.serializer(), input.readBytes().decodeToString())
} catch (exception: SerializationException) {
throw CorruptionException("Could not read movies data: ${exception.message}")
} catch (e: SerializationException) {
throw CorruptionException("Could not read movies data: ${e.message}")
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.michaelbel.movies.search

import androidx.navigation.NavController
import androidx.navigation.NavDeepLink
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import androidx.navigation.navDeepLink
Expand Down

0 comments on commit e64efcb

Please sign in to comment.