Selecting NAS album

Selecting NAS album

ludosplaceludosplace Posts: 1Member

Hi,

i'm writing a python script to access the internal music library (STORED_MUSIC) that is synchronised with a synology NAS.
It works , but how is that sync library build? I only can input like "22/4155" as location string.
I wan't to build a database in python with the synced soundtouch library, so i can use the full dlna capabilities to stream to the ST30.
The python soundtouch library from https://github.com/CharlesBlonde/libsoundtouch is imported.

device.play_media(Source.STORED_MUSIC, location, source_acc)

print(location) # 22/4155

print(source_acc) # 00113201-77e7-0011-e777-e77701321100/0

Thanks,

Ludo

Comments

  • edited 03/15/2018 - 18:43
    Zach@Bose[email protected] Posts: 143Admin

    Hi Ludo,

    Unfortunately, at this time the ability to browse NAS drives to select specific pieces of content is not supported in the Control API. Apologies for this.

    -Zach

  • jthojtho Posts: 1Member

    Is there anything you can share about how those location IDs are generated, or if they are static or do they change if you power cycle the soundtouch? I'm thinking they may be arbitrary identifiers generated when new music is discovered on the NAS by the SoundTouch, which would mean I would have to brute-force an attempt at collecting them. Not that attractive if they are random, but at least doable if they are either generated from song meta data (unlikely) or sequential.

    I have the same requirement here as the OP - I am writing Python to control playback of NAS-hosted songs on my SoundTouches. (20,000 songs in my case)

  • edited 08/12/2018 - 14:56
    razfaz32razfaz32 Posts: 1Member

    Hi Zach,

    I don't need to browse the content, but I'd like to play a specific piece of music from the NAS triggered by a certain event. Is there a way to play a specific piece of music stored on the NAS, if I know the exact artist, album, title, track, genre, ...?

  • Zach@Bose[email protected] Posts: 143Admin

    Hi razfaz32,

    The only supported way to place a specific piece of content that's not a preset is to capture the ContentItem from /now_playing, and then POST that to /select. This will require you to first start the content via a SoundTouch app, but once you capture the ContentItem, you'll be all set.

  • KoronthKoronth Posts: 1Member

    Hi Zach,

    unfortunately the "ContentItem" tag does not seem to have any members, that could specify the position and time within a playlist. The accordings tags "offset" and "time" appear outside the "ContenItem" tag, only.

    Is it true that the "offset" & "time" tags are readonly?

    Are there any (hidden) attributes or else that makes /select more accurate than just selecting the playlist (e.g. an M3U playlist from NAS with 1015 MP3 files within) ?

    Currently one can only /select the playlist which then begins from the very start (in case the SoundTouch hasn't seen this playlist before or was disconnected from power).

  • Zach@Bose[email protected] Posts: 143Admin

    Hi Koronth,

    Thanks for reaching out. Unfortunately, your observations are correct, in that the official API does not support starting playback of ContentItems within the item.

    I chatted with the team briefly about this and you might be able to achieve what you are looking for via upnp. However, we do not officially support developer use of upnp at this time, so while it may very well work for your use case, we can't at this time make any guarantees around its availability or provide technical support on its implementation. Apologies for any troubles this causes.

Sign In or Register to comment.