-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
episodeSelector functionality added #10
Open
theovassiliou
wants to merge
17
commits into
Adeptive:master
Choose a base branch
from
theovassiliou:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
episodeSelector
Added description for episodeSelector and episodeCollector
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
added a new functionality called episode selector.
Motivation
It is not so uncommon that you would like to randomly select a content from your soundtouch location. In our household, the kids have a demand to have on a specific preset a regularly changing audio book available, but without having to take a computer, phone or tablet into their hands. Other application areas could be to rotate through a list of internet radio stations.
Requirement 1
In order to store a content on a given preset we must be able to reference the content. Soundtouch uses a combination of source, sourceAccount and location information to reference this information. We are using a music libary on a NAS. From this content there is a relatively small amount of content that we want to select from. In our case some 200 episodes. Therefore you should be able to create this pool of content with the information required by the SoundTouch system. For this I created the
episodeCollector.js
script.Usage
Will start a service that listens to update from a specific device as named in
collectorSettings.json
.Select the named device in your SoundTouch-app and select a new content. This content will be added to
data-store/libraryContent.json
. The file will be created if not existent. Select all content in the SoundTouch-App one by one that you would like to add to the libaryContent. If selecting the same content multple times, only one reference will be created inlibraryContent
.Requirement 2
We need a functionality where we can trigger an action that
libraryContent
andBecause of the limitations of the SoundTouch-API it is not possible to store a content directly for a preset. Therefore we introduced the following REST-call
In order to program a preset we
Just to make it a little bit safe, we reduce the volume on the device and restore the original volume afterwards.
The function returns a JSON object of the following format:
or
416 - Range not satisfied
error code withRequirement 3
After a while we did not know exactly what content is stored in the libraryContent. Therefore we introduced a REST-call
which returns a list of all episodes as a json object of the format:
Final remarks
As a result we have been able to create a small framework to have some content available for selection as preset. By exposing this functionality via a REST-API we are able to regularly change the content of presets for example via a cron-job or similar.
As I believe this could be usefull for other too, I propose this pull request. It should be automatically mergeable
Tested with
I tested this with Soundtouch system consisting of 6 Boses, stored media and internet radio presets.
NOTE
In order to programm a preset we have a push and HOLD the key for a while. A small extension was required in api.js