Twonky Server 7 navtree container id's can be used with JSON

General discussion about the media server. Feature requests. Hints, tips and tricks.
Locked
User avatar
phibertron
Posts: 1566
Joined: Sun Jan 30, 2011 5:52 pm
AV Hardware: Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Twonky Server 7 navtree container id's can be used with JSON

Post by phibertron » Thu Sep 13, 2012 3:29 am

If you are not familiar with the json feature of twonky server
It can be accessed by the following url

http://ipaddress:9000/json/feed

which would return something like the following

{"containerTitle":"root","parentId":"-1","objId":"0","containerContents":[
{"index":"0","title":"Music","objId":"0$1"
{"index":"1","title":"Photos","objId":"0$2"
{"index":"2","title":"Videos","objId":"0$3"
]}

To navigate into of the sub sections, just add the objid of an index item

http://ipaddress:9000/json/feed/0$1

which would return something like the following

{"containerTitle":"Music","parentId":"0","objId":"0$1","containerContents":[
{"index":"0","title":"Album","objId":"0$1$12"
{"index":"1","title":"All Tracks","objId":"0$1$8"
{"index":"2","title":"Artist","objId":"0$1$11"
{"index":"3","title":"Artist Index","objId":"0$1$15"
{"index":"4","title":"Artist/Album","objId":"0$1$16"
{"index":"5","title":"By Folder","objId":"0$1$13"
{"index":"6","title":"Composer","objId":"0$1$19"
{"index":"7","title":"Genre/Album","objId":"0$1$17"
{"index":"8","title":"Genre/Artist","objId":"0$1$18"
{"index":"9","title":"Genre/Song","objId":"0$1$10"
{"index":"10","title":"myTwonky","objId":"0$1$39"
{"index":"11","title":"Personal rating","objId":"0$1$14"
{"index":"12","title":"Playlists","objId":"0$1$9"
]}

Instead of having to figure out which objid is associated with each container
You can use the id of the container as defined in the view-definitions.xml
to easily navigate or link directly to containers

For example the following are for Music

/json/feed/music
/json/feed/music/all
/json/feed/music/artists
/json/feed/music/artistindex
/json/feed/music/artistalbum
/json/feed/music/composers
/json/feed/music/genre
/json/feed/music/genrealbum
/json/feed/music/genreartistalbum
/json/feed/music/rating
/json/feed/music/albums
/json/feed/music/folders
/json/feed/music/playlists
/json/feed/music/mytwonky
/json/feed/music/online
/json/feed/music/radio

For example the following are for Photos

/json/feed/picture
/json/feed/picture/all
/json/feed/picture/folders
/json/feed/picture/date
/json/feed/picture/keywords
/json/feed/picture/albums
/json/feed/picture/rating
/json/feed/picture/playlists
/json/feed/picture/geo
/json/feed/picture/mytwonky
/json/feed/picture/online

For example the following are for Video

/json/feed/video
/json/feed/video/all
/json/feed/video/albums
/json/feed/video/folders
/json/feed/video/genre
/json/feed/video/date
/json/feed/video/rating
/json/feed/video/playlists
/json/feed/video/classified
/json/feed/video/mytwonky
/json/feed/video/online
/json/feed/video/live_tv
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

Locked