diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/ImageUrl.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/ImageUrl.kt deleted file mode 100644 index 790d8ce..0000000 --- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/ImageUrl.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) SRG SSR. All rights reserved. - * License information is available from the LICENSE file. - */ -@file:Suppress("MemberVisibilityCanBePrivate") - -package ch.srg.dataProvider.integrationlayer.data - -import ch.srg.dataProvider.integrationlayer.data.serializer.ImageUrlSerializer -import java.io.Serializable - -/** - * Image url - * - * @property rawUrl Internal image url, to retrieve the url use [ImageUrl.decorated]. - */ -@Suppress("SerialVersionUIDInSerializableClass") -@kotlinx.serialization.Serializable(with = ImageUrlSerializer::class) -data class ImageUrl( - /** - * Only for internal use! Please use a Decorator! - * - * @return the undecorated url - */ - val rawUrl: String -) : Serializable { - - /** - * Decorated - * - * @param decorator The [ImageUrlDecorator] used to decorate the [rawUrl]. - * @param widthPixels The width of the image. - * @return The decorated [rawUrl]. - */ - fun decorated(decorator: ImageUrlDecorator, widthPixels: Int): String { - return decorator.decorate(rawUrl, widthPixels) - } - - @Deprecated("Using toString is not recommended in this case.", replaceWith = ReplaceWith("rawUrl")) - override fun toString(): String { - return rawUrl - } -} diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Channel.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Channel.kt index a5b6dbe..6afb709 100644 --- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Channel.kt +++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Channel.kt @@ -1,6 +1,5 @@ package ch.srg.dataProvider.integrationlayer.data.remote -import ch.srg.dataProvider.integrationlayer.data.ImageUrl import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -17,12 +16,12 @@ data class Channel( override val title: String, override val lead: String? = null, override val description: String? = null, - override val imageUrl: ImageUrl, + override val imageUrl: String, override val imageFocalPoint: FocalPoint? = null, override val imageTitle: String? = null, override val imageCopyright: String? = null, override val transmission: Transmission, override val timeTableUrl: String? = null, @SerialName("imageUrlRaw") - override val rawImageUrl: ImageUrl? = null + override val rawImageUrl: String? = null ) : SRGChannelMetadata diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Chapter.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Chapter.kt index 8b31859..2a23539 100644 --- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Chapter.kt +++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Chapter.kt @@ -2,7 +2,6 @@ package ch.srg.dataProvider.integrationlayer.data.remote -import ch.srg.dataProvider.integrationlayer.data.ImageUrl import ch.srg.dataProvider.integrationlayer.data.serializer.DateSerializer import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -23,7 +22,7 @@ data class Chapter( override val title: String, override val lead: String? = null, override val description: String? = null, - override val imageUrl: ImageUrl, + override val imageUrl: String, override val imageTitle: String? = null, override val imageCopyright: String? = null, override val blockReason: BlockReason? = null, diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Episode.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Episode.kt index 9ae0fdd..8c3062d 100644 --- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Episode.kt +++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Episode.kt @@ -2,7 +2,6 @@ package ch.srg.dataProvider.integrationlayer.data.remote -import ch.srg.dataProvider.integrationlayer.data.ImageUrl import ch.srg.dataProvider.integrationlayer.data.serializer.DateSerializer import kotlinx.serialization.Serializable import kotlinx.serialization.UseSerializers @@ -17,7 +16,7 @@ import java.util.Date data class Episode( val id: String, override val title: String, - override val imageUrl: ImageUrl, + override val imageUrl: String, override val lead: String? = null, override val description: String? = null, override val imageTitle: String? = null, diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Media.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Media.kt index a54525c..8986d0f 100644 --- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Media.kt +++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Media.kt @@ -2,7 +2,6 @@ package ch.srg.dataProvider.integrationlayer.data.remote -import ch.srg.dataProvider.integrationlayer.data.ImageUrl import ch.srg.dataProvider.integrationlayer.data.serializer.DateSerializer import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -24,7 +23,7 @@ data class Media( override val type: Type, override val date: Date, override val duration: Long, - override val imageUrl: ImageUrl, + override val imageUrl: String, override val imageFocalPoint: FocalPoint? = null, override val lead: String? = null, override val description: String? = null, diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/NowAndNext.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/NowAndNext.kt index e8212df..22b55d3 100644 --- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/NowAndNext.kt +++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/NowAndNext.kt @@ -1,6 +1,5 @@ package ch.srg.dataProvider.integrationlayer.data.remote -import ch.srg.dataProvider.integrationlayer.data.ImageUrl import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -17,15 +16,14 @@ data class NowAndNext( override val title: String, override val lead: String? = null, override val description: String? = null, - override val imageUrl: ImageUrl, + override val imageUrl: String, override val imageFocalPoint: FocalPoint? = null, override val imageTitle: String? = null, override val imageCopyright: String? = null, override val transmission: Transmission, override val timeTableUrl: String? = null, @SerialName("imageUrlRaw") - override val rawImageUrl: ImageUrl? = null, + override val rawImageUrl: String? = null, val now: Program? = null, val next: Program? = null -) : - SRGChannelMetadata +) : SRGChannelMetadata diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Program.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Program.kt index 19c881d..fcd0483 100644 --- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Program.kt +++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Program.kt @@ -2,7 +2,6 @@ package ch.srg.dataProvider.integrationlayer.data.remote -import ch.srg.dataProvider.integrationlayer.data.ImageUrl import ch.srg.dataProvider.integrationlayer.data.serializer.DateSerializer import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -21,7 +20,7 @@ data class Program( val endTime: Date, override val lead: String? = null, override val description: String? = null, - val imageUrl: ImageUrl? = null, + val imageUrl: String? = null, val imageFocalPoint: FocalPoint? = null, val imageTitle: String? = null, val imageCopyright: String? = null, diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Representation.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Representation.kt index 4514531..08eaf76 100644 --- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Representation.kt +++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Representation.kt @@ -1,6 +1,5 @@ package ch.srg.dataProvider.integrationlayer.data.remote -import ch.srg.dataProvider.integrationlayer.data.ImageUrl import kotlinx.serialization.Serializable /** @@ -31,7 +30,7 @@ data class Representation( val pickRandomElement: Boolean get() = properties?.pickRandomElement == true - val imageUrl: ImageUrl? + val imageUrl: String? get() = properties?.imageUrl val imageFocalPoint: FocalPoint? @@ -47,7 +46,7 @@ data class Representation( val label: String? = null, val hasDetailPage: Boolean? = null, val pickRandomElement: Boolean? = null, - val imageUrl: ImageUrl? = null, + val imageUrl: String? = null, val imageFocalPoint: FocalPoint? = null, val link: Link? = null, ) diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/SRGObject.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/SRGObject.kt index 88f5a0f..219a507 100644 --- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/SRGObject.kt +++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/SRGObject.kt @@ -1,7 +1,5 @@ package ch.srg.dataProvider.integrationlayer.data.remote -import ch.srg.dataProvider.integrationlayer.data.ImageUrl - /** * Copyright (c) SRG SSR. All rights reserved. *
@@ -23,7 +21,7 @@ interface SRGMetadata {
}
interface SRGImageMetadata {
- val imageUrl: ImageUrl
+ val imageUrl: String
val imageTitle: String?
val imageCopyright: String?
val imageFocalPoint: FocalPoint?
@@ -32,5 +30,5 @@ interface SRGImageMetadata {
interface SRGChannelMetadata : SRGIdentifierMetadata, SRGMetadata, SRGImageMetadata {
val transmission: Transmission
val timeTableUrl: String?
- val rawImageUrl: ImageUrl?
+ val rawImageUrl: String?
}
diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Segment.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Segment.kt
index b262d51..595395d 100644
--- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Segment.kt
+++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Segment.kt
@@ -2,7 +2,6 @@
package ch.srg.dataProvider.integrationlayer.data.remote
-import ch.srg.dataProvider.integrationlayer.data.ImageUrl
import ch.srg.dataProvider.integrationlayer.data.serializer.DateSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@@ -36,7 +35,7 @@ data class Segment @JvmOverloads constructor(
override val playableAbroad: Boolean,
override val lead: String? = null,
override val description: String? = null,
- override val imageUrl: ImageUrl,
+ override val imageUrl: String,
override val imageFocalPoint: FocalPoint? = null,
override val imageTitle: String? = null,
override val imageCopyright: String? = null,
diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Show.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Show.kt
index 928a264..892833e 100644
--- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Show.kt
+++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Show.kt
@@ -1,6 +1,5 @@
package ch.srg.dataProvider.integrationlayer.data.remote
-import ch.srg.dataProvider.integrationlayer.data.ImageUrl
import kotlinx.serialization.Serializable
/**
@@ -15,7 +14,7 @@ data class Show(
val transmission: Transmission,
override val urn: String,
override val title: String,
- override val imageUrl: ImageUrl,
+ override val imageUrl: String,
override val lead: String? = null,
override val description: String? = null,
val primaryChannelUrn: String? = null,
@@ -23,9 +22,9 @@ data class Show(
override val imageFocalPoint: FocalPoint? = null,
override val imageTitle: String? = null,
override val imageCopyright: String? = null,
- val bannerImageUrl: ImageUrl? = null,
- val posterImageUrl: ImageUrl? = null,
- val podcastImageUrl: ImageUrl? = null,
+ val bannerImageUrl: String? = null,
+ val posterImageUrl: String? = null,
+ val podcastImageUrl: String? = null,
val podcastSubscriptionUrl: String? = null,
val podcastFeedSdUrl: String? = null,
val podcastFeedHdUrl: String? = null,
diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Song.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Song.kt
index 4dd547f..e04b911 100644
--- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Song.kt
+++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Song.kt
@@ -2,7 +2,6 @@
package ch.srg.dataProvider.integrationlayer.data.remote
-import ch.srg.dataProvider.integrationlayer.data.ImageUrl
import ch.srg.dataProvider.integrationlayer.data.serializer.DateSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.UseSerializers
@@ -26,8 +25,8 @@ data class Song(
@Serializable
data class Cd(
val name: String,
- val coverUrlSmall: ImageUrl? = null,
- val coverUrlLarge: ImageUrl? = null
+ val coverUrlSmall: String? = null,
+ val coverUrlLarge: String? = null
)
@Serializable
diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Topic.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Topic.kt
index 0df79b9..c1f610b 100644
--- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Topic.kt
+++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Topic.kt
@@ -1,6 +1,5 @@
package ch.srg.dataProvider.integrationlayer.data.remote
-import ch.srg.dataProvider.integrationlayer.data.ImageUrl
import kotlinx.serialization.Serializable
/**
@@ -18,7 +17,7 @@ data class Topic(
override val lead: String? = null,
override val description: String? = null,
val viewedMedias: Int? = null,
- val imageUrl: ImageUrl? = null,
+ val imageUrl: String? = null,
val imageTitle: String? = null,
val imageFocalPoint: FocalPoint? = null,
val imageCopyright: String? = null,
diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/serializer/ImageUrlSerializer.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/serializer/ImageUrlSerializer.kt
deleted file mode 100644
index 889b3ac..0000000
--- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/serializer/ImageUrlSerializer.kt
+++ /dev/null
@@ -1,21 +0,0 @@
-package ch.srg.dataProvider.integrationlayer.data.serializer
-
-import ch.srg.dataProvider.integrationlayer.data.ImageUrl
-import kotlinx.serialization.KSerializer
-import kotlinx.serialization.descriptors.PrimitiveKind
-import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
-import kotlinx.serialization.encoding.Decoder
-import kotlinx.serialization.encoding.Encoder
-
-object ImageUrlSerializer : KSerializer