Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public data class Contributor(
}
}

@Deprecated("Use [localizedName] instead.", ReplaceWith("localizedName"))
@Deprecated("Use [localizedName] instead.", ReplaceWith("localizedName"), level = DeprecationLevel.ERROR)
val multilanguageName: LocalizedString
get() = localizedName
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ public data class Link(
}
}

@Deprecated("Use [type] instead", ReplaceWith("type"))
@Deprecated("Use [type] instead", ReplaceWith("type"), level = DeprecationLevel.ERROR)
val typeLink: String?
get() = type

@Deprecated("Use [rels] instead.", ReplaceWith("rels"))
@Deprecated("Use [rels] instead.", ReplaceWith("rels"), level = DeprecationLevel.ERROR)
val rel: List<String>
get() = rels.toList()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ public data class LocalizedString(val translations: Map<String?, Translation> =
}
}

@Deprecated("Use [string] instead.", ReplaceWith("string"))
@Deprecated("Use [string] instead.", ReplaceWith("string"), level = DeprecationLevel.ERROR)
val singleString: String?
get() = string.ifEmpty { null }

@Deprecated("Use [get] instead.", ReplaceWith("()"))
@Deprecated("Use [get] instead.", ReplaceWith("()"), level = DeprecationLevel.ERROR)
val multiString: Map<String?, String>
get() = translations.mapValues { (_, translation) -> translation.string }
}
Original file line number Diff line number Diff line change
Expand Up @@ -354,17 +354,17 @@ public data class Metadata(
val publicationDate: String?
get() = published?.toIso8601String()

@Deprecated("Use [presentation] instead", ReplaceWith("presentation", "org.readium.r2.shared.publication.presentation.presentation"))
@Deprecated("Use [presentation] instead", ReplaceWith("presentation", "org.readium.r2.shared.publication.presentation.presentation"), level = DeprecationLevel.ERROR)
val rendition: Presentation
get() = presentation

@Deprecated("Access from [otherMetadata] instead", ReplaceWith("otherMetadata[\"source\"] as? String"))
@Deprecated("Access from [otherMetadata] instead", ReplaceWith("otherMetadata[\"source\"] as? String"), level = DeprecationLevel.ERROR)
val source: String?
get() = otherMetadata["source"] as? String

@Deprecated("Not used anymore", ReplaceWith("null"))
@Deprecated("Not used anymore", ReplaceWith("null"), level = DeprecationLevel.ERROR)
val rights: String? get() = null

@Deprecated("Renamed into [toJSON]", ReplaceWith("toJSON()"))
@Deprecated("Renamed into [toJSON]", ReplaceWith("toJSON()"), level = DeprecationLevel.ERROR)
public fun writeJSON(): JSONObject = toJSON()
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ internal fun Map<String, List<PublicationCollection>>.appendToJSONObject(jsonObj
}
}

@Deprecated("Use [subcollections[role].firstOrNull()] instead", ReplaceWith("subcollections[role].firstOrNull()"))
@Deprecated("Use [subcollections[role].firstOrNull()] instead", ReplaceWith("subcollections[role].firstOrNull()"), level = DeprecationLevel.ERROR)
public fun Map<String, List<PublicationCollection>>.firstWithRole(role: String): PublicationCollection? =
get(role)?.firstOrNull()

@Deprecated("Use [subcollections[role]] instead", ReplaceWith("subcollections[role]"))
@Deprecated("Use [subcollections[role]] instead", ReplaceWith("subcollections[role]"), level = DeprecationLevel.ERROR)
public fun Map<String, List<PublicationCollection>>.findAllWithRole(role: String): List<PublicationCollection> =
get(role) ?: emptyList()
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public suspend fun PublicationServicesHolder.positions(): List<Locator> {
/**
* List of all the positions in each resource, indexed by their href.
*/
@Deprecated("Use [positionsByReadingOrder] instead", ReplaceWith("positionsByReadingOrder"))
@Deprecated("Use [positionsByReadingOrder] instead", ReplaceWith("positionsByReadingOrder"), level = DeprecationLevel.ERROR)
public val Publication.positionsByResource: Map<String, List<Locator>>
get() = runBlocking { positions().groupBy { it.href } }

Expand Down