/AudioHelperPublishPlugin

A Publish plugin that automatically adds the required Audio.duration and Audio.byteSize to all Items that have an Audio element with only the url. This avoids that hassle of having to manually determine and add this info.

Primary LanguageSwift

Audio Helper Publish Plugin

Installation

To install it into your Publish package, add it as a dependency within your Package.swift manifest:

let package = Package(
    ...
    dependencies: [
        ...
        .package(url: "https://github.com/Goosse/AudioHelperPublishPlugin.git", from: "0.1.0")
    ],
    targets: [
        .target(
            ...
            dependencies: [
                ...
                "AudioHelperPublishPlugin"
            ]
        )
    ]
    ...
)

Then import AudioHelperPublishPlugin wherever you’d like to use it:

import AudioHelperPublishPlugin

For more information on how to use the Swift Package Manager, check out this article, or its official documentation.

Usage

The plugin can then be used within any publishing pipeline like this:

import AudioHelperPublishPlugin
...
try DeliciousRecipes().publish(using: [
    .installPlugin(.addAudioByteSize()),
    .installPlugin(.addAudioDuration())
    ...
])

It is actually split out into two different plugins for Audio.byteSize and Audio.duration to give you more control if you choose to use only one or the other.