Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

2.0.0-alpha.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@mickael-menu mickael-menu released this 28 Oct 14:58
· 75 commits to develop since this release
4ee1ebc

Take a look at the migration guide

Added

  • The Publication Services API allows to extend a Publication with custom implementations of known services. This version ships with a few predefined services:
    • PositionsService provides a list of discrete locations in the publication, no matter what the original format is.
    • CoverService provides an easy access to a bitmap version of the publication cover.
  • The Composite Fetcher API can be used to extend the way publication resources are accessed.
  • Support for exploded directories for any archive-based publication format.
  • Content Protection handles DRM and other format-specific protections in a more systematic way.
    • LCP now ships an LCPContentProtection implementation to be plugged into the Streamer.
    • You can add custom ContentProtection implementations to support other DRMs by providing an instance to the Streamer.
  • A new LinkRelation type to represent link relations, instead of using raw strings.
    • This will improve code safety through type checking and enable code completion.
    • Since LinkRelation conforms to ExpressibleByStringLiteral, you can continue using raw strings in the API. However, migrating your code is recommended, e.g. links.first(withRel: .cover).
    • Known link relations (including from OPDS specifications) are available under the LinkRelation namespace. You can easily add custom relations to the namespace by declaring static properties in a LinkRelation extension.

Changed

  • The Publication and Container types were merged together to offer a single interface to a publication's resources.
    • Use publication.get() to read the content of a resource, such as the cover. It will automatically be decrypted if a ContentProtection was attached to the Publication.