I have 2 wonderful children and for Xmas they received a Toniebox 1. There are many incredbile Tonie's out there, but we were struggling with what we can fill our Creative Tonies. After a while we found many wonderful stories for kids on Spotify 2 and we wondered why not having these stories on a Creative Tonie.
In the end, this handy tool was created to sync music between different services. It supports plugins which helps in extending it for other input & output services.
Links:
... To build the application to: package/application/target
mvn clean install
... To build a docker image whose execution and configuration files can be found at: package/docker/src/main/resources/docker/application
mvn clean install -Pdocker
The configuration is provided in a JSON format for easier read- and accessibility. There for, it is split in 3 major parts.
Full example file can be found at: package/docker/src/main/resources/docker/application/config/musicsync.json
"general": {
"timeout": 60, // nap time for the loop
"bulk": true // upload all tracks as a bulk or do it one by one
}
"plugins":
[
{
"plugin": "<PLUGIN NAME>", // name of the plugin
"config": {} // configuration of plugin
}
]
"connections":
[
{
"name": "<CONNECTION NAME>", // name of configuration
"in": {
"plugin": "<PLUGIN NAME>", // input plugin to source tracks
"config": {} // input plugin configuration to source tracks
},
"out": {
"plugin": "<PLUGIN NAME>", // output plugin to which the tracks shall be copied to
"config": {} // output plugin configuration to upload tracks
}
}
]
The application can be executed as standalone application or within a docker image which is provided by the maven build
The standard maven build copies the full build output to: package/application/target.
This output will consist out of:
If you move the directory's content to other folders and want to run the application with relative or absolute paths you have to update package/application/target/musicsync.
#!/bin/bash
execdir=. # THIS PATH HAS TO BE SPECIFIED/ADAPTED
classpath=$(find $execdir -name '*.jar' | awk '{ printf("%s:", $1); } END { printf("%s", $1); }')
executable='rocks.voss.musicsync.application/rocks.voss.musicsync.application.Application'
java -classpath $classpath -p $execdir:$execdir/modules -m $executable $@
While using the docker profile of maven 2 docker images will be created.
Steps which must be performed to create a proper Docker image
mvn clean install -Pdocker
./run.sh
in folder package/docker/src/main/resources/docker/applicationAll plugins with their documentation can be found at plugins/README.md.
Spotify Repository Public Key missing
Indicator:
Reading package lists...
W: GPG error: http://repository.spotify.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5E3C45D7B312C643
E: The repository 'http://repository.spotify.com stable InRelease' is not signed.
The command '/bin/sh -c apt-get update' returned a non-zero code: 100
Sending build context to Docker daemon 15.36kB
Step 1/12 : FROM maximilianvoss/musicsyncbase
pull access denied for maximilianvoss/musicsyncbase, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
[ERROR] Command execution failed.
Resolution:
Retry after a certain amount of time - sometimes days. This is an error on Spotify's server infrastructure.