mirror of
https://github.com/jellyfin/jellyfin-sdk-kotlin.git
synced 2024-11-26 23:50:32 +00:00
Prefix descriptor names of custom serializers
This commit is contained in:
parent
aee65c0d31
commit
c8291f63a9
@ -15,7 +15,7 @@ import java.time.format.DateTimeParseException
|
||||
public actual class DateTimeSerializer(
|
||||
private val zoneId: ZoneId = ZoneId.systemDefault(),
|
||||
) : KSerializer<DateTime> {
|
||||
actual override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("LocalDateTime", PrimitiveKind.STRING)
|
||||
actual override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("org.jellyfin.LocalDateTime", PrimitiveKind.STRING)
|
||||
|
||||
actual override fun deserialize(decoder: Decoder): DateTime = try {
|
||||
ZonedDateTime.parse(decoder.decodeString()).withZoneSameInstant(zoneId).toLocalDateTime()
|
||||
|
@ -20,7 +20,7 @@ public actual fun String.toUUIDOrNull(): UUID? = try {
|
||||
}
|
||||
|
||||
public actual class UUIDSerializer : KSerializer<UUID> {
|
||||
actual override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("UUID", PrimitiveKind.STRING)
|
||||
actual override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("org.jellyfin.UUID", PrimitiveKind.STRING)
|
||||
|
||||
actual override fun deserialize(decoder: Decoder): UUID {
|
||||
return decoder.decodeString().toUUID()
|
||||
|
Loading…
Reference in New Issue
Block a user