|
Batch Metadata Tools This forums is for discussing the user-created Batch Metadata Tools for SageTV. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
VFS - filter by a metadata field
I am trying to customize a BMT VFS view and it works until I add in a filter on metadata.
I tried an example I found on your google code site (VFSDocumentation) The sample I found was.... Code:
<filter by="metadata"> <option name="field" value="HDTV"/> <option name="value" value="true"/> <filter/> Code:
Error in VFS File: .\userdata\Phoenix\vfs\movies.xml; Attribute "by" is required and must be specified for element type "filter". Code:
<filter by="metadata"> <option name="field" value="DiscNumber"/> <option name="value" value=""/> <filter/> Any ideas on what I am doing incorrect? k |
#2
|
||||
|
||||
Quote:
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#3
|
|||
|
|||
Quote:
Code:
<!DOCTYPE vfs SYSTEM "vfs.dtd"> <vfs> <views> <view name="my_movies" label="My Movies"> <tag value="video" /> <!-- Grab all video files --> <source name="mediafiles"> <option name="mediamask" value="VL"/> </source> <!-- pull in recorded movies for this view as well --> <view-source name="recordedmovies"/> <!-- globally filter out TV files --> <filter by="mediatype" scope="exclude" value="TV"/> <!-- present then sorted by title --> <presentation level="1"> <group by="title"> <option name="prune-singe-item-groups" value="true"/> </group> <sort by="title"/> </presentation> </view> <view name="my_movies_no_disc_no" label="My Movies (no Disc #)"> <tag value="video" /> <!-- Grab all video files --> <source name="mediafiles"> <option name="mediamask" value="VL"/> </source> <!-- pull in recorded movies for this view as well --> <view-source name="recordedmovies"/> <!-- globally filter out TV files --> <filter by="mediatype" scope="exclude" value="TV"/> <filter by="metadata"> <option name="field" value="DiscNumber"/> <option name="value" value=""/> <filter/> <!-- present then sorted by title --> <presentation level="1"> <group by="title"> <option name="prune-singe-item-groups" value="true"/> </group> <sort by="title"/> </presentation> </view> <view name="my_movies_missingmetadataview" label="Missing Metadata for Movies"> <description>Movies that are missing metadata</description> <tag value="metadata"/> <view-source name="my_movies"/> <filter by="missingmetadata"/> <presentation> <sort by="title"/> </presentation> </view> </views> </vfs> k |
#4
|
||||
|
||||
My bad. All my documentation has an xml formatting error
Code:
<filter by="metadata"> <option name="field" value="DiscNumber"/> <option name="value" value=""/> <filter/> Code:
<filter by="metadata"> <option name="field" value="DiscNumber"/> <option name="value" value=""/> </filter>
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#5
|
|||
|
|||
Quote:
Code:
Error in VFS File: .\userdata\Phoenix\vfs\movies.xml; The content of element type "view" must match "(option*,description?,tag*,source*,view-source*,filter?,presentation*)". k |
#6
|
||||
|
||||
The issue there is that you can not have multiple filters at the view level. This is programming limitation that I've been to busy to solve.
There is a way around it, though, you can define a filter in the filters section, like such... Code:
<!DOCTYPE vfs SYSTEM "vfs.dtd"> <vfs> <filters> <item-group name="jusjoken-nodisc" label="TV Files without Disc" mode="and"> <filter by="mediatype" scope="exclude" value="TV"/> <filter by="metadata"> <option name="field" value="DiscNumber"/> <option name="value" value=""/> </filter> <tag value="video"/> </item-group> </filters> <views> <view name="my_movies" label="My Movies"> <tag value="video" /> <!-- Grab all video files --> <source name="mediafiles"> <option name="mediamask" value="VL"/> </source> <!-- pull in recorded movies for this view as well --> <view-source name="recordedmovies"/> <!-- globally filter out TV files --> <filter by="mediatype" scope="exclude" value="TV"/> <!-- present then sorted by title --> <presentation level="1"> <group by="title"> <option name="prune-singe-item-groups" value="true"/> </group> <sort by="title"/> </presentation> </view> <view name="my_movies_no_disc_no" label="My Movies (no Disc #)"> <tag value="video" /> <!-- Grab all video files --> <source name="mediafiles"> <option name="mediamask" value="VL"/> </source> <!-- pull in recorded movies for this view as well --> <view-source name="recordedmovies"/> <filter by="jusjoken-nodisc"/> <!-- present then sorted by title --> <presentation level="1"> <group by="title"> <option name="prune-singe-item-groups" value="true"/> </group> <sort by="title"/> </presentation> </view> <view name="my_movies_missingmetadataview" label="Missing Metadata for Movies"> <description>Movies that are missing metadata</description> <tag value="metadata"/> <view-source name="my_movies"/> <filter by="missingmetadata"/> <presentation> <sort by="title"/> </presentation> </view> </views> </vfs>
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#7
|
|||
|
|||
Quote:
My view is not displaying what I want but I am sure I just need to figure the correct value to use for the DiscNumber filter. At least I am not getting an error. Thanks k |
#8
|
||||
|
||||
Quote:
Code:
<filter by="metadata"> <option name="field" value="DiscNumber"/> <option name="value" value="0"/> <option name="compare-numeric" value="true"/> </filter>
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#9
|
|||
|
|||
I found a way to get what I was looking for but in the end I needed to use another view to be the source of my no disc view as I could not get a item-group filter to work if it contained a metadata filter. The metadata filter on it's own works fine but if it is part of a item-group filter it is ignored (or at least I think that is what is happening).
In the xml below I have 2 no disc views. 1. my_movies_no_disc_no - this one works as I use the my_movies view as a source and then add in the metadata based filter. 2. my_movies_no_disc_no2 - this one does not work but I think it should. It uses a item-group filter with the same metadata filter I used in 1 above but it seems to be ignored. Code:
<!DOCTYPE vfs SYSTEM "vfs.dtd"> <vfs> <filters> <item-group name="nodisc" label="Filter Movies without Disc Number" mode="and"> <!-- --> <filter by="metadata" scope="exclude"> <option name="field" value="DiscNumber"/> <option name="value" value="0"/> <option name="compare-numeric" value="true"/> </filter> <filter by="homevideos" scope="exclude"/> <filter by="mediatype" scope="exclude" value="TV"/> </item-group> <item-group name="filterTVandHomeVideos" label="Filter TV and Home Videos" mode="and"> <filter by="homevideos" scope="exclude"/> <filter by="mediatype" scope="exclude" value="TV"/> </item-group> </filters> <views> <view name="my_movies" label="My Movies"> <tag value="video" /> <!-- Grab all video files --> <source name="mediafiles"> <option name="mediamask" value="VL"/> </source> <!-- pull in recorded movies for this view as well --> <view-source name="recordedmovies"/> <!-- globally filter out TV files --> <filter by="filterTVandHomeVideos"/> <!-- present then sorted by title --> <presentation level="1"> <group by="title"> <option name="prune-singe-item-groups" value="true"/> </group> <sort by="title"/> </presentation> </view> <view name="my_movies_no_disc_no" label="My Movies (no Disc #)"> <tag value="video" /> <view-source name="my_movies"/> <filter by="metadata" scope="include"> <option name="field" value="DiscNumber"/> <option name="value" value="0"/> <option name="compare-numeric" value="true"/> </filter> <!-- present then sorted by title --> <presentation level="1"> <group by="title"> <option name="prune-singe-item-groups" value="true"/> </group> <sort by="title"/> </presentation> </view> <view name="my_movies_no_disc_no2" label="My Movies (no Disc #)2"> <tag value="video" /> <!-- Grab all video files --> <source name="mediafiles"> <option name="mediamask" value="VL"/> </source> <!-- pull in recorded movies for this view as well --> <view-source name="recordedmovies"/> <!-- globally filter out TV files --> <filter by="nodisc"/> <!-- present then sorted by title --> <presentation level="1"> <group by="title"> <option name="prune-singe-item-groups" value="true"/> </group> <sort by="title"/> </presentation> </view> <view name="my_movies_missingmetadataview" label="Missing Metadata for Movies"> <description>Movies that are missing metadata</description> <tag value="metadata"/> <view-source name="my_movies"/> <filter by="missingmetadata"/> <presentation> <sort by="title"/> </presentation> </view> <view name="my_movies_by year" label="My Movies by Year"> <description>Movies by year</description> <tag value="metadata"/> <view-source name="videosgroupedbyyear"/> <filter by="filterTVandHomeVideos"/> <presentation> <group by="year"> <option name="empty-foldername" value="No Year"/> </group> <sort by="title"> <option name="sort-order" value="desc"/> </sort> </presentation> <presentation> <sort by="title"> <option name="sort-order" value="asc"/> </sort> </presentation> </view> </views> </vfs> k |
#10
|
||||
|
||||
From what I can see, I don't think the nodisc filter will do what you want. Filter groups are AND'ed or OR'ed together (in your case ANDed).
and each filter will either return true or false for each item (and that value will be negated if you use exclude). So, to look at your nodisc filter... Code:
<filter by="metadata" scope="exclude"> <option name="field" value="DiscNumber"/> <option name="value" value="0"/> <option name="compare-numeric" value="true"/> </filter> <filter by="homevideos" scope="exclude"/> <filter by="mediatype" scope="exclude" value="TV"/> I think what you want is to return all videos that have a disc number of 0 AND not a home movie AND not TV. so, Code:
<filter by="metadata" scope="include"> <option name="field" value="DiscNumber"/> <option name="value" value="0"/> <option name="compare-numeric" value="true"/> </filter> <filter by="homevideos" scope="exclude"/> <filter by="mediatype" scope="exclude" value="TV"/>
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#11
|
||||
|
||||
BTW... thanks for playing with this... the VFS is core to phoenix, so having people play with the views will help us to uncover issues, etc. Hopefully at somepoint, I'll make a web module for bmt for configuring views, and I think we'll have some support eventually in the STV to customize views as well. The views are quite powerful in that you can pretty much create a view for anything, but that also adds some complexity in the STV (and web ui) for building views, supporting all features, etc.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#12
|
|||
|
|||
Quote:
I am willing to try something else if you have more suggestions but my guess is the code that processes the metadata filter when it is within an item-group is not processing the metadata filter properly. k |
#13
|
||||
|
||||
It could very be that there is an issue in the filter groups. I'll open an issue to look at the filter groups to see what I can see anything in there. I use a filter group for the missing metadata filter that also excludes home videos, and it works there, but maybe there is something odd in how the metadata one is working. Although given that that it works as a normal filter, I'm not sure why it would not work at intended in the filter group.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help: VFS | ohpleaseno | Phoenix | 23 | 03-21-2011 09:11 AM |
VFS Views - What's missing? | stuckless | Phoenix | 20 | 03-12-2011 06:26 PM |
VFS in Version 4.1.0 | toricred | Batch Metadata Tools | 8 | 10-02-2010 10:54 AM |
Date field missing on Sage 6 menu screens | Sagebrush | SageTV Software | 3 | 05-03-2007 03:59 PM |
Searching on the id3 tag comments field | BBCritical | SageTV Beta Test Software | 9 | 12-05-2006 04:40 PM |