Page 1 of 1

filter by file type

Posted: Tue Mar 15, 2011 12:01 am
by ringostarr
Is it possible to filter the database by media format e.g. only mp3 or ogg-files?

Re: filter by file type

Posted: Tue Mar 15, 2011 12:31 am
by phibertron
You can with the following

buildon='pv:extension'

Re: filter by file type

Posted: Tue Mar 15, 2011 12:54 am
by phibertron
Here are a couple of examples of how one could use it

<container name='By Type' groupid='music/ext' createClass='object.item.audioItem.musicTrack' class='object.container' >
<container buildon='pv:extension' createClass='object.item.audioItem.musicTrack' class='object.container' />
</container>

<container name='By Type' groupid='picture/ext' createClass='object.item.imageItem.photo' class='object.container' >
<container buildon='pv:extension' createClass='object.item.imageItem.photo' class='object.container.album.photoAlbum' />
</container>

<container name='By Type' groupid='video/ext' createClass='object.item.videoItem.movie' class='object.container'>
<container buildon='pv:extension' createClass='object.item.videoItem.movie' class='object.container' />
</container>

Re: filter by file type

Posted: Tue Mar 15, 2011 9:41 pm
by ringostarr
thanks for the fast answer, but in which file must i add or change it?

Re: filter by file type

Posted: Tue Mar 15, 2011 10:01 pm
by phibertron
If you are using the advanced.view.xml as your view

Add the ones you want to the appropriate sections

For ex:

Code: Select all

<view name='byfolder' path='folder.view'>
	<navtree>

		<container id='music'>
			...
			<link groupid='music/ext' />
		</container>

		<container id='picture' >
			...
			<link groupid='picture/ext' />
		</container>

		<container id='video' >
			...
			<link groupid='video/ext' />
		</container>

	</navtree>
</view>
And in the view-definitions.xml

Code: Select all


<container name='music' id='music'...
	...
	<container name='By Type' groupid='music/ext' createClass='object.item.audioItem.musicTrack' class='object.container' >
		<container buildon='pv:extension' createClass='object.item.audioItem.musicTrack' class='object.container' />
	</container>
</container>

<container name='pictures' id='picture'...
	...
	<container name='By Type' groupid='picture/ext' createClass='object.item.imageItem.photo' class='object.container' >
		<container buildon='pv:extension' createClass='object.item.imageItem.photo' class='object.container.album.photoAlbum' />
	</container>
</container>

<container name='videos' id='video'...
	...
	<container name='By Type' groupid='video/ext' createClass='object.item.videoItem.movie' class='object.container'>
		<container buildon='pv:extension' createClass='object.item.videoItem.movie' class='object.container' />
	</container>
</container>
The above is just where to put them in addtiion to what is already there
dont add the "..." those are just to mean there is existing stuff there =)

Re: filter by file type

Posted: Wed Mar 16, 2011 12:18 am
by ringostarr
Alright, I have understood the syntax... It runs and I can now choose the folders by extension like "artist/album/mp3" and "artist/album/ogg".

Is there a way to prefilter the media extension, so that you don't have to select the "mp3" or "ogg" folder...
maybe something like the sortcriteria-attribute or so
e.g.
...
<container buildon='upnp:album' albumart='1' sortcriteria='+pv:numberOfThisDisc,+upnp:originalTrackNumber' filtercriteria='ext:mp3' createClass='object.item.audioItem.musicTrack' class='object.container.album.musicAlbum'/>
...

Re: filter by file type

Posted: Wed Mar 16, 2011 12:40 am
by phibertron
Sadly no
its not possible to use values in any way with any of the buildon or filteron commands

Re: filter by file type

Posted: Wed Mar 16, 2011 1:17 am
by ringostarr
ok, thanks for the answer.

It could be a good option, but it's better than nothing.

Re: filter by file type

Posted: Wed Mar 16, 2011 1:26 am
by phibertron
no worries

It would be a great option, one I hope the soon/someday/hopefully they impliment

True, at least we have some options, which is better than no options
Of the media servers out there, only a few allow for full tree customization
and only one makes it wicked easy