Navtree 7 (How to show folders at the root solved and more)

General discussion about the media server. Feature requests. Hints, tips and tricks.
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

Navtree 7 (How to show folders at the root solved and more)

Postby phibertron » Mon Mar 05, 2012 6:36 pm

phibertron wrote:Current Status March 22, 2012: current version 7.0.5

All tweaks are working 100% :D

In that no new issues are introduced, just new abilities you didnt have before
and most, if not all known issues with 7.0.5, are either still the same
or have been fixed by using the following tweaks


Is it still possible to add a custom container to root of the Navtree?

Twonky Server 6 Web Interface Fourth Dimension
Twonky Server 7 Web Interface Fourth Dimension

Is there still a webbrowse ability?
Why can't I password my server and and allow guest media access?
Why can't I use enableweb=1 and access Twonky Server?

Twonky Server 7 Web Interface myLibrary

Can I access myTwonky from my Twonky Server from DLNA clients?
Can I access Twonky Server from myTwonky?

Twonky Server 7 Web Interface myTwonky

What do I need to know about editing the navtree?

Custom View.xml Guidelines
Custom View-Definitions.xml Guidelines
Custom Navtree Guidelines

What are some of the other ways custom navtree's could be applied besides the obvious?

Twonky Server Multiple Instances

What are some of the ways I can customize the web interface for custom navtree's?

Custom Web Interface Menubar
Custom Web Interface Metadata View
Custom Web Interface Media Thumbnail View
Custom Web Interface Folder Thumbnail View
Custom Web Interface Starting Page
Custom Web Interface Starting Media
Custom Web Interface Starting Container
Custom Web Interface Relative Links

Twonky Server Web Interface Access?

Custom Web Interface Hide Settings
Custom Web Interface Authentication
Custom Web Interface Local Access
Custom Web Interface Remote Access

Twonky Server Settings Interface?

Custom Settings Interface add Rebuild Database button
Custom Settings Interface add iTunes Library setting
Custom Settings Interface increase page link font size
Custom Settings Interface Twonky Search

Is there a download available of all the above examaples?

Twonky Server 7 Web Interface My Library Example
Twonky Server 7 Navtree My Library Example
Twonky Server 7 Multiple Views My Library Example


What are some of the possibilities for creating a custom Navtree?

?

Music Containers at the root of Navtree
Photo Containers at the root of Navtree
Video Containers at the root of Navtree
All Containers at the root of Navtree
Mixed Containers at the root of Navtree

Music Folders at the root of Music Container
Photo Folders at the root of Photo Container
Video Folders at the root of Video Container
All Folders at the root of All Containers

Music Folders at the root of Navtree
Photo Folders at the root of Navtree
Video Folders at the root of Navtree

What are some of the possibilities for creating a custom Containers?
.
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

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 6 Web Interface Fourth Dimension

Postby phibertron » Mon Mar 05, 2012 6:39 pm

The Twonky Server 6 Web Interface allowed for displaying of
more than the 3 default containers at the root of the navtree

Media as seen from the Twonky Server 6 Web Interface with 4 containers

ts6 webbrowse.png
ts6 webbrowse.png (49.36 KiB) Viewed 64525 times


Media as seen from a DLNA client with 4 containers

ts6 upnp.PNG
ts6 upnp.PNG (37.78 KiB) Viewed 64525 times


Though there is one place it will not show, the Twonky Server 6 Flash Interface
As it is hard coded to only use the default root containers of Music, Photo, Video

http ://192.168.100.200:9000/resources/remote/remoteaccess.html

ts6 flash player.png
ts6 flash player.png (58.26 KiB) Viewed 64471 times


You could simply add a custom container to the root of the navtree
by editing the vew.xml and the view-definitions.xml
with the use of a link and a groupid

advanced.view.xml

<container id='music' > </container>
<container id='picture' > </container>
<container id='video' > </container>
<link groupid='custom' />

view-definitions.xml

<container name='music' id='music' ...
<container name='pictures' id='picture' ...
<container name='videos' id='video' ...
<container name='Custom' groupid='custom'...

You can/could even add more containers to the root

<link groupid='custom1' />
<container name='Custom 1' groupid='custom1'...

<link groupid='custom2' />
<container name='Custom 2' groupid='custom2'...

<link groupid='custom3' />
<container name='Custom 3' groupid='custom3'...

NOTE:
How a Media Streamer Client enumerates the data from Twonky Server
can vary from device to device

For Ex:
The XBox dashboard has buttons for Music, Photo, Video
these buttons are mapped directly to the containers on the server
and as such can not see any root folders besides those three defaults

The PS3 also has menu items for Music, Photo, Video
that are not mapped to containers
these menu items do enumerate what is given from Twonky Server
and as such you would see the custom folder or folders

.
This behavior has changed with the new Twonky Server 7 Web Interface
Read on to see what I mean

.
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

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 Web Interface Fourth Dimension

Postby phibertron » Mon Mar 05, 2012 6:44 pm

The Twonky Server 7 Web Interface does not allow for displaying of
more than the 3 default containers at the root of the navtree

Media as seen from the Twonky Server 7 Web interface with 3 Containers

ts7 webbrowse.png
ts7 webbrowse.png (23.75 KiB) Viewed 64525 times


Media as seen from a DLNA client with 3 Containers

ts7 upnp 1.PNG
ts7 upnp 1.PNG (34.28 KiB) Viewed 64525 times


So what happens if we add a fourth container?

Note:
At present groupid is not working with Twonky Server 7
I do have a couple of workarounds, that show how to do the example below
they will be listed later on in this thread


The new Twonky Server 7 Web interface is hard coded to only list Music, Photo, Video
There is no menu or button to select to view anything else

ts7 webbrowse 2.png
ts7 webbrowse 2.png (30.61 KiB) Viewed 64510 times


I have actually figured out how to get the web interface to show Nth dimensions
Custom Navtree Menubar


However, this is how it is seen from a DLNA client with 4 containers

ts7 upnp 2.PNG
ts7 upnp 2.PNG (34.42 KiB) Viewed 64525 times
.

Even though the Twonky Server 7 Web interface doesnt show the custom container
The Custom container is there, and accessable,
The id to use can found with RSS or JSON data

http ://192.168.100.105:9000/#id=0&startPage=0&count=0

ts7 webbrowse 4.png
ts7 webbrowse 4.png (23.75 KiB) Viewed 64415 times


http ://192.168.100.105:9000/#id=0$29&startPage=0&count=0

ts7 webbrowse 3.png
ts7 webbrowse 3.png (38.21 KiB) Viewed 64487 times


If you were curious, here are references for Root, Music, Photo, Video

http ://192.168.100.105:9000/#id=0&startPage=0&count=0
http ://192.168.100.105:9000/#id=0$1&startPage=0&count=0
http ://192.168.100.105:9000/#id=0$2&startPage=0&count=0
http ://192.168.100.105:9000/#id=0$3&startPage=0&count=0

NOTE:
How a Media Streamer Client enumerates the data from Twonky Server
can vary from device to device

At present it appears the Twonky Server 7 web enumeration is like the Xbox example below
with the exception of RSS and JSON feeds

For Ex:
The XBox dashboard has buttons for Music, Photo, Video
these buttons are mapped directly to the containers on the server
and as such can not see any root folders besides those three defaults

The PS3 also has menu items for Music, Photo, Video
that are not mapped to containers
these menu items do enumerate what is given from Twonky Server
and as such you would see the custom folder or folders


http ://192.168.100.105:9000/rss

ts7 rss.png
ts7 rss.png (31.17 KiB) Viewed 64490 times


http ://192.168.100.105:9000/json/feed

ts7 json.png
ts7 json.png (56.55 KiB) Viewed 64490 times


JSON deserves its own thread,
so I wont go into that topic here,
as it isnt needed, except for the above example
.
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

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 Web Interface myLibrary

Postby phibertron » Mon Mar 05, 2012 6:48 pm

The Twonky Server 7 Web Interface redesign is the new version of webbrowse
and the default start behavior is to go to the settings page???

Twonky Server 6 has the ability to make it go to the media browser page
and not the config page with the following setting

# on base URL start media browser and not config pages
startupmb=1

Twonky Server 7 does not have this setting!


ts7 default.png
ts7 default.png (25.57 KiB) Viewed 64525 times


Oh but wait, there's more...

The first, and I mean first thing I do, is password config access to the server
So, thats what I did

ts7 config password.png
ts7 config password.png (31.34 KiB) Viewed 64519 times


Note: This can also be achieved by editing the following entries

twonkyserver.ini

# for protection of the web config pages
accessuser=admin

# for protection of the web config pages
accesspwd=password


After doing that, I was greeted with a login prompt
If I had to guess, its probably based off it having to go to the settings page first by default
which by the way we cant change, as I noted above

So I thought, Ok no problem, I'll just go to one of the media urls
For Ex: http ://192.168.100.105:9000/#music

Sorry Dave, wrong answer, that doesnt work either
Thanks for playing!

ts7 media password.png
ts7 media password.png (30.1 KiB) Viewed 64519 times


Time for a different tactic
There is a setting in the twonkyserver.ini
that is used to control wether or not the config pages
are available from the local host (aka being on the computer/device)
or from a remote browser (aka not on the computer/device)
So I removed the access username and password
and then set enableweb=1

Note: This can be achieved by editing the twonkyserver.ini
as there is no gui option to do this

twonkyserver.ini

# access to web config pages, 0 for denied, 1 for local only, 2 for open
enableweb=1


Houston, I think we have a problem here
That made it even worse, as nothing is now available via a web browser

ts7 enableweb.png
ts7 enableweb.png (16.32 KiB) Viewed 64519 times


Note:
Server access via DLNA, RSS, and JSON is still there with either of the above issues

http ://192.168.100.105:9000/rss
http ://192.168.100.105:9000/rss/feed
http ://192.168.100.105:9000/json/feed

RPC access is blocked with enablweb=1 or enableweb=0
Which is by design, and has been that way for a while

http ://192.168.100.105:9000/rpc/info_status


I can only hope that the above problems are fixed asap!
as the only current way to lockdown you server and access your local media
would be to open a browser to mytwonky.com and login to access your local media
which is what Twonky is probably intending one to do
Its just not what I want to do

http ://my.twonky.com/content/mylibrary

mytwonky library 1.png
mytwonky library 1.png (46.63 KiB) Viewed 64473 times

.
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

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 Web Interface myTwonky

Postby phibertron » Mon Mar 05, 2012 6:52 pm

In a nutshell Twonky 7.0.5 Special is the version of Twonky Server 7
that you can either choose to login to myTwonky or not to
You can do this by registering your server (Note: clicking that button produces a popup)
Which in essence is the same thing as logging into myTwonky with no time limit
If you choose to de-register you server with your account, you can do that also

Note
registering your server is not mandatory, and you server will stream on without out it :D
Though you will need a key for your product
Existing key owners of Twonky Server version 4,5,6 will work


ts7 register servr 1.png
ts7 register servr 1.png (36.46 KiB) Viewed 64459 times

ts7 register servr 2.png
ts7 register servr 2.png (32.23 KiB) Viewed 64459 times

ts7 register servr 3.png
ts7 register servr 3.png (39.97 KiB) Viewed 64459 times


What does registering my server get me?
It gives you all of the My Stuff that myTwonky offers

ts7 register servr 4.png
ts7 register servr 4.png (38.38 KiB) Viewed 64459 times

ts7 register servr 5.png
ts7 register servr 5.png (34.17 KiB) Viewed 64459 times

ts7 register servr 6.png
ts7 register servr 6.png (31.54 KiB) Viewed 64459 times


What does it give me if my server is not registered?
It gives all of the Featured Stuff that myTwonky offers

mytwonky video.png
mytwonky video.png (33.95 KiB) Viewed 64523 times

mytwonky photo.png
mytwonky photo.png (30.71 KiB) Viewed 64523 times

mytwonky music.png
mytwonky music.png (32.39 KiB) Viewed 64523 times


Oh and by the way, forget about streaming it via DLNA
I tried on my Xbox, PS3, and Phone
I never got mediafusion to do it either
But if someone knows of clients that will do it, I would love to know

mytwonky video 3.PNG
mytwonky video 3.PNG (43.73 KiB) Viewed 64523 times

mytwonky photo 2.PNG
mytwonky photo 2.PNG (28.69 KiB) Viewed 64523 times

mytwonky music 1.PNG
mytwonky music 1.PNG (29.85 KiB) Viewed 64523 times


Here is the view of you media from my.twonky.com
The difference is you have to loginto you account
But doing so, gets you folders with icons,
and all your My Stuff

mytwonky library.png
mytwonky library.png (31.09 KiB) Viewed 64509 times

mytwonky library 1.png
mytwonky library 1.png (46.63 KiB) Viewed 64509 times

mytwonky library 2.png
mytwonky library 2.png (43.87 KiB) Viewed 64509 times

mytwonky library 3.png
mytwonky library 3.png (64.77 KiB) Viewed 64509 times


So why did I just go over all of this?
Because if you are thinking of editing your Navtree,
Your gonna need to know where and what is going to be affected by doing so

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

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

Custom View.xml Guidelines

Postby phibertron » Mon Mar 05, 2012 6:55 pm

This is the default location where the view files are located on windows
On other OS's and NAS devices the path would be similiar to /twonkymedia/resources/views
1. the view.xml files reference idstrings in the view-definitions.xml
2. the reference idstrings must be valid idstrings (what they are is always a mystery)
3. groupid no longer exists!, hance the valid idstrings requirement

C:\Program Files\TwonkyMedia\resources\views

advanced.view.xml
classified.view.xml
folder.view.xml
ipodlike.view.xml
mobile.view.xml
playlists.view.xml
simple.view.xml

view-definitions.xml


This is a copy of the advanced.view.xml
Which I renamed to mylibrary.view.xml
I'm doing this as an example of how to create your own custom view
1. it must be placed in the views folder
2. it must have a unique name='' and the path='' must be its name without the ext ".xml"
3. its name='' must be referenced in the view-definitions.xml to be usable

<view name='mylibrary' path='mylibrary.view'>
<navtree>

<container id='music'>
<link id='music/all' />
<link id='music/artists' />
<link id='music/artistindex' />
<link id='music/artistalbum' />
<link id='music/genre' />
<link id='music/genrealbum' />
<link id='music/genreartistalbum' />
<link id='music/rating' />
<link id='music/albums' />
<link id='music/folders' />
<link id='music/playlists' />
<link id='music/mytwonky' />
</container>

<container id='picture' >
<link id='picture/all' />
<link id='picture/folders' />
<link id='picture/date' />
<link id='picture/keywords' />
<link id='picture/albums' />
<link id='picture/rating' />
<link id='picture/playlists' />
<link id='picture/mytwonky' />
</container>

<container id='video' >
<link id='video/all' />
<link id='video/albums' />
<link id='video/folders' />
<link id='video/date' />
<link id='video/rating' />
<link id='video/playlists' />
<link id='video/mytwonky' />
</container>

</navtree>
</view>


You can mix and match what you want
Twonky has already done this with some of the builtin views listed above

<view name='mylibrary' path='mylibrary.view'>
<navtree>

<container id='music'>
<link id='music/albums' />
<link id='music/playlists' />
<link id='music/mytwonky' />
</container>

<container id='picture' >
<link id='picture/keywords' />
<link id='picture/albums' />
<link id='picture/mytwonky' />
</container>

<container id='video' >
<link id='video/folders' />
<link id='video/date' />
<link id='video/mytwonky' />
</container>

</navtree>
</view>


By not putting any <link id=''/> statements in a view container
It will default to using all of the containers in the view-definitions.xml for that <container id='' />
In the previous example each view container would only return 3 containers
the below example would return all items from that container in the view-definitions.xml

Note: <container id='music'></container> is the same as <container id='music' />

<view name='mylibrary' path='mylibrary.view'>
<navtree>

<container id='music'>
</container>

<container id='picture' >
</container>

<container id='video' >
</container>

</navtree>
</view>



<view name='mylibrary' path='mylibrary.view'>
<navtree>
<container id='music'/>
<container id='picture'/>
<container id='video'/>
</navtree>
</view>


The following are also possible
<link id=''/> can be used outside of a container in the view.xml
1. it must be set to a valid id string
2. the id string has to be a root container id in the view-definitions.xml
3. the id string can not be a sub container id in the view-definitions.xml

<view name='mylibrary' path='mylibrary.view'>
<navtree>
<container id='music'/>
<container id='picture'/>
<container id='video'/>
<link id='must be a valid id string' />
</navtree>
</view>


<view name='mylibrary' path='mylibrary.view'>
<navtree>
<link id='must be a valid id string' />
</navtree>
</view>


And then there is this, yup nothing, sort of
Why would one to do this?
One would do this, if they did not the web interface to show anything
Though, the hard codeded server returns for 0$1, 0$2, 0$3 aka: Music, Phot0, Video still work
So, clients that are hard coded to pull that data would still get that data
but it would be based on the configuration of the view-definitions.xml containers not the view.xml
as you'll learn later on, it is possible to have them appear differently, or appear the same

<view name='mylibrary' path='mylibrary.view'>
<navtree>

</navtree>
</view>

.
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

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

Custom View-Definitions.xml Guidelines

Postby phibertron » Mon Mar 05, 2012 6:58 pm

This is the default location where the view-definitions.xml is located on windows
On other OS's and NAS devices the path would be similiar to /twonkymedia/resources/views

Note: As a reminder groupid does not exist anymore!

C:\Program Files\TwonkyMedia\resources\views

advanced.view.xml
classified.view.xml
folder.view.xml
ipodlike.view.xml
mobile.view.xml
playlists.view.xml
simple.view.xml

view-definitions.xml


The first thing the View-Definitions.xml does it define itself as the "base"
and to associate itself with a list of view files with viewlist
also to provide a string to display in the Web Setup Interface with guilist

<view name='base' viewlist='advanced,folder,ipodlike,simple,classified,playlists,mobile' guilist='advanceddefault,ipodlike,simpledefault,byfolder,mobile'>


By default the viewlist is associated with the default viewlists
1. If you modify your View-Definitions.xml it is possible to get a blank navtree
2. to get around having to edit all of the veiws, I just work off of one mylibrary.view file I create
3. if you needed to have more views, you could create additional views, and add them to the list

<view name='base' viewlist='mylibrary' guilist='mylibrary'>


By default the View-Definitions.xml has everything it needs and in the expected places which the views link to
1. the view-definitions.xml defines what id and idstring is associated with what container
2. the id's idstring must be a valid idstring (what the complete list is, is always a mystery)
3. the id's listed in a view.xml must exist in the the view-definitions.xml
4. the id's in the in the view-definitions.xml must all exist, you can not delete them, you can move them though
5. groupid no longer exists!, hance the valid idstring requirement

By default the view-definitions.xml contains 3 root containers

<navtree sortcriteria='+upnp:originalTrackNumber'>

<container name='music' id='music'
<container name='pictures' id='picture'
<container name='videos' id='video'

</navtree>


By default the following exist in the <container name='music' id='music'


<container name='music' id='music'

<container name='alltracks' id='music/all'
<container name='artist' id='music/artists'
<container name='artistindex' id='music/artistindex'
<container name='composer' id='music/composers'
<container name='rating' id='music/rating'
<container name='artistalbum' id='music/artistalbum'
<container name='genre' id='music/genre'
<container name='genrealbum' id='music/genrealbum'
<container name='genreartist' id='music/genreartistalbum'
<container name='album' id='music/albums'
<container name='byfolder' id='music/folders'
<container name='playlists' id='music/playlists'
<container name='mytwonky' id='music/mytwonky'

</container>


By default the following exist in the <container name='pictures' id='picture'

<container name='pictures' id='picture'

<container name='allpictures' id='picture/all'
<container name='byfolder' id='picture/folders'
<container name='bydate' id='picture/date'
<container name='keywords' id='picture/keywords'
<container name='album' id='picture/albums'
<container name='rating' id='picture/rating'
<container name='slideshows' id='picture/playlists'
<container name='geo' id='picture/geo'
<container name='mytwonky' id='picture/mytwonky'

</container>


By default the following exist in the <container name='videos' id='video'.

Note: <container name='genre' id='video/genre' does not, but it is valid, so I added it

<container name='videos' id='video'.

<container name='allvideos' id='video/all'
<container name='byfolder' id='video/folders'
<container name='title' id='video/titleindex'
<container name='bydate' id='video/date'
<container name='album' id='video/albums'
<container name='genre' id='video/genre'
<container name='rating' id='video/rating'
<container name='playlists' id='video/playlists'
<container name='classifiedvideos' id='video/classified'
<container name='mytwonky' id='video/mytwonky'

</container>


As I stated earlier, all items from the default mus exist, but they can be moved around
You can also have sub/child containers that have no id, inside of root/parent containers

1. The below examples are a valid navtree's
2. Viewing them is reliant on a valid view.xml
3. From a DLNA client, they would see all of those at the root of the navigation tree
4. From Web Interface they would only see the Music, Photo, Video container contents
5. From a MPV hard code client (for ex: xbox) they would only see the Music, Photo, Video container contents

Note: The below two examples, do rely on an Custom View.xml that is appropriate

The following is an example of all of the sub containers with fixed idstrings
Existing outside of the default root containers of Music, Photo, Video
Yes, the below example would have a lot of containers at the root of the navtree :D

<navtree sortcriteria='+upnp:originalTrackNumber'>

<container name='alltracks' id='music/all'
<container name='artist' id='music/artists'
<container name='artistindex' id='music/artistindex'
<container name='composer' id='music/composers'
<container name='rating' id='music/rating'
<container name='artistalbum' id='music/artistalbum'
<container name='genre' id='music/genre'
<container name='genrealbum' id='music/genrealbum'
<container name='genreartist' id='music/genreartistalbum'
<container name='album' id='music/albums'
<container name='byfolder' id='music/folders'
<container name='playlists' id='music/playlists'
<container name='mytwonky' id='music/mytwonky'

<container name='allpictures' id='picture/all'
<container name='byfolder' id='picture/folders'
<container name='bydate' id='picture/date'
<container name='keywords' id='picture/keywords'
<container name='album' id='picture/albums'
<container name='rating' id='picture/rating'
<container name='slideshows' id='picture/playlists'
<container name='geo' id='picture/geo'
<container name='mytwonky' id='picture/mytwonky'

<container name='allvideos' id='video/all'
<container name='byfolder' id='video/folders'
<container name='title' id='video/titleindex'
<container name='bydate' id='video/date'
<container name='album' id='video/albums'
<container name='genre' id='video/genre'
<container name='rating' id='video/rating'
<container name='playlists' id='video/playlists'
<container name='classifiedvideos' id='video/classified'
<container name='mytwonky' id='video/mytwonky'

<container name='music' id='music'
<container name='pictures' id='picture'
<container name='videos' id='video'

</navtree>


The following is an example of sub/child containers that have no id, inside of root/parent containers

<navtree sortcriteria='+upnp:originalTrackNumber'>

<container name='alltracks' id='music/all'
<container name='artist' id='music/artists'
<container name='artistindex' id='music/artistindex'
<container name='composer' id='music/composers'
<container name='rating' id='music/rating'
<container name='artistalbum' id='music/artistalbum'
<container name='genre' id='music/genre'
<container name='genrealbum' id='music/genrealbum'
<container name='genreartist' id='music/genreartistalbum'
<container name='album' id='music/albums'
<container name='byfolder' id='music/folders'
<container name='playlists' id='music/playlists'
<container name='mytwonky' id='music/mytwonky'

<container name='allpictures' id='picture/all'
<container name='byfolder' id='picture/folders'
<container name='bydate' id='picture/date'
<container name='keywords' id='picture/keywords'
<container name='album' id='picture/albums'
<container name='rating' id='picture/rating'
<container name='slideshows' id='picture/playlists'
<container name='geo' id='picture/geo'
<container name='mytwonky' id='picture/mytwonky'

<container name='allvideos' id='video/all'
<container name='byfolder' id='video/folders'
<container name='title' id='video/titleindex'
<container name='bydate' id='video/date'
<container name='album' id='video/albums'
<container name='genre' id='video/genre'
<container name='rating' id='video/rating'
<container name='playlists' id='video/playlists'
<container name='classifiedvideos' id='video/classified'
<container name='mytwonky' id='video/mytwonky'

<container name='music' id='music'
<container name='container with no id' />
</container>

<container name='pictures' id='picture'
<container name='container with no id' />
</container>

<container name='videos' id='video'
<container name='container with no id' />
</container>

</navtree>

.
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

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

Custom Navtree Guidelines

Postby phibertron » Mon Mar 05, 2012 7:01 pm

When thinking about how you want your Navtree to look like
You need to know what it will look like on different clients

The challenge is to try and achieve a consistent appearance on all of your clients
Or a balance that is acceptable, sometimes not all of you goals are going to be possible
some due to Twonky Server architecure, some due to Client architecture
and then there are the limitations of what the DLNA protocol can do

In Twonky Server 6, with the way webbrowse worked, this was easliy achievable
With Twonky Server 7, there are some challenges presented with the limited Media Navtree it presents

Note: this problem is even further crippling with the removal of groupid

For Ex:

DLNA Navtree appearance
- All containers at the root of the Navtree are shown in the client interface
- this is how the ps3, sony tv's, and most hardware based media streamers present the navtree
- there are also some software prodcuts that do this, I use one on my phone and tablet

DLNA Media appearance
- Music, Photo, Video are mapped into the client interface
- this is how the xbox, some tv's, and some hardware based media streamers present the navtree

Web Interface appearance
- Music, Photo, Video are mapped into the client interface

My Twonky appearance
- Music, Photo, Video are mapped into the client interface


With the knowledge of the information previously outlined

Custom View.xml Guidelines
Custom View-Definitions.xml Guidelines

We can now attempt to see if we can meet or mitigate the issues of the media tree view
and being crippled by not being able to use groupid

For Ex:

groupid in Twonky Server 6 allowed us to create custom id's aka: groupid

mylibrary.view.xml

<container id='music' > </container>
<container id='picture' > </container>
<container id='video' > </container>
<link groupid='custom' />

view-definitions.xml

<container name='music' id='music' ...
<container name='pictures' id='picture' ...
<container name='videos' id='video' ...
<container name='Custom' groupid='custom'...


we are now left with either re-purposing existing id's
to serve other named purposes and buildon purposes or both

we can also move the id's out of the default Music, Photo, Video containers
and used id-less containers, so long as we create the corrrect view.xml to do that


The following view.xml allows for enumeration of all sub containers
for each root container listed, Music, Photo, Video
What that means is what ever is the view-definitions.xml for those containers
Will be displayed in the Navtree, regardless of it having an id or not
So you can now create as many sub containers as you want in the Music, Photo, Video containers
:D

mylibrary.view.xml

<view name='mylibrary' path='mylibrary.view'>
<navtree>
<container id='music'/>
<container id='picture'/>
<container id='video'/>
</navtree>
</view>


Note:
I should mention that the new myTwonky containers have some hard coding going on
In that if they exist outside of there respective containers, they do and dont work
So if you want o use them, I lef them in there in the below example,
if you know your not going to use them you can move them out, as it wont matter


The following view-definitions.xml meets all the criteria it needs, and that of its view.xml
In that all needed id's are in there, and there are no views referenceing id's in the wrong place
By using the above view xml and the following view definitions
you can now create/delete/name/rename or whatever you want inside of the Music, Photo, Video containers
they do not need to use id's at all or can have one as it wont matter, it will just work
the added bonus is you now have only one place to make navtree edits, not two files to edit
in addition the navtree will loook exactly the same for all clients DLNA and Web based
:D

Note:
You do not want to re-use/duplicate an id, meaing use it twice, its a bad idea to do so!
But you can use names at the same level on puporse for concatenation purposes
Which I'll get into later, as it has a few advantages, that I use a lot

view-definitions.xml

<view name='base' viewlist='mylibrary' guilist='mylibrary'>

<navtree sortcriteria='+upnp:originalTrackNumber'>

<container name='alltracks' id='music/all'
<container name='artist' id='music/artists'
<container name='artistindex' id='music/artistindex'
<container name='composer' id='music/composers'
<container name='rating' id='music/rating'
<container name='artistalbum' id='music/artistalbum'
<container name='genre' id='music/genre'
<container name='genrealbum' id='music/genrealbum'
<container name='genreartist' id='music/genreartistalbum'
<container name='album' id='music/albums'
<container name='byfolder' id='music/folders'
<container name='playlists' id='music/playlists'

<container name='allpictures' id='picture/all'
<container name='byfolder' id='picture/folders'
<container name='bydate' id='picture/date'
<container name='keywords' id='picture/keywords'
<container name='album' id='picture/albums'
<container name='rating' id='picture/rating'
<container name='slideshows' id='picture/playlists'
<container name='geo' id='picture/geo'

<container name='allvideos' id='video/all'
<container name='byfolder' id='video/folders'
<container name='title' id='video/titleindex'
<container name='bydate' id='video/date'
<container name='album' id='video/albums'
<container name='genre' id='video/genre'
<container name='rating' id='video/rating'
<container name='playlists' id='video/playlists'

<container name='music' id='music'
<container name='alltracks'
<container name='artist'
<container name='artistindex'
<container name='composer'
<container name='rating'
<container name='artistalbum'
<container name='genre'
<container name='genrealbum'
<container name='genreartist'
<container name='album'
<container name='byfolder'
<container name='playlists'
<container name='mytwonky' id='music/mytwonky'
</container>

<container name='pictures' id='picture'
<container name='allpictures'
<container name='byfolder'
<container name='bydate'
<container name='keywords'
<container name='album'
<container name='rating'
<container name='slideshows'
<container name='geo'
<container name='mytwonky' id='picture/mytwonky'>
</container>

<container name='videos' id='video'
<container name='allvideos'
<container name='byfolder'
<container name='title'
<container name='bydate'
<container name='album'
<container name='genre'
<container name='rating'
<container name='playlists'
<container name='classifiedvideos' id='video/classified'
<container name='mytwonky' id='video/mytwonky'
</container>

</navtree>
</view>


The above example is the combined brain dump from the following
Custom View.xml Guidelines
Custom View-Definitions.xml Guidelines
Custom Navtree Guidelines
And is what I will use as the basis for all of the scenarios I will be posting with downloadable files
Yes all of the previous examples were syntacticly incomplete,
they were from a container and id usage perspective not a container content perspective
I saw no need to further complicate the explinations, as the heart of the matter is the navtree and how it works
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

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 Multiple Instances

Postby phibertron » Mon Mar 05, 2012 7:04 pm

The possible applications of a custom navtree can go way beyond just that of a single navtree perpsective
In a previous thread I posted, I showed how to run multiple instances of Twonky Server
With each instance running a custom navtree appropriate to the role of the server instance

Twonky Server (How to run multiple instances with custom Navtree's)

The following is an example of 4 Twonky Server instances running on the same machine
Each root navtree has been customized to display containers at the root for its role

This is the default navtree for the first instance

ts7 root default.PNG
ts7 root default.PNG (98.59 KiB) Viewed 64424 times


This is the custom root navtree for the music server instance

ts7 root music .PNG
ts7 root music .PNG (100.67 KiB) Viewed 64424 times


This is the custom root navtree for the video server instance

ts7 root video.PNG
ts7 root video.PNG (100.68 KiB) Viewed 64424 times


This is the custom root navtree for the photo server instance

ts7 root photo.PNG
ts7 root photo.PNG (99.99 KiB) Viewed 64424 times


The one thing I havent played with completely is aggregation of servers, yes I have used it
But It would be interesting to see if it could be leveraged in the context of multiple instances
and custom navtrees to achieve similiar or different abilities that are otherwise not out of the box uses
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

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

Custom Web Interface Menubar

Postby phibertron » Mon Mar 05, 2012 7:08 pm

Current Status March 22, 2012: current version 7.0.5

I am happy to say that this following tweak is working 100% :D

1. All menu bar items (top) highlight and are retained with a page resfresh
2. All nav bar items (left) highlight and are retained with a page refresh
3. All nav items (center) display path, links, current folder and are retained with a page refresh
4. All media items (center) are displayed and are retained with a page refresh



ts7 custom 1.jpg
ts7 custom 1.jpg (26.01 KiB) Viewed 64347 times


C:\Program Files\Twonky\TwonkyServer\resources\webconfig\index.htm

Find the following in the index.htm

<li><a id="0$3" onclick="clearTimeout(updateTimer); navigateTo('video');"><span string="video">&nbsp;</span></a></li>
<li><a id="0$1" onclick="clearTimeout(updateTimer); navigateTo('music');"><span string="music">&nbsp;</span></a></li>
<li><a id="0$2" onclick="clearTimeout(updateTimer); navigateTo('photo');"><span string="photo">&nbsp;</span></a></li>

And change it this

<li><a id="0$" onclick="clearTimeout(updateTimer); navigateTo('mylibrary');"><span string="mylibrary">&nbsp;</span></a></li>
<li><a id="0$3" onclick="clearTimeout(updateTimer); navigateTo('video');"><span string="video">&nbsp;</span></a></li>
<li><a id="0$1" onclick="clearTimeout(updateTimer); navigateTo('music');"><span string="music">&nbsp;</span></a></li>
<li><a id="0$2" onclick="clearTimeout(updateTimer); navigateTo('photo');"><span string="photo">&nbsp;</span></a></li>

What was added was this

<li><a id="0$" onclick="clearTimeout(updateTimer); navigateTo('mylibrary');"><span string="mylibrary">&nbsp;</span></a></li>



C:\Program Files\Twonky\TwonkyServer\resources\webconfig\config.js

Find the following in the config.js

case "advanced":
checkChanges("loadAdvanced();");
populateSettingsNav();
break;
case "video":
loadMediaBrowse("0$3");
lastMediaId = "0$3";
break;

And change it to this

case "advanced":
checkChanges("loadAdvanced();");
populateSettingsNav();
break;
case "mylibrary":
loadMediaBrowse("0$");
lastMediaId = "0$";
break;
case "video":
loadMediaBrowse("0$3");
lastMediaId = "0$3";
break;

What was added was this

case "mylibrary":
loadMediaBrowse("0$");
lastMediaId = "0$";
break;



Find the following in the config.js

var mediaId = id.substring(0, 3);
if (mediaId != lastMediaId ) {
loadMediaBrowse(mediaId, function(){
loadMediaContents(id, startPage, count, false);
});

And change it to this

var mediaId = id.substring(0, 3);
if (mediaId != lastMediaId) {
if (id.substring(2,4) != "1$" & id.substring(2,4) != "2$" & id.substring(2,4) != "3$") mediaId = "0$";
loadMediaBrowse(mediaId, function(){
loadMediaContents(id, startPage, count, false);
});

What was added was this

if (id.substring(2,4) != "1$" & id.substring(2,4) != "2$" & id.substring(2,4) != "3$") mediaId = "0$";


Find the following in the config.js

var fragmentPieces = $.param.fragment().split("&");
if (fragmentPieces.length > 1) {
var fragmentId = fragmentPieces[0].split("=")[1];
var activeId = fragmentId.split("$").slice(0, 4);
var activeIdStr = activeId.join("$");
$("#" + activeIdStr.replace(/\$/g, "\\$").replace(/\//g, "\\/")).addClass("current");
}

And change it to this

var fragmentPieces = $.param.fragment().split("&");
if (fragmentPieces.length > 1) {
var fragmentId = fragmentPieces[0].split("=")[1];
var activeId = fragmentId.split("$").slice(0, 2);
var activeIdStr = activeId.join("$");
$("#" + activeIdStr.replace(/\$/g, "\\$").replace(/\//g, "\\/")).addClass("current");
}

What was changed was this

var activeId = fragmentId.split("$").slice(0, 2);


Find the following in the config.js

var json = parseJson(response);
html += '<div class="subHeader"><span class="subheaderTitle">' + json.containerTitle + '</span></div>';

And change it to this

var json = parseJson(response);
if ( json.containerTitle == "root" ) json.containerTitle = getString("mylibrary");
html += '<div class="subHeader"><span class="subheaderTitle">' + json.containerTitle + '</span></div>';

What was changed was this

if ( json.containerTitle == "root" ) json.containerTitle = getString("mylibrary");


Find the following in the config.js

else {
var idPieces = id.split("$");

And change it to this

else {
if ( id.indexOf("M") != -1) {
idPieces = id.split("M")[0];
idPieces = idPieces.split("$");
}
else {
idPieces = id.split("$");
}


What was changed was this

if ( id.indexOf("M") != -1) {
idPieces = id.split("M")[0];
idPieces = idPieces.split("$");
}
else {
idPieces = id.split("$");
}



Find the following in the config.js

var offset = 3;
var levels = [];
var levelsHtml = {};

And change it to this

var offset = 3;
if ( idPieces[1].length != 1 | idPieces[1] > 3 ) offset = 2;
var levels = [];
var levelsHtml = {};

What was changed was this

if ( idPieces[1].length != 1 | idPieces[1] > 3 ) offset = 2;



Find the following in the config.js

levels.push(newIdStr);
}
var numLevels = levels.length;

And change it to this

levels.push(newIdStr);
}
if ( id.indexOf("M") != -1) {
var mytwonkylevels = id.split("M");
for (var i = 1; i < mytwonkylevels.length ; i++) {
var newId = mytwonkylevels.slice(0, i + 1);
var newIdStr = newId.join("M");
levels.push(newIdStr);
}
}

var numLevels = levels.length;

What was changed was this

if ( id.indexOf("M") != -1) {
var mytwonkylevels = id.split("M");
for (var i = 1; i < mytwonkylevels.length ; i++) {
var newId = mytwonkylevels.slice(0, i + 1);
var newIdStr = newId.join("M");
levels.push(newIdStr);
}
}


Find the following in the config.js

makeGetRequest("/json/feed" + value, {}, function(data){
data = parseJson(data);

And change it to this

makeGetRequest("/json/feed" + value, {}, function(data){
data = parseJson(data);
if (data.containerTitle == "root" ) data.containerTitle = getString("mylibrary");

What was changed was this

if (data.containerTitle == "root" ) data.containerTitle = getString("mylibrary");

.
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

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

Custom Web Interface Metadata View

Postby phibertron » Mon Mar 05, 2012 7:13 pm

By default the Twonky Server Web interface will display the following meta data for an item

ts7 metadata 1.png
ts7 metadata 1.png (55.18 KiB) Viewed 64403 times


After some more peeking around in the config.js
I was able change the meta data displayed in the Twonky Server Web Interface for an item

ts7 metadata 2.png
ts7 metadata 2.png (56.15 KiB) Viewed 64403 times


We need Twonky to add more meta data item types to the JSON return!!!

For Ex: The above example desperately needs author and description (aka Director, Movie Description)

'upnp:author' would be mapped to "author":"author data return"
'dc:description' would be mapped to "description":"description data return"


If you look up the item with JSON, the return will list out what possible meta data items are possible

NOTE:
1. the data used to build the navtree is based in buidlon data from the twonky database
2. the data returned with JSON is only a subset of what is in the database

http ://127.0.0.1:9000/json/feed/0$33$195

{
"containerTitle":"Sample Videos",
"parentId":"0$33",
"objId":"0$33$195",
"containerContents":[
{
"index":"0",
"link":"http://127.0.0.1:9000/disk/DLNA-PNAVC_MP4_BL_L3L_SD_AAC-OP01-FLAGS01700000/O0$27I780.mp4",
"mime":"video/mp4",
"thumbnail":"http://127.0.0.1:9000/disk/DLNA-PNJPEG_TN-CI1-FLAGS00f00000/defaultalbumart/v_i_d_e_o.jpg/O0$27I780.jpg?scale=160x160",
"title":"test",
"objId":"0$33$195R780",
"objId":"0$27I780",
"parentId":"0$33$195",
"objType":"V",
"nodeType":"leaf",
"album":"R30",
"artist":"Rush",
"genre":"Unknown",
"duration":"0:08:50",
"contentsize":"59633171",
"year":"2005",
"resolution":"480x272",
"albumartist":"Rush, Geddy Lee, Alex Lifeson, Neil Peart, Jerry Stiller ",
"bitrate":"576000",
"playcount":"1"
}
]}


C:\Program Files\Twonky\TwonkyServer\resources\webconfig\config.js

If you want to modify meta data for video files

Find the following in the config.js

case "V":
var duration = data.duration.substring(0, data.duration.lastIndexOf("."));
if (duration.split(":")[0] == "0") {
duration = duration.substring(2, duration.length);
}
var timeDisplay = (duration) ? ('<div class="timeDisplay">' + duration + '</div>') : ("")
var datamime = data.mime;
//datamime = datamime.replace(/&amp;/g, "&");
//datamime = datamime.replace(/&quot;/g, "\"");
leafHtml += '<div class="myLibraryRow">\
<div class="myLibraryMediaIcon floatL">' + thumbnail + timeDisplay + '</div>\
<div>\
<div class="mediaData"><a class="largeFont" href="' +
data.link +
'" target="_blank">' +
data.title +
'</a></div>\
<div class="mediaData">' +
getString("filesize") +
' ' +
Math.round((parseInt(data.contentsize) / 1048576) * 100) / 100 +
' MB</div>\
<div class="mediaData">' +
getString("format") +
' ' +
datamime +
'</div>\
<div class="mediaData">' +
getString("year") +
' ' +
data.year +
'</div>\
</div>\
<div class="clear"></div>\
</div>';
break;

I changed the following in the config.js

<div class="mediaData">' +
getString("filesize") +
' ' +
Math.round((parseInt(data.contentsize) / 1048576) * 100) / 100 +
' MB</div>\
<div class="mediaData">' +
getString("format") +
' ' +
datamime +
'</div>\
<div class="mediaData">' +
getString("year") +
' ' +
data.year +
'</div>\

To this

<div class="mediaData">' +
getString("year") +
' ' +
data.year +
'</div>\
<div class="mediaData">' +
getString("genre") +
' ' +
data.genre +
'</div>\
<div class="mediaData">' +
getString("artist") +
' ' +
data.albumartist +
'</div>\


If you want to modify meta data for photo files
But the photo view, doesnt have any by default
Note: its a thumbnail only view

Find the following in the config.js

case "P":
if (!photosContainer) {
photosContainer = $('<div><div class="allPhotosContainer"></div></div>');
}
var resolutionPieces = data.resolution.split("x");
var width = parseInt(resolutionPieces[0]);
var height = parseInt(resolutionPieces[1]);
var thumbnailData = getThumbnailLink(data.thumbnail, 'P', false, width, height);
// Thumbnails for media fusion feeds are not working because scaling of non local images is not possible
if (thumbnailData.link.indexOf("httpproxy/embedded") > 0)
$(".allPhotosContainer", photosContainer).append('<a href="' + data.link + '" target="_blank"><div class="allPhotosItem"><img src="' + thumbnailData.link + '" onerror="loadDefaultThumbnail($(this), \'P\')" style="' + thumbnailData.clip + '"/></div></a>');
else $(".allPhotosContainer", photosContainer).append('<a href="' + data.link + '" target="_blank"><div class="allPhotosItem"><img src="' + thumbnailData.link + thumbnailData.scale + '" onerror="loadDefaultThumbnail($(this), \'P\')" style="' + thumbnailData.clip + '"/></div></a>');
break;


If you want to modify meta data for Music files

Find the following in the config.js

case "M":
var duration = data.duration.substring(0, data.duration.lastIndexOf("."));
if (duration.split(":")[0] == "0") {
duration = duration.substring(2, duration.length);
}
if (duration) {
duration = "(" + duration + ")";
}
leafHtml += '<div class="myLibraryListRow">\
<div class="myLibraryListIcon floatL">' + thumbnail + '</div>\
<div>\
<div class="mediaData"><a class="largeFont" href="' +
data.link +
'" target="_blank">' +
data.title +
'</a> <span class="largeFont">' +
duration +
'</span></div>\
<div class="mediaData">' +
getString("artist") +
' ' +
data.artist +
'</div>\
<div class="mediaData">' +
getString("album") +
' ' +
data.album +
'</div>\
<div class="mediaData">' +
getString("genre") +
' ' +
data.genre +
'</div>\
</div>\
<div class="clear"></div>\
</div>';
break;
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

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

Custom Web Interface Media Thumbnail View

Postby phibertron » Mon Mar 05, 2012 7:16 pm

The default view for music and video is list, but photo's have a nice thumbnail view

ts7 thumbnails 1.png
ts7 thumbnails 1.png (62.46 KiB) Viewed 64402 times


I was able to get the video view to mimic the photo view

ts7 thumbnails 2.png
ts7 thumbnails 2.png (122.81 KiB) Viewed 64402 times


C:\Program Files\Twonky\TwonkyServer\resources\webconfig\config.js

Change the following in the config.js

case "V":
var duration = data.duration.substring(0, data.duration.lastIndexOf("."));
if (duration.split(":")[0] == "0") {
duration = duration.substring(2, duration.length);
}
var timeDisplay = (duration) ? ('<div class="timeDisplay">' + duration + '</div>') : ("")
var datamime = data.mime;
//datamime = datamime.replace(/&amp;/g, "&");
//datamime = datamime.replace(/&quot;/g, "\"");
leafHtml += '<div class="myLibraryRow">\
<div class="myLibraryMediaIcon floatL">' + thumbnail + timeDisplay + '</div>\
<div>\
<div class="mediaData"><a class="largeFont" href="' +
data.link +
'" target="_blank">' +
data.title +
'</a></div>\
<div class="mediaData">' +
getString("filesize") +
' ' +
Math.round((parseInt(data.contentsize) / 1048576) * 100) / 100 +
' MB</div>\
<div class="mediaData">' +
getString("format") +
' ' +
datamime +
'</div>\
<div class="mediaData">' +
getString("year") +
' ' +
data.year +
'</div>\
</div>\
<div class="clear"></div>\
</div>';
break;

To the following

case "V":
if (!photosContainer) {
photosContainer = $('<div><div class="allPhotosContainer"></div></div>');
}
var resolutionPieces = data.resolution.split("x");
var width = parseInt(resolutionPieces[0]);
var height = parseInt(resolutionPieces[1]);
var thumbnailData = getThumbnailLink(data.thumbnail, 'V', false, width, height);
// Thumbnails for media fusion feeds are not working because scaling of non local images is not possible
if (thumbnailData.link.indexOf("httpproxy/embedded") > 0)
$(".allPhotosContainer", photosContainer).append('<a href="' + data.link + '" target="_blank"><div class="allPhotosItem"><img src="' + thumbnailData.link + '" onerror="loadDefaultThumbnail($(this), \'V\')" style="' + thumbnailData.clip + '"/></div></a>');
else $(".allPhotosContainer", photosContainer).append('<a href="' + data.link + '" target="_blank"><div class="allPhotosItem"><img src="' + thumbnailData.link + thumbnailData.scale + '" onerror="loadDefaultThumbnail($(this), \'V\')" style="' + thumbnailData.clip + '"/></div></a>');
break;


I noticed that there is code that is supposed to display the time of the media
but it wasnt working, so I made some changes to get it working

For Ex:

ts7 timedisplay.jpg
ts7 timedisplay.jpg (4.99 KiB) Viewed 64018 times


Change the following in the config.js

case "V":
var duration = data.duration.substring(0, data.duration.lastIndexOf("."));

To the following

case "V":
var duration = data.duration.split(".")[0];



By default the thumbnail for music is this tiny thing
If you want to be larger and more uniform with the way everything else is

ts mtn small.png
ts mtn small.png (13.79 KiB) Viewed 64009 times


You can change it to this

ts mtn large.png
ts mtn large.png (33.86 KiB) Viewed 64009 times


Change the following in the config.js

var musicDefaultImg = "/webconfig/gen_music_40.png";
var musicWidth = 40;
var musicHeight = 40;

To the following

var musicDefaultImg = "/webconfig/gen_folder_music_110.png";
var musicWidth = 100;
var musicHeight = 100;



Change the following in the new.css

.myLibraryListIcon {
width: 40px;
height: 40px;

.myLibraryListIcon img
{
width: 40px;
height: 40px;

To the following

.myLibraryListIcon {
width: 100px;
height: 100px;

.myLibraryListIcon img
{
width: 100px;
height: 100px;

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

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

Custom Web Interface Folder Thumbnail View

Postby phibertron » Mon Mar 05, 2012 7:21 pm

I made an update to this for version 7.0.7
that allows for the usage of a random thumbnail image
the code is posted as an attachment at the bottom of this post

Custom Web Interface Folder Random Thumbnail View.txt


Coming from the 6.x Web Interface, the 7.x Web interface is a lot more graphical
When you look at the My Twonky Web Interface you get a random thumbnail for media in a folder/container

ts7 folder thumbnail.png
ts7 folder thumbnail.png (60.44 KiB) Viewed 64380 times


That feature is present in the Twonky Server Web Interface, it just wasnt working

ts7 folder thumbnail 0.jpg
ts7 folder thumbnail 0.jpg (19.98 KiB) Viewed 63942 times


Here's how you can make it work to look like this or like mytwonky :D

ts7 folder thumbnail 1.jpg
ts7 folder thumbnail 1.jpg (28.17 KiB) Viewed 63942 times


C:\Program Files\Twonky\TwonkyServer\resources\webconfig\config.js

config.js function getFolderThumbnail

Change the following

if (json.containerItemCount > 0) {

To the following

if (json.containerContents.length > 0) {

Change the following

image.replaceWith('<img src="' + thumbnailData.link + thumbnailData.scale + '" onerror="loadDefaultThumbnail($(this), \'' + json.containerContents[0].objType + '\')" style="' + thumbnailData.clip + '"/>');

To the following

image.replaceWith('<img src="' + thumbnailData.link + thumbnailData.scale + '" onerror="loadDefaultThumbnail($(this), \'' + json.containerContents[0].objType + '\')" />');



config.js function getThumbnailLink

Change the following lines

thumbnailObj.link = photoFolderDefaultImg;

thumbnailObj.link = musicFolderDefaultImg;

thumbnailObj.scale = "?scale=" + musicFolderWidth + "x" + folderHeight;

thumbnailObj.link = videoFolderDefaultImg;

To the following

// thumbnailObj.link = photoFolderDefaultImg;

// thumbnailObj.link = musicFolderDefaultImg;

thumbnailObj.scale = "?scale=" + folderWidth + "x" + folderHeight;

// thumbnailObj.link = videoFolderDefaultImg;


C:\Program Files\Twonky\TwonkyServer\resources\webconfig\new.css

new.css

.folderImageWrapper
{
width: 185px;
height: 110px;
position: relative;
cursor: pointer;
position: relative;
}

Add the following section for proportional image scaling like the example image shows above

.folderImageWrapper img
{
padding: 3px 0;
max-height: 110px;
max-width: 185px;
}

OR add the following section for streched image scaling like mytwonky does

.folderImageWrapper img
{
padding: 3px 0;
height: 110px;
width: 185px;
}



It also worth noting that using albumart='1' will not achieve this in the Web Interface
And it does not work on devices that use there own icons for folders, for ex: ps3, xbox etc.
But there are some dlna clients that will use the thumbnail attribute for a folder if present

ts7 folder thumbnail 2.jpg
ts7 folder thumbnail 2.jpg (22.62 KiB) Viewed 64380 times


C:\Program Files\Twonky\TwonkyServer\resources\views\view-definitions.xml

view-definitions.xml

<container name='videos' id='video' albumart='1'
<container name='byfolder' albumart='1'
<container buildon='res' albumart='1'

.
Attachments
Custom Web Interface Folder Random Thumbnail View.txt
(4.72 KiB) Downloaded 603 times
Folder Images.zip
(12.21 KiB) Downloaded 659 times
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

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

Custom Web Interface Starting Page

Postby phibertron » Mon Mar 05, 2012 7:26 pm

By default the startup page the twonky server loads is the settings page
Hmm, do i want to edit my server, or go to my media

ts7 startup 1.png
ts7 startup 1.png (27.05 KiB) Viewed 64388 times


I want to go to my media, or should I say my library

ts7 startup 2.png
ts7 startup 2.png (24.41 KiB) Viewed 64388 times


C:\Program Files\Twonky\TwonkyServer\resources\webconfig\config.js

Find the following in the config.js

switch (e.fragment) {
case "":
case "status":


If you are using the My Library button I showed you how to add ealier

Change it to this

switch (e.fragment) {
case "":
loadMediaBrowse("0$");
lastMediaId = "0$";
break;

case "status":


If not, substitute it with one of the following for Music 0$1, Photo 0$2, or Video 0$3

loadMediaBrowse("0$1");
lastMediaId = "0$1";
break;

loadMediaBrowse("0$2");
lastMediaId = "0$2";
break;

loadMediaBrowse("0$3");
lastMediaId = "0$3";
break;
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

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

Custom Web Interface Starting Media

Postby phibertron » Mon Mar 05, 2012 7:33 pm

In the previous example, Custom Navtree Starting Page
You saw how to make the default page go to a media page
In this example
We can make each media type page My Library, Music, Photo, Video and Default
populate the right side with the contents of that media type

For Ex:

ts7 startup selection 1.png
ts7 startup selection 1.png (33.36 KiB) Viewed 64374 times


C:\Program Files\Twonky\TwonkyServer\resources\webconfig\config.js

Find the following in the config.js

case "video":
loadMediaBrowse("0$3");
lastMediaId = "0$3";
break;
case "music":
loadMediaBrowse("0$1");
lastMediaId = "0$1";
break;
case "photo":
loadMediaBrowse("0$2");
lastMediaId = "0$2";
break;

And change it to this

case "video":
loadMediaBrowse("0$3");
lastMediaId = "0$3";
navigateTo("id=0$3&startPage=0&count=0");
break;
case "music":
loadMediaBrowse("0$1");
lastMediaId = "0$1";
navigateTo("id=0$1&startPage=0&count=0");
break;
case "photo":
loadMediaBrowse("0$2");
lastMediaId = "0$2";
navigateTo("id=0$2&startPage=0&count=0");
break;

What was added was this

navigateTo("id=0$3&startPage=0&count=0");
navigateTo("id=0$1&startPage=0&count=0");
navigateTo("id=0$2&startPage=0&count=0");



If you are using the My Library tweak also do the following

case "":
loadMediaBrowse("0$");
lastMediaId = "0$";
navigateTo("id=0$&startPage=0&count=0");
break;

case "mylibrary":
loadMediaBrowse("0$");
lastMediaId = "0$";
navigateTo("id=0$&startPage=0&count=0");
break;


Note:
Unless you know how many items will be on the page, you have to use count=0
But the problem is in using count=0 is that the 25 item per page logic is bypassed
So if there were 100 items, they would be returned on that page,
and there would be no page counter on the buttom, for ex:, 1,2,3,4
This is dealt with in the next post
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

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

Custom Web Interface Starting Container

Postby phibertron » Mon Mar 05, 2012 7:37 pm

In the previous example, Custom Navtree Starting Media
You saw how to populate the right side with the contents of that media type
In this example
We are going make each media type page My Library, Music, Photo, Video and Default
navigate to the first container for that media type

For Ex:

ts7 startup first 1.jpg
ts7 startup first 1.jpg (24.48 KiB) Viewed 64323 times


C:\Program Files\Twonky\TwonkyServer\resources\webconfig\config.js

Find the following in the config.js

var json = parseJson(response);
$.each(json.containerContents, function(i, data){

And change it to this

var firstobjid;
var json = parseJson(response);
$.each(json.containerContents, function(i, data){
if (firstobjid == null) firstobjid = "id=" + data.objId + "&startPage=0&count=" + data.childCount;

What was added was this

var firstobjid;
"id=" + data.objId + "&startPage=0&count=" + data.childCount;



Find the following in the config.js

var fragmentPieces = $.param.fragment().split("&");
if (fragmentPieces.length > 1) {
var fragmentId = fragmentPieces[0].split("=")[1];
var activeId = fragmentId.split("$").slice(0, 2);
var activeIdStr = activeId.join("$");
$("#" + activeIdStr.replace(/\$/g, "\\$").replace(/\//g, "\\/")).addClass("current");
}

And change it to this

var fragmentPieces = $.param.fragment().split("&");
if (fragmentPieces.length > 1) {
var fragmentId = fragmentPieces[0].split("=")[1];
var activeId = fragmentId.split("$").slice(0, 2);
var activeIdStr = activeId.join("$");
$("#" + activeIdStr.replace(/\$/g, "\\$").replace(/\//g, "\\/")).addClass("current");
}
else {
navigateTo( firstobjid );
}


What was added was this

else {
navigateTo( firstobjid );
}

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

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

Custom Web Interface Relative Links

Postby phibertron » Mon Mar 05, 2012 7:43 pm

Current Status as of April 10 2012
Added code to deal with folder thumbnails

This is working like a charm on local and remote networks :D

1. All Thumbnails are shown and linked accordingly
2. All Music, Photos, Video are linked accordingly
3. All Music, Photos, Video are playable or viewable

Known Caveats:

Playlists
The play button for playlists is server side created m3u playlist
The items in the generated playlist have an ip of the local server
The playlist will not work remotely, as the items listed in have ip of the local server

myTwonky
The links for myTwonky media are passed through the twonkyproxy on port 9055
So in addition to port 9000, access to port 9055 is also needed for myTwonky ljnks
At present the port used for twonkyproxy cannot be changed
Do not attempt to set the server port to 9055 either, bad things will happen!



By Default Twonky Server Web Interface will use static link paths
for thumbnails, media, and playlists
The static link path is based off of the server ip and port it is configured for

For Ex:
A thumbnail would be linked to http ://192.168.100.105:9000/disk/DLNA/O0$20I2315.jpg?scale=133x100
A photo item would be linked to http ://192.168.100.105:9000/disk/DLNA/O0$20I2315.jpg
A music item would be linked to http ://192.168.100.105:9000/disk/DLNA/O0$8I522.mp3
A video item would be linked to http ://192.168.100.105:9000/disk/DLNA/O0$27I268.mp4

The problem with this is that if you are not on that network segment, 192.168.100
and or it is not routable to your network
You would be unable to see the thumbnails, playists, or media

For Ex:
If you opened a page to http ://servername:9000/
You would expext that all the items on the page to be linked to http ://servername:9000/ some link here
But what you get are pages rendered on http ://servername:9000/ with links to http ://192.168.100.105:9000/

A Static Link to a url

    <a href="http ://192.168.100.105:9000/disk/DLNA/O0$27I268.mp4">A Song</a>

A Relative Link to a url (rendering will be based off the current base url)

    <a href="disk/DLNA/O0$27I268.mp4">A Song</a>
    or
    <a href="/disk/DLNA/O0$27I268.mp4">A Song</a>

Which if the base url was http: //servername:9000,
would be the following relative result ,when it is rendered by the browser
or from a perspective concatenated

    <a href="http: //servername:9000/disk/DLNA/O0$27I268.mp4">A Song</a>

Note:
The following tweak for hopefully obvious reasons, will only work for the web interface
It will not work for DLNA or RSS protocols, as that is being rendered by the server, not via HTML

C:\Program Files\Twonky\TwonkyServer\resources\webconfig\config.js

Find the following in the config.js

else {
// nodeType is leaf
var thumbnail = "";
if (data.thumbnail && data.objType != "P") {

And change it to this

else {
// nodeType is leaf
if ( data.objId.indexOf("M") == -1 ) {
data.link = "/" + data.link.split("/").slice(3).join("/");
data.thumbnail = "/" + data.thumbnail.split("/").slice(3).join("/");
}
else {
data.link = window.location.protocol + "//" + window.location.hostname + ":9055/" + data.link.split("/").slice(3).join("/");
}

var thumbnail = "";
if (data.thumbnail && data.objType != "P") {

What was added was this

if ( data.objId.indexOf("M") == -1 ) {
data.link = "/" + data.link.split("/").slice(3).join("/");
data.thumbnail = "/" + data.thumbnail.split("/").slice(3).join("/");
}
else {
data.link = window.location.protocol + "//" + window.location.hostname + ":9055/" + data.link.split("/").slice(3).join("/");
}



Find the following in the config.js

$.each(data.containerContents, function(key, value){
if (value.objId == json.objId && value.playlist) {

And change it to this

$.each(data.containerContents, function(key, value){
if (value.objId == json.objId && value.playlist) {
value.playlist = "/" + value.playlist.split("/").slice(3).join("/");

What was added was this

value.playlist = "/" + value.playlist.split("/").slice(3).join("/");


Find the following in the config.js

else {
image.replaceWith('<img src="' + thumbnailData.link + thumbnailData.scale + '" onerror="loadDefaultThumbnail($(this), \'' + json.containerContents[0].objType + '\')" style="' + thumbnailData.clip + '"/>');
}

And change it to this

else {
if( json.containerContents[0].objId.indexOf("M") == -1) {
thumbnailData.link = thumbnailData.link.split("/").slice(3).join("/");
}

image.replaceWith('<img src="' + thumbnailData.link + thumbnailData.scale + '" onerror="loadDefaultThumbnail($(this), \'' + json.containerContents[0].objType + '\')" style="' + thumbnailData.clip + '"/>');
}

What was added was this

if( json.containerContents[0].objId.indexOf("M") == -1) {
thumbnailData.link = thumbnailData.link.split("/").slice(3).join("/");
}


Note:
For all of you out there, who grasp what this means
It means it is a way to access the server from a port forward on your router
you DO NOT have to configure remote access in the server.ini at all
and you will actually have the ability to click on links that actually access your media :D
If you do that, then...
DO NOT FORGET TO PASSWORD YOUR SERVER

Also:
If the enableweb setting is set to 0 or 1, you will not be able to access the web interface on lan or wan

The following attachments have been pre-edited for your convienence
Attachments
7.0.11 config.js.txt
(158.58 KiB) Downloaded 723 times
7.0.9 config.js.txt
(156.37 KiB) Downloaded 648 times
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

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

Custom Web Interface Hide Settings

Postby phibertron » Mon Mar 05, 2012 7:48 pm

By Default the Settings menu link is located on the far right side of the menu bar

Now you see it

ts7 settings  1.png
ts7 settings 1.png (38.94 KiB) Viewed 64305 times


Now you dont

ts7  settings 2.png
ts7 settings 2.png (38.51 KiB) Viewed 64305 times


The settings page is actually a menu, and is still accessable
I just wanted to keep it off the main page
And by going to any of the following url's, it brings you to the settings page

http ://127.0.0.1:9000/#status
http ://127.0.0.1:9000/#setup
http ://127.0.0.1:9000/#sharing
http ://127.0.0.1:9000/#aggregation
http ://127.0.0.1:9000/#synchronization
http ://127.0.0.1:9000/#advanced

C:\Program Files\Twonky\TwonkyServer\resources\webconfig\index.htm

Find the following in the index.htm

<ul class="loginContainer">
<li class="loginItem largestFont"><a onclick="clearTimeout(updateTimer); navigateTo('status');"><span string="settings"></span></a></li>
</ul>

Change it to this

<ul class="loginContainer">
</ul>


Note:
Even though you can hide the settings, the following still applies
If the server password is set, you will still need to enter credentials
If the enableweb setting is set to 0 or 1, you will not be able to access the web interface on lan or wan
.
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

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

Custom Web Interface Authentication

Postby phibertron » Mon Mar 05, 2012 7:52 pm

On the to do list is to allow for guest access to media
while still requireing credentials for access to setup

At present it is not possible to do that
Previoulsy this was done via a seperate web page
Currently its all in one, media and setup
So if you password the server, you need credentials to access media
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

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

Custom Web Interface Local Access

Postby phibertron » Mon Mar 05, 2012 7:55 pm

On the to do list is to allow for guest access to media
while still requireing credentials for access to setup

At present it is not possible to do that
Previoulsy this was done via a seperate web page
Currently its all in one, media and setup
So if you password the server, you need credentials to access media
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

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

Custom Web Interface Remote Access

Postby phibertron » Mon Mar 05, 2012 7:59 pm

At present it seems that Twonky Server 7.0.5 remote access is fubar!

So if you want a wicked easy way to not ever have to deal with it again
and just a simple port forward for access
I would recommend looking at the following post

Custom Web Interface Relative Links

The following does not work for 7.0.5

If you turn on the normal settings for remote access
What you will get by going to the remote access page is an octet stream
or a request for credentials, that are not accepted

# enable https remote connections
enabletls=1

# dynamic dns prefix for remote access, including http://
dyndns=http://yourdyndnsurl:8080

# access to web config pages, 0 for denied, 1 for local only, 2 for open
enableweb=2

# http server port for remote access
httpremoteport=8080

# enable remote access
remoteaccess=1

# flash as default media browser for remote access
remoteaccessflash=0

.
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

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 Web Interface My Library Example

Postby phibertron » Tue Mar 06, 2012 12:08 am

This example is a comiplation of some of the topics I have covered thus far

Custom Web Interface Menubar
Custom Web Interface Metadata View
Custom Web Interface Starting Container
Custom Web Interface Relative Links
Custom Web Interface Hide Settings

It does not have the custom tree's as those will be downloable additions to this example
This example can be used with or without those tree modifications
and vice versa, the trees can be used with or without this modification

The following zip file contains config.js, index.htm and a readme.txt of all changes made
All changes in the files are marked with // phibertron above each change
Make backups of your originals to roll back if you ever want to

They should be placed in the appropriate webconfig folder noted below

Windows C:\Program Files\Twonky\TwonkyServer\resources\webconfig
Linux /TwonkyServer/resources/webconfig
Attachments
Twonky Server 7.0.5 Web Interface My Library Example.zip
(33.52 KiB) Downloaded 1168 times
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

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 My Library Example

Postby phibertron » Tue Mar 06, 2012 12:23 am

This is an example navtree using the Twonky Server Web Interface My Library Example above
And is an example of the guidlines for Views and View-Definitions xml files

I purposely added the Music, Photo, Video containers to the mylibrary.view.xml
So that you could see them in the My Library menu, to see how they would interact

You could also not have them there, but clients like the ps3 would not see the see the MPV folders
But clients like the xbox would, as they are mapped to 0$1, 0$2,0$3 directly
So even if they werent seen in the view, the xbox could still get there

Twonky Server Navtree My Library Example.jpg
Twonky Server Navtree My Library Example.jpg (23.09 KiB) Viewed 64256 times


All changes made to the original files are outlined in the following readme.txt files
config.js readme.txt
index.htm readme.txt
mylibrary.view.xml readme.txt
view-definitions.xml readme.txt

They should be placed in the appropriate webconfig folder noted below

Windows C:\Program Files\Twonky\TwonkyServer\resources\webconfig
Linux /TwonkyServer/resources/webconfig

Windows C:\Program Files\Twonky\TwonkyServer\resources\views
Linux /TwonkyServer/resources/views
Attachments
Twonky Server 7.0.5 Navtree My Library Example.zip
(37.04 KiB) Downloaded 618 times
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

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 Multiple Views My Library Example

Postby phibertron » Tue Mar 06, 2012 12:56 am

Have you ever wondered why if you created a custom view.xml
that if the name, viewlist, and guilist werent just right it wouldnt work
and when it did, the name shown in setup would be blank?

ts7 multiple views.jpg
ts7 multiple views.jpg (20 KiB) Viewed 64168 times


ts7 multiple views 2.jpg
ts7 multiple views 2.jpg (15.35 KiB) Viewed 64153 times


Well the reason is that the html for setup references a strings file
based on the langauge chosen for the site
The strings files has references aka variables for things like advanceddefault etc.
So that the site would appear in the correct language

The problem is that if a reference is not there, you get a blank where eer you try and use it

For EX:
If you chose english then the web server for twonky would reference from strings-en.json


This is a list of the default language string files for the Web Interface
Located in C:\Program Files\TwonkyMedia\resources\webconfig


strings-chs.json
strings-cht.json
strings-de.json
strings-en.json
strings-es.json
strings-fi.json
strings-fr.json
strings-it.json
strings-jp.json
strings-ko.json
strings-nl.json
strings-ru.json
webdav-strings-en.json


The strings referenced in there are used throughout the web interface
But are also used in the view-definitions.xml for guilist

These are the default names and paths of the deafult view.xml files
The name is the name that will be referenced as viewlist in the view-definitions.xml
The path is the name of the file without the .xml extention


<view name='advanceddefault' path='advanced.view'>
<view name='classified' path='classified.view'>
<view name='byfolder' path='folder.view'>
<view name='ipodlike' path='ipodlike.view'>
<view name='mobile' path='mobile.view'>
<view name='playlists' path='playlist.view'>
<view name='simpledefault' path='simple.view'>

This is the default viewlist and guilis of the defatult view-definitions.xml
The viewlist is a reference to all name= in the view.xml files
The guilist is the name that will be displayed in the setup page under navigation tree


<view name='base'
viewlist='advanced,folder,ipodlike,simple,classified,playlists,mobile'
guilist='advanceddefault,ipodlike,simpledefault,byfolder,mobile'>


So say you created view for custom.view.xml

<view name='custom' path='custom.view'>

and then referenced it in the view-definitions.xml

viewlist='advanced,folder,ipodlike,simple,classified,playlists,mobile,custom'
guilist='advanceddefault,ipodlike,simpledefault,byfolder,mobile,custom'


It would show up in the web interface as a navtree choice with a blank name
To get around that you will need to add a reference for the word "custom" and "customcaption"

C:\Program Files\TwonkyMedia\resources\webconfig

For English, open the file strings-en.json in a text editor

Find the following

"copyright": {"value": "&copy; 2004-2012 PacketVideo Corporation. All rights reserved."},
"days": {"value": "days"},

Replace it with this

"copyright": {"value": "&copy; 2004-2012 PacketVideo Corporation. All rights reserved."},
"custom": {"value": "Custom View"},
"customcaption": {"value": "This is My Custom View"},
"days": {"value": "days"},

Restart the Twonky Server



The Media Recievers page is using a hard coded list in the config.js
So if you want to also have your custom view show up there, you have to add it as a choice there too

C:\Program Files\TwonkyMedia\resources\webconfig

config.js

Find the following

function getReceiverViewDropdown(selectedView, isDefault, i){
var html = "";
if (!isDefault) {
html = '<select name="viewName" onchange="receiverChanged(' + i + ')">\
<option value="mobile" ' +
checkSelectedMediaOption("mobile", selectedView) +
'>' +
getString("mobile") +
'</option>\

Replace it with this

function getReceiverViewDropdown(selectedView, isDefault, i){
var html = "";
if (!isDefault) {
html = '<select name="viewName" onchange="receiverChanged(' + i + ')">\
<option value="custom" ' +
checkSelectedMediaOption("custom", selectedView) +
'>' +
getString("custom") +
'</option>\

<option value="mobile" ' +
checkSelectedMediaOption("mobile", selectedView) +
'>' +
getString("mobile") +
'</option>\

Refresh the Web Interface



Now when you go back and look at setup for navigation tree's it will list "Custom View"
as choice with a name as opposed to being blank :D

Note:
If you went looking through the Twonky Server install directory you would notice
that there are other string reference files in C:\Program Files\Twonky\TwonkyServer\resources
Those are the strings that are used for the name= for containers
But if a container doesnt have a string to match it just returns what you typed
as opposed to what views do, which is to return a blank
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

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

?

Postby phibertron » Tue Mar 06, 2012 12:59 am

.
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

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 Music Containers at root of Navtree

Postby phibertron » Tue Mar 06, 2012 1:58 am

This is usable with the Standard or My Library Web Interface

The root of the navtree will show the following Music containers

All Tracks
Artist
Artist Index
Artist/Album
By Folder
Composer
Genre/Album
Genre/Artist
Genre/Song
myTwonky
Personal rating
Playlists
.
Attachments
Twonky Server 7.0.5 Music Containers at the root of Navtree.zip
(2.54 KiB) Downloaded 647 times
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

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 Photo Containers at root of Navtree

Postby phibertron » Tue Mar 06, 2012 2:54 am

This is usable with the Standard or My Library Web Interface

The root of the navtree will show the following Photo containers

Album
All Photos
By Date
By Folder
geo
Keywords
myTwonky
Personal rating
Slideshows
.
Attachments
Twonky Server 7.0.5 Photo Containers at the root of Navtree.zip
(2.53 KiB) Downloaded 505 times
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

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 Video Containers at root of Navtree

Postby phibertron » Tue Mar 06, 2012 3:13 am

This is usable with the Standard or My Library Web Interface

The root of the navtree will show the following Video containers

Album
All Videos
By Date
By Folder
Genre
myTwonky
Personal rating
Playlists
Title
.
Attachments
Twonky Server 7.0.5 Video Containers at the root of Navtree.zip
(2.53 KiB) Downloaded 628 times
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

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 All Containers at the root of Navtree

Postby phibertron » Tue Mar 06, 2012 3:20 am

This is usable with the Standard or My Library Web Interface

The root of the navtree will show the following Media containers

Note:
In order for the following to work
I had to rename the name= variable to use a space at the end of the named variables
I added one for each level one space fo music, two for photo, and three for video
The reason for this is there is a name collision/id collision going on
each name and id pair has to be unique
You can edit the view-definitions.xml to make them what you want
So you dont get what is shown below
I did this on purpose as to show you the point of wha is going on

Album
Album
Album
All Photos
All Tracks
All Videos
Artist
Artist Index
Artist/Album
By Date
By Date
By Folder
By Folder
By Folder
Composer
Genre
Genre/Album
Genre/Artist
Genre/Song
geo
Keywords
Personal rating
Personal rating
Personal rating
Playlists
Playlists
Slideshows
Title
.
Attachments
Twonky Server 7.0.5 All Containers at the root of Navtree.zip
(2.62 KiB) Downloaded 550 times
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

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 Mxied Containers at the root of Navtree

Postby phibertron » Tue Mar 06, 2012 3:59 am

On the to do list
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

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 Music Folders at root of Music Container

Postby phibertron » Tue Mar 06, 2012 5:56 pm

This is usable with the Standard or My Library Web Interface

The Music container will show the folders of the configured Music media share point
at the root of the Music container, the same as what is shown in the By Folder container
.
Attachments
Twonky Server 7.0.5 Music Folders at the root of Music Container.zip
(2.41 KiB) Downloaded 707 times
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

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 Photo Folders at the root of Photo Container

Postby phibertron » Tue Mar 06, 2012 6:12 pm

This is usable with the Standard or My Library Web Interface

The Photo container will show the folders of the configured Photo media share point
at the root of the Photo container, the same as what is shown in the By Folder container
.
Attachments
Twonky Server 7.0.5 Photo Folders at the root of Photo Container.zip
(2.47 KiB) Downloaded 497 times
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

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 Video Folders at the root of Video Container

Postby phibertron » Tue Mar 06, 2012 6:32 pm

Note: This was updated on April 26,2012 due to a typo in the xml

This is usable with the Standard or My Library Web Interface

The Video container will show the folders of the configured Video media share point
at the root of the Video container, the same as what is shown in the By Folder container
.
Attachments
Twonky Server 7.0.5 Video Folders at the root of Video Container.zip
(2.48 KiB) Downloaded 1326 times
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

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.0.5 All Folders at the root of All Container

Postby phibertron » Tue Mar 06, 2012 6:36 pm

This is usable with the Standard or My Library Web Interface

The Music Photo Video containers will show the folders of the configured media share points
at the root of each Music Photo Video container, the same as what is shown in the By Folder container
.
Attachments
Twonky Server 7.0.5 All Folders at the root of All Containers.zip
(2.28 KiB) Downloaded 734 times
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

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 Music Folders at the root of Navtree

Postby phibertron » Tue Mar 06, 2012 6:40 pm

It looks like the changes made in version do not allow for this to happen as one would hope
If I find a way, I'll post it here
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

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 Photo Folders at the root of Navtree

Postby phibertron » Tue Mar 06, 2012 6:46 pm

It looks like the changes made in version do not allow for this to happen as one would hope
If I find a way, I'll post it here.
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

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 Video Folders at the root of Navtree

Postby phibertron » Tue Mar 06, 2012 6:49 pm

It looks like the changes made in version do not allow for this to happen as one would hope
If I find a way, I'll post it here.
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

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

Custom Settings Interface add Rebuild Database button

Postby phibertron » Tue Mar 06, 2012 6:52 pm

For what ever the reason, there is no "Rebuild Database" option
in the advanced section of the admin interface
there are times in which a rescan and or clearing cache does not resolve things
which is where a database rebuild is desperately needed

1.png
1.png (8.08 KiB) Viewed 63576 times


After some tweaking to the interface files

2.png
2.png (9.09 KiB) Viewed 63576 times


Now when you click the "Rebuild Database" button
A database rebuild is initiated, which does involve a server restart

3.png
3.png (9.41 KiB) Viewed 63576 times


And Voila, database rebuilt

For those looking to add this functionality here is what I did

1.
Edit the appropriate language strings file with a string for rebuild
For ex: the one for english is strings-en.json

"rebuild": {"value": "Rebuild Database"},


2.
Edit the advanced.htm to add the rebuild database button

<div class="maintenanceButtonWrapper">
<a class="actionbtn" onclick="restartServer()" onmousedown="onButtonMouseDown(this)" onmouseup="onButtonMouseUp(this)"><span class="actionbtn_l"></span><span class="actionbtn_c" string="restartserver"></span><span class="actionbtn_r"></span></a>
<a class="actionbtn" onclick="rescanFolders()" onmousedown="onButtonMouseDown(this)" onmouseup="onButtonMouseUp(this)"><span class="actionbtn_l"></span><span class="actionbtn_c" string="rescancontent"></span><span class="actionbtn_r"></span></a>

<a class="actionbtn" onclick="rebuildDatabase()" onmousedown="onButtonMouseDown(this)" onmouseup="onButtonMouseUp(this)"><span class="actionbtn_l"></span><span class="actionbtn_c" string="rebuild"></span><span class="actionbtn_r"></span></a>

<a class="actionbtn" onclick="promptReset()" onmousedown="onButtonMouseDown(this)" onmouseup="onButtonMouseUp(this)"><span class="actionbtn_l"></span><span class="actionbtn_c" string="resetdefaults"></span><span class="actionbtn_r"></span></a>
<a class="actionbtn" onclick="clearCache()" onmousedown="onButtonMouseDown(this)" onmouseup="onButtonMouseUp(this)"><span class="actionbtn_l"></span><span class="actionbtn_c" string="clearcache"></span><span class="actionbtn_r"></span></a>
</div>


3.
Edit the config.js by adding a NEW function that is called by the rebuild database button
Note:
this is just a modifed copy of the restartserver function
that was renamed, and the rpc/restart call was changed to rpc/rebuild

function rebuildDatabase(){
makeGetRequest("/rpc/rebuild", {}, function(){
showDialogOverlay(function(){
return "<div class='spinner floatL'></div><div style='padding: 5px 0px 0px 10px;' class='floatL'>" + getString("serverrestarting") + "</div>"
}, {}, {});
restartTest = setInterval(function(){
makeGetRequest("/rpc/get_all", {}, function(){
clearInterval(restartTest);
hideDialogOverlay();
// Update aggregation info after the restart is complete on the Aggregation page to display the list of servers more quickly.
if(window.location.hash == '#aggregation') {
// Callback must be on a short timeout in order to work since rpc call needs a short amount of time to popuplate list of
// aggregation servers after restarting, if call is done without timeout, response is still empty.
setTimeout("updateAggregation()", 1500);
}
})
}, 1000);
});
}
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

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

Custom Settings Interface add iTunes Library setting

Postby phibertron » Tue Mar 06, 2012 6:57 pm

1.png
1.png (19.24 KiB) Viewed 63479 times


1.
Edit the new.css to add the class for verylonginput

.verylongInput
{
width: 600px;
}


2.
Edit the appropriate language strings file with a string for ituneslibrary and ituneslibrarycaption
For ex: the one for english is strings-en.json

"ituneslibrary": {"value": "iTunes Library"},
"ituneslibrarycaption": {"value": "Full path to the iTunes library .xml file"},


3.
Edit the advanced.htm to add the iTunes Library section

Note: this is just a modified copy of the compilationdirs section

<div class="boxHeader">
<span class="titleWrapper">
<span class="title" string="ituneslibrary" />
<div id="ad2" class="toggleButton hidden smallestFont"><div class="toggleText" string="show"></div></div><div class="toggleSpacer"></div>
</span>
<div class="clear" />
</div>
<div class="hideSubheaderBody paddingLeft">
<div>
<span string="ituneslibrarycaption" />
</div>
<div class="smallServerContentSpacer">
</div>
<input class="verylongInput" id="ituneslib" type="text" key="ituneslib"/>
<div class="serverContentSpacer">
</div>
</div>


4.
Edit the config.js by editing existing functions that are called by the iTunes Library section

function handleAdvancedData()
case "ituneslib":

function submitAdvancedData()
var ituneslib = $("#ituneslib", ".accountSettingsContainer").val();
if (advancedOrig["ituneslib"] != ituneslib) data += "ituneslib=" + ituneslib + "\n";
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

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

Custom Settings Interface increase page link font size

Postby phibertron » Tue Mar 06, 2012 7:01 pm

1.jpg
1.jpg (15.48 KiB) Viewed 63346 times


2.jpg
2.jpg (16.95 KiB) Viewed 63346 times


1.
Edit the new.css and add the class for .pagesFont

.pagesFont {
font-size: 200%;
}


2.
Edit the config.js and edit the existing function loadMediaBrowse
and change class="browsePages largeFont"
to class="browsePages pagesFont"

$(".serverSettingsContentWrapper").html('<div class="breadcrumb"></div><div id="browseContents"></div></div><div class="clear"></div><div id="browsePagination"><div class="browsePages pagesFont"></div></div>');
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

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

Custom Settings Interface Twonky Search

Postby phibertron » Tue Mar 06, 2012 7:04 pm

UPDATE
Here you go, Version 2 of this tweak, pre-edited for 7.0.9 and 7.1.2

Whats New in Version 2
==================
- moved the search function into the loadmediacontents function
- made it so a search can survive a page refresh
- added a fix for a known mytwonky breadcrumb page refresh bug
- added a fix for a kwown page refresh in 7.0.10 through 7.1.2

Twonky 7.0.9 Special Search Version 2.zip
download/file.php?id=882

Twonky 7.1.2 Special Search Version 2.zip
download/file.php?id=881


Ever since the launch of myTwonky and Twonky 7.x
I had always meant to get around to adding in some sort of search ability to Twonky Server like myTwonky has

Twonky Search.jpg
Twonky Search.jpg (75.84 KiB) Viewed 60626 times


I finally got around to seeing what I could get away with from a minimalistic point of view
in that I didnt want to reinvent the wheel or have to write a lof code to do it
and I also wanted it to somewhat look like it does on myTwonky

Here is what I came up with, yes I could have used the images from myTwonky
like the magnify glass and the go button
but wanting to keep it to the least amount of edits possible, the following is pretty close and functional

The search focus will be based on what ever media type is highlighted in the top menu bar
in the below it is Video, the one with the blue bar below it

Twonky Special Search 1.jpg
Twonky Special Search 1.jpg (26.82 KiB) Viewed 60626 times


Just enter your search criteria into the text box, and click the search button

Note: the search is based off of title name of the current media type

Twonky Special Search 2.jpg
Twonky Special Search 2.jpg (26.54 KiB) Viewed 60626 times


Here are the search results for video titles that contain the word "test"

Twonky Special Search 3.jpg
Twonky Special Search 3.jpg (36.36 KiB) Viewed 60626 times


The attached zip file contains three pre-modified files, new.css, index.htm, and config.js for twonky 7.0.9 special
just replace those three files, no need to restart twonky
if the twonky web interface is already open, just do a page refresh, all done, enjoy =)

Twonky 7.0.9 Special Search.zip
(44.84 KiB) Downloaded 398 times


Twonky 7.0.9 Special Search Version 2.zip
(41.07 KiB) Downloaded 643 times


Twonky 7.1.2 Special Search Version 2.zip
(42.06 KiB) Downloaded 752 times



Custom Settings Interface Twonky Search - How it works
viewtopic.php?f=2&t=10627&p=40606#p40605

Custom Settings Interface Twonky Search - What makes it work
viewtopic.php?f=2&t=10627&p=40606#p40606

Why doesnt it look "exactly" like myTwonky Search? wrote:I could have done that, but wanted to keep it simple,
for you and me, about the biggest difference are the icons,
and if you are really really wanting them to be there,
just let me know and I will tell you what to do to make it happen


Is the search case sensitive? wrote:No, case does not matter


Do I need to use quotes to include spaces? wrote:No, what you type, including spaces, will be the search criteria


What is the search compared against? wrote:It is compared against the title names of the currently selected media type
Can I search against other types of criteria other than title?
No, and to be honest, thats what the containers are for, at present,
I just wanted to be able to search for titles, plus to do more,
it would take a serious amount of effort,
plus I can only pull this off with the data returned from a json/feed return


Can I search all media types? wrote:No,you can only search on one of three media types per search


Can I change the sort order of the search results? wrote:No, the default sort orderof the all items container is by title name
also, the order in which a postive result is based on that order


Why are the search results not paged like the other media items? wrote:to make it do that, would have taken a serious amount of effort,
if you search for terms as opposed to single letters, it works very well


What is the performance hit on my server when I do a search? wrote:Since there is no built in search built into the twonky server
The impact is minmal except that the data returned in a json feed is a full list of items
as opposed to a subset of data that is normally used

If there are 10000 songs in your music library,
the data returned will also have 10000 items in it

once the data is returned to the browser,
it is the local computer/web browser
that processes the data for the search and not the actual server


When will Twonky add an official search feature? wrote:No Idea


Do I think that Twonky will add an official search feature? wrote:I hope so
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

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

Custom Settings Interface Twonky Search - How it works

Postby phibertron » Tue Mar 06, 2012 7:07 pm

So how does the search feature I added work?

If you notice that when you go to a container in the web interface
the url that is uses has a bunch of data in it

For example this is the url for Music and the All Tracks container

#id=0$1$8&startPage=0&count=0
.

The default containers in twonky always have static id= mappings, for example

id=0$1$8 is for all music
id=0$2$20 is for all photo
id=0$3$27 = is for all video


The &startPage= and &count are for use pagination and limit the json feed

&startPage=0 says to start at page 1
&count=0 usually is a number that equals the true amount, 0 also works


Based on the current url, behind the scenes it reads the return from this url

json/feed/0$1$8&startPage=0&count=0


With the data from the json/feed it creates the graphical version you see

What I've done is leverage this architecture and the use of the media all containers

I then just apply a filter on the title based on your search criteria

The resuls are then displayed in the web interface
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

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

Custom Settings Interface Twonky Search - What makes it work

Postby phibertron » Tue Mar 06, 2012 7:11 pm

What was added/modified to make it work?

This is the code change for the loading graphic in new.css

Note:
This is done to make the loading graphic always show at the top
top center used to be center center
if you had a long page you would never see it with center center


Code: Select all

// phibertron
.serverSettingsContentWrapper.loading
{
background: url("/webconfig/loading_icon.gif") no-repeat scroll top center transparent;
}


This is the code for the search box in index.htm

Code: Select all

<!-- phibertron -->
<div style="float:left;width:310px;height:30px;margin:10px 0 0 10px;background:#fff;-moz-border-radius:15px;border-radius:10px;">
<script>
function myquery(){
if (document.mysearch.mystring.value != "Search My Library" && document.mysearch.mystring.value !="" && $('.active', '#nav').attr('id') != null) {
window.location.hash = "#search?" + document.mysearch.mystring.value;
}
document.mysearch.mystring.value="Search My Library";
document.activeElement.blur();
return false;
}
</script>
<form  name="mysearch" onsubmit="return myquery();" >
<img style="float:left; margin:3px 0px 0px 6px" src="/webconfig/searchicon.jpg" />
<input style="float:left; margin:6px 0px 0px 3px; border:none" type="search" name="mystring" value="Search My Library" onclick="mysearch.mystring.value='';" onfocus="if(this.value == 'Search My Library') { this.value = ''; }" onblur="if(this.value == '') { this.value = 'Search My Library'; };" maxLength="100" size="29" />
<input style="float:right; margin:3px 6px 0px 0px; cursor:pointer;" type="button" value="Search" onclick="myquery();" />
</form>
</div>


All of the following are in the config.js

This seperates the url into two parts at the ?

Code: Select all

// phibertron
switch (e.fragment.split("?")[0]) {


This sends loadMediaSearch the current media id and search query string

Code: Select all

// phibertron
case "search":
if (lastMediaId == "0$1") loadMediaSearch("0$1$8", 0, 0, false, unescape(e.fragment.split("?")[1]));
if (lastMediaId == "0$2") loadMediaSearch("0$2$20", 0, 0, false, unescape(e.fragment.split("?")[1]));
if (lastMediaId == "0$3") loadMediaSearch("0$3$27", 0, 0, false, unescape(e.fragment.split("?")[1]));
break;


This is where the media id and search string are passed into loadMediaSearch

Code: Select all

// phibertron
// this is a modified copy of loadMediaContents
function loadMediaSearch(id, startItem, numItems, reloadContent, mystring){


This is where the search results title is genereted

Code: Select all

// phibertron
html += '<div class="subHeader"><span class="subheaderTitle">' + "Search Results for \"" + mystring + "\"" +  '</span></div>';


This is where the actual search to include or discard an item in the return is done

Code: Select all

// phibertron
else if (data.title.toLowerCase().indexOf(mystring.toLowerCase()) !=-1 ){


This is where pagination is turned off

Note:
its not that pagination doesnt work, its that only the first page is valid
I have to adjust how the links are created and some logic to make it work
I have an idea on how to make pagination work for searching
If that pans out, I will post my findings and any changes on how to do that


Code: Select all

// phibertron
pageCount = numItems;
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

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

Re: Navtree 7 (How to show folders at the root solved and mo

Postby phibertron » Tue Mar 06, 2012 7:17 pm

44
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

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

Re: Navtree 7 (How to show folders at the root solved and mo

Postby phibertron » Tue Mar 06, 2012 7:22 pm

45
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

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

Re: Navtree 7 (How to show folders at the root solved and mo

Postby phibertron » Tue Mar 06, 2012 7:27 pm

46
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

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

Re: Navtree 7 (How to show folders at the root solved and mo

Postby phibertron » Tue Mar 06, 2012 7:30 pm

47
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

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

Re: Navtree 7 (How to show folders at the root solved and mo

Postby phibertron » Tue Mar 06, 2012 7:34 pm

48
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

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

Re: Navtree 7 (How to show folders at the root solved and mo

Postby phibertron » Tue Mar 06, 2012 7:37 pm

49
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

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

Re: Navtree 7 (How to show folders at the root solved and mo

Postby phibertron » Tue Mar 06, 2012 7:41 pm

50
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


Return to “TwonkyServer”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron