Skip to content

Drivers

Adrian Cooney edited this page Jan 9, 2017 · 4 revisions

Configuring Drivers

For Polytunes to understand you music libraries, it needs to be configured to talk to them. It does so through drivers. Each driver has their own configuration variables to setup communicated between Polytunes and the service. There is two ways to configure the drivers for Polytunes:

  1. Environment variables.
  2. Command line options.

Environment Variables

To configure Polytunes using environment variables, you specify the values needed for the drivers in your shells environment. These environment variables can be exported within your shell session or specified before the command itself. By configuring Polytunes via environment variables, it reduces command line boilerplate. Example:

$ export APPLE_MUSIC_LIBRARY=~/export/Library.xml
$ polytunes library -d apple playlists
[*] Getting Apple Music playlists..
    -> 2015 (120 tracks).
    -> Music (1919 tracks).
    -> Podcasts (25 tracks).
    -> Summer (52 tracks).
    -> Winter (68 tracks).
    -> Chill (2 tracks).
    -> Electronic (302 tracks).

Command line options

Each driver also has various command line options available to configure Polytunes. Use the --help flag to view the different options. Options override environment variables.

$ polytunes library --apple-music-library ~/export/Library.xml -d apple playlists
[*] Getting Apple Music playlists..
    -> 2015 (120 tracks).
    -> Music (1919 tracks).
    -> Podcasts (25 tracks).
    -> Summer (52 tracks).
    -> Winter (68 tracks).
    -> Chill (2 tracks).
    -> Electronic (302 tracks).

Available Drivers

Clone this wiki locally