Twonky 5.1.6 sort order

DLNA, AirPlay, Chromecast, PS3, XBOX, iTunes, & other media players
Post Reply
rdps180882
New here
Posts: 4
Joined: Sun Mar 09, 2008 4:55 am

Twonky 5.1.6 sort order

Post by rdps180882 »

Hi,

I just updated my NAS and thus got 5.1.6

Everything worked fine until I had a look at the folders contents.

The Videos are compressed in mp4/m4v Format, and the Metadata was filled with iDentify (Season, Episode, Title, Series etc)

season and episode number are written into the filename as disc and track number.

The result is a file that is called 4-22 blabla.m4v
Where 4 is the disc number
22 the track number
Blabla is the episode title.

Twonky removes both disc and track number and then sorts by episode title!!!!
Sort Order.jpg
It did not used to do this. Right now watching episodes of a series is such a hastle! Please fix this soon!

Or am I just dense and there is a big old checkbox somewhere?
You do not have the required permissions to view the files attached to this post.
Last edited by rdps180882 on Tue Jul 13, 2010 11:55 pm, edited 2 times in total.
User avatar
Briain
Experience counts
Posts: 1749
Joined: Tue Apr 20, 2010 11:56 pm
Location: Edinburgh (Scotland)

Re: Twonky 5.1.4 RC sort order

Post by Briain »

Hi

I can't answer for video files (as I only use Twonky for music) but the below might be of use to you if you are interested in experimenting:

I've done this in my own trees to enable my music album (FLAC) files to show in the album sort order (when using folder view). I enabled it by editing the music section of the code in the view-definitions.xml file, and making the following changes:

Current:

<container name='byfolder' id='music/folders' class='object.container.storageFolder' createClass='object.item.audioItem.musicTrack'>
<container buildon='res' createClass='object.item.audioItem.musicTrack' class='object.container.storageFolder' />
</container>

Proposed:

<container name='byfolder' id='music/folders' class='object.container.storageFolder' createClass='object.item.audioItem.musicTrack'>
<container buildon='res' albumart='1' sortcriteria='+upnp:originalTrackNumber' createClass='object.item.audioItem.musicTrack' class='object.container.storageFolder' />
</container>


Note that the albumart=1 enables artwork to be seen at the head of the containers; maybe something you don't want. The sortcriteria='+upnp:originalTrackNumber' does work well though; it lists the music tracks in the original album sort order (note that I only have one album in each directory). If they're all in the one folder, you could have problems, but another thing you could experiment with is sortcriteria='+pv:numberOfThisDisc,+upnp:originalTrackNumber' though I've never tried that in a folder view!

Note that the Qnap overwrites the these files whenever you re-boot it, so keep a copy on one of the shares so you can SSH and replace it if you have to restart the NAS.

Bri
TS-119, 1 X Seagate ~~ TS-219, 2 X Seagate (R1) ~~ TS-453A, 2 X 3 TB WD Red (R1) ~~ TS-659, 5 X 1 TB Hitachi Enterprise (R6)
APC Smart-UPS 750
rdps180882
New here
Posts: 4
Joined: Sun Mar 09, 2008 4:55 am

Re: Twonky 5.1.4 RC sort order

Post by rdps180882 »

Thank you for the advice. Unfortunately i Never ssh ed before, so While I do understand that it is about manually adding sorting strings into the twonky structure, I have no clue as to how to gain access.
User avatar
Briain
Experience counts
Posts: 1749
Joined: Tue Apr 20, 2010 11:56 pm
Location: Edinburgh (Scotland)

Re: Twonky 5.1.4 RC sort order

Post by Briain »

Hi

The best way is by downloading a utility like PuTTY (free download). You then use admin@your.nas.ip.address and your normal password to gain access (a screen dump of me doing this is at the end). To be honest, it's not ideal as every time you reboot the NAS, the trees are replaced with the standards ones stored in Qnap flash memory, but it's pretty quick to do again (you just leave them sitting on one of the shares, then copy them using the below command:

cd mnt/ext/opt/twonkymedia/resources/views/
cp -i /share/Public/Trees/* .

As to the trees themselves, you're best option is to use Notepad++ (again free) set to save files in Unix mode (it is an excellent xml editor).

A ReadyNAS forum user very kindly build specific add-ons of Twonky for the ReadyNAS series. These not only contained my custom trees, but also created a new share which enabled access to the directory containing the Twonky xml files (the 'trees' which create the menu structure you see on your control point) such that users can simply drop new trees into the directory using Windows (no need to SSH).

It would be really excellent if Qnap could do something similar this (I'm not expert at Linux; I am a mere beginner) maybe by creating a QPKG type update that did it for us. All it needs is for mnt/ext/opt/twonkymedia/resources/views/ to be made visible as a share, and for the xml files to be given permissions to enable us to overwrite them.

Ideally, a much better long term solution is needed (maybe a QPKG that creates symlink to a completely new share and maybe even updates startup scripts to point to it) such that they're not then overwritten every time the NAS boots (they currently are). Again, I'm not a Linux expert and thus don't know exactly what's required (not how to build it all into a QPKG add-on).

Just for info, below screen dump from PuTTY shows where the trees currently reside on a TS-659 (in case anyone reading this is wondering).

Using username "admin".
admin@192.168.96.20's password:
[~] # cd /
[/] # cd mnt/ext/opt/twonkymedia/resources/views/
[/mnt/ext/opt/twonkymedia/resources/views] # ls
advanced.view.xml* folder.view.xml* simple.view.xml*
classified.view.xml* ipodlike.view.xml* view-definitions.xml*
[/mnt/ext/opt/twonkymedia/resources/views] #
TS-119, 1 X Seagate ~~ TS-219, 2 X Seagate (R1) ~~ TS-453A, 2 X 3 TB WD Red (R1) ~~ TS-659, 5 X 1 TB Hitachi Enterprise (R6)
APC Smart-UPS 750
rdps180882
New here
Posts: 4
Joined: Sun Mar 09, 2008 4:55 am

Re: Twonky 5.1.4 RC sort order

Post by rdps180882 »

Thank you again.
Since i no longer posess a win pc. I tried to do the same from terminal on a Mac.
Did not get far though...
I hope they are going to release a new fw or at least a townky update soon! I Still wonder why they do not run townky as a qpkg aswell.
Would be so much less hassle for them, since intermittent updates would be made possible!
JeroenBalm
First post
Posts: 1
Joined: Fri Sep 17, 2010 7:47 pm

Re: Twonky 5.1.6 sort order

Post by JeroenBalm »

Thanks for this useful information.

How you get te AlbumArtist field from V2 or Vorbis tags into twonkymedia on the NAS? I have a version of twonky server running on XP which was packed with my WAP-4500 streamer, and that one does support the albumartist field.

More nice, on this pc version you can self make a tree system. Why is this not possible in the more user friendly way on the NAS? Can i find also those xml files on a pc?
User avatar
Briain
Experience counts
Posts: 1749
Joined: Tue Apr 20, 2010 11:56 pm
Location: Edinburgh (Scotland)

Re: Twonky 5.1.6 sort order

Post by Briain »

Hi

I have added album artist to my custom trees; see the post here (and there are updated trees in the post below it). The same trees can be used in the PC version (they're in C:\Program Files\TwonkyMedia\resources\views on my XP box). The trees (both the Twonky originals and my own) can be easily edited using Notepad++ as the layout (and thus containers) can be more easily seen than by using Windows Notepad (I've set Notepad++ to save in Unix mode in order to to get the end of line settings correct for NAS boxes, but the 'NAS' ones I've posted work absolutely fine on my PC version of Twonky too).

If you don't wish to use one of my complete replacement tree packs, you can lift the album artist container from my own 'view definitions' tree and add it to the standard Twonky 'view definitions' tree (and as I have done, you also have to add a shortcut to it - <link groupid='music/albumartists' /> - in one of the shortcut trees)

Bri
TS-119, 1 X Seagate ~~ TS-219, 2 X Seagate (R1) ~~ TS-453A, 2 X 3 TB WD Red (R1) ~~ TS-659, 5 X 1 TB Hitachi Enterprise (R6)
APC Smart-UPS 750
poke53281
New here
Posts: 5
Joined: Sun Feb 08, 2009 5:49 pm

Re: Twonky 5.1.6 sort order

Post by poke53281 »

I access my mp3 files by folder and had the same problem with the order of files on my TS-109 PRO II.
I fixed it by editing file

Code: Select all

/mnt/HDA_ROOT/twonkymedia/resources/views/view-definitions.xml
I replaced the two lines

Code: Select all

<container name='folder' id='music/folders' class='object.container.storageFolder' createClass='object.item.audioItem.musicTrack'> 
    <container buildon='res' sortcriteria='+upnp:originalTrackNumber' createClass='object.item.audioItem.musicTrack' class='object.container.storageFolder' /> 
by

Code: Select all

<container name='folder' id='music/folders' class='object.container.storageFolder' createClass='object.item.audioItem.musicTrack'>
    <container buildon='res' albumart='1' sortcriteria='+pv:numberOfThisDisc,+upnp:originalTrackNumber' createClass='object.item.audioItem.musicTrack' class='object.container.album.musicAlbum' />
dyslexics have more fnu!
User avatar
Valkyrie
New here
Posts: 4
Joined: Sun Dec 30, 2007 3:51 pm
Location: Italy

Re: Twonky 5.1.6 sort order

Post by Valkyrie »

Hi,

I had the same problem with the new QPKG version (6.0.30) and i solved it following your advice. I really apprecaite this. :D
wng328
Starting out
Posts: 11
Joined: Tue Nov 13, 2012 9:48 am

Re: Twonky 5.1.6 sort order

Post by wng328 »

Hi

May I know the path to get into the following position to change the code? Thanks.
"editing the music section of the code in the view-definitions.xml file"
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: Twonky 5.1.6 sort order

Post by schumaku »

wng328 wrote:May I know the path to get into the following position to change the code? Thanks.
Using the NAS Linux shell access (ssh typically), by a Terminal app, or an sftp / scp application.
Post Reply

Return to “Media Streaming”