From 31ea42d105ecdfc8410dbb09a5a6015faf9d2765 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Mon, 5 Jul 2021 16:33:25 -0400 Subject: [PATCH] fix sticker properties --- .../responses/stories/QuestionSticker.kt | 2 +- .../repositories/responses/stories/QuizSticker.kt | 4 ++-- .../repositories/responses/stories/SliderSticker.kt | 6 +++--- .../responses/stories/StoryAppAttribution.kt | 13 +++++++++++-- .../repositories/responses/stories/Tally.kt | 4 ++-- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/repositories/responses/stories/QuestionSticker.kt b/app/src/main/java/awais/instagrabber/repositories/responses/stories/QuestionSticker.kt index 7dfec43c..87801293 100644 --- a/app/src/main/java/awais/instagrabber/repositories/responses/stories/QuestionSticker.kt +++ b/app/src/main/java/awais/instagrabber/repositories/responses/stories/QuestionSticker.kt @@ -6,7 +6,7 @@ import awais.instagrabber.repositories.responses.Location import awais.instagrabber.repositories.responses.User data class QuestionSticker( - val questionType: String?, + val questionType: String, val questionId: Long, val question: String ) : Serializable \ No newline at end of file diff --git a/app/src/main/java/awais/instagrabber/repositories/responses/stories/QuizSticker.kt b/app/src/main/java/awais/instagrabber/repositories/responses/stories/QuizSticker.kt index 45f237f2..4158490f 100644 --- a/app/src/main/java/awais/instagrabber/repositories/responses/stories/QuizSticker.kt +++ b/app/src/main/java/awais/instagrabber/repositories/responses/stories/QuizSticker.kt @@ -6,8 +6,8 @@ import awais.instagrabber.repositories.responses.Location import awais.instagrabber.repositories.responses.User data class QuizSticker( - val quizId: Long?, - val question: String?, + val quizId: Long, + val question: String, val tallies: List, var viewerAnswer: Int?, val correctAnswer: Int diff --git a/app/src/main/java/awais/instagrabber/repositories/responses/stories/SliderSticker.kt b/app/src/main/java/awais/instagrabber/repositories/responses/stories/SliderSticker.kt index 45356d85..ca6a536b 100644 --- a/app/src/main/java/awais/instagrabber/repositories/responses/stories/SliderSticker.kt +++ b/app/src/main/java/awais/instagrabber/repositories/responses/stories/SliderSticker.kt @@ -6,11 +6,11 @@ import awais.instagrabber.repositories.responses.Location import awais.instagrabber.repositories.responses.User data class SliderSticker( - val sliderId: Long?, - val question: String?, + val sliderId: Long, + val question: String, val emoji: String?, val viewerCanVote: Boolean?, - var viewerVote: Double?, + val viewerVote: Double?, val sliderVoteAverage: Double?, val sliderVoteCount: Int?, ) : Serializable \ No newline at end of file diff --git a/app/src/main/java/awais/instagrabber/repositories/responses/stories/StoryAppAttribution.kt b/app/src/main/java/awais/instagrabber/repositories/responses/stories/StoryAppAttribution.kt index 6ae27957..bf8e524d 100644 --- a/app/src/main/java/awais/instagrabber/repositories/responses/stories/StoryAppAttribution.kt +++ b/app/src/main/java/awais/instagrabber/repositories/responses/stories/StoryAppAttribution.kt @@ -1,9 +1,18 @@ package awais.instagrabber.repositories.responses.stories +import android.net.Uri import java.io.Serializable // https://github.com/austinhuang0131/barinsta/issues/1151 data class StoryAppAttribution( - val name: String?, // use name instead of app_action_text for button label + val name: String?, + val appActionText: String?, val contentUrl: String? -) : Serializable \ No newline at end of file +) : Serializable { + val url: String? + get() { + val uri = Uri.parse(contentUrl) + return if (uri.getHost().equals("open.spotify.com")) contentUrl?.split("?")?.get(0) + else contentUrl + } +} \ No newline at end of file diff --git a/app/src/main/java/awais/instagrabber/repositories/responses/stories/Tally.kt b/app/src/main/java/awais/instagrabber/repositories/responses/stories/Tally.kt index 87c8c960..d71f1668 100644 --- a/app/src/main/java/awais/instagrabber/repositories/responses/stories/Tally.kt +++ b/app/src/main/java/awais/instagrabber/repositories/responses/stories/Tally.kt @@ -6,6 +6,6 @@ import awais.instagrabber.repositories.responses.Location import awais.instagrabber.repositories.responses.User data class Tally( - val text: String?, - val count: Int? + val text: String, + val count: Int ) : Serializable \ No newline at end of file