{"id":457,"date":"2009-11-26T16:21:43","date_gmt":"2009-11-26T23:21:43","guid":{"rendered":"http:\/\/appletv.nanopi.net\/?page_id=457"},"modified":"2009-11-26T21:12:55","modified_gmt":"2009-11-27T04:12:55","slug":"custom-virtual-directories","status":"publish","type":"page","link":"https:\/\/appletv.nanopi.net\/manual\/custom-virtual-directories\/","title":{"rendered":"Custom Virtual Directories"},"content":{"rendered":"
Sapphire has the ability to create custom virtual directories. If you wished to create a directory which showed every movie with Bank<\/em> in the Plot, you can create it with Sapphire’s virtual directory mechanism.<\/p>\n First create the file ~\/Library\/Application Support\/Sapphire\/virtualDirs.xml<\/em>. As the name implies, this is an XML file. The definition of a virtual directory is quite complex, so we will take this step by step.<\/p>\n First, everything within the XML file must be contained within a virtualDirs<\/em> tag:<\/p>\n Within the virtualDirs<\/em> tag, one can define either movie or TV episodes virtual directories. The movie virtual directories are contained within a movieMatch<\/em> tag and TV episodes are contained within a episodeMatch<\/em> tag. Each match tag can have two properties, name<\/em> and description<\/em>. The name will be the name displayed in the directory listings and the description will be displayed in the preview when the directory is highlighted.<\/p>\n Within each movieMatch<\/em> or episodeMatch<\/em> tag is a series of tags which define how Sapphire will determine the directory’s contents. By default, Sapphire requires a match on all criteria listed within each match. The following tags are used by both TV episodes and Movies:<\/p>\n Sapphire also includes methods of matching content specific to movies. The following are valid within a movieMatch<\/em> tag:<\/p>\n Sapphire also includes methods of matching content specific to TV episodes. The following are valid within a episodeMatch<\/em> tag:<\/p>\n Several of the above tags match in a particular manner. For example, the airdate matches on or after the given date. In some cases, you may want to change how this match is done. For numeric or date match types, you can change the match by setting the value<\/em> attribute to:<\/p>\n Finally, for text matches, you can specify a wildcard *<\/em> to match any content. So, *bank*<\/em> will match any text with bank in it, including content with bankrupt<\/em> and other words with bank within them. The * bank *<\/em> will match the word bank that has a space both before and after it. The match bank*<\/em> will match things starting with bank, and *bank<\/em> will match those ending with bank. By default, Sapphire uses case insensitive matches, but you can make these case sensitive by setting the type<\/em> attribute to s<\/em>.<\/p>\n No good manual on something this complex would be complete without an example:<\/p>\n In the above example the following matches are made:<\/p>\n We hope this gets you started in further customization of Sapphire. Be aware, these custom virtual directories are implemented by a generic database fetch. Sapphire built-in virtual directories have been heavily optimized for speed, so your custom virtual directories may not be as fast.<\/p>\n","protected":false},"excerpt":{"rendered":" Sapphire has the ability to create custom virtual directories. If you wished to create a directory which showed every movie with Bank in the Plot, you can create it with Sapphire’s virtual directory mechanism. First create the file ~\/Library\/Application Support\/Sapphire\/virtualDirs.xml. As the name implies, this is an XML file. The definition of a virtual directory […]<\/p>\n","protected":false},"author":4,"featured_media":0,"parent":44,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/appletv.nanopi.net\/wp-json\/wp\/v2\/pages\/457"}],"collection":[{"href":"https:\/\/appletv.nanopi.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/appletv.nanopi.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/appletv.nanopi.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/appletv.nanopi.net\/wp-json\/wp\/v2\/comments?post=457"}],"version-history":[{"count":26,"href":"https:\/\/appletv.nanopi.net\/wp-json\/wp\/v2\/pages\/457\/revisions"}],"predecessor-version":[{"id":484,"href":"https:\/\/appletv.nanopi.net\/wp-json\/wp\/v2\/pages\/457\/revisions\/484"}],"up":[{"embeddable":true,"href":"https:\/\/appletv.nanopi.net\/wp-json\/wp\/v2\/pages\/44"}],"wp:attachment":[{"href":"https:\/\/appletv.nanopi.net\/wp-json\/wp\/v2\/media?parent=457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<virtualDirs>\r\n<\/virtualDirs><\/pre>\n
<virtualDirs>\r\n <movieMatch name=\"Favorites\" description=\"My Favorite Movies\">\r\n <\/movieMatch>\r\n <episodeMatch name=\"Fav\" description=\"My Favorite TV Shows\">\r\n <\/episodeMatch>\r\n<\/virtualDirs><\/pre>\n
\n
\n
\n
\n
\r\n<virtualDirs>\r\n <movieMatch name=\"Highly Ranked Movies\" description=\"Highly Ranked Movies\">\r\n <imdbUserRating>8<\/imdbUserRating>\r\n <\/movieMatch>\r\n <movieMatch name=\"James Bond Movies\" description=\"James Bond Movies\">\r\n <any>\r\n <plot type=\"s\">*James Bond*<\/plot>\r\n <plot type=\"s\">Bond*<\/plot>\r\n <plot>*007*<\/plot>\r\n <\/any>\r\n <\/movieMatch>\r\n <movieMatch name=\"Bruce's Films\" description=\"Bruce's Films\">\r\n <cast>Bruce Willis<\/cast>\r\n <\/movieMatch>\r\n <episodeMatch name=\"All Recent Unwatched\" description=\"All Unwatched TV Shows\">\r\n <watched>0<\/watched>\r\n <airDate>11\/01\/08<\/airDate>\r\n <\/episodeMatch>\r\n <episodeMatch name=\"All Other Unwatched\" description=\"All Unwatched TV Shows\">\r\n <watched>0<\/watched>\r\n <airDate value=\"less\">11\/01\/08<\/airDate>\r\n <\/episodeMatch>\r\n<\/virtualDirs>\r\n<\/pre>\n
\n