Name

getrelated — get information on sets related to the set number given

Synopsis

use Wacs;
use Wacs::WacsUI;
scalar getrelated(...); 
 

Parameters

paramterdescription
relation

gives the type of relation we're looking for. Available options are continuation, primary, duplicates or altmedia. If continuation is specified it gives an array of set numbers starting with this set and continuing for the length of the chain. Usually this will be two or four sub-parts of a video clip. If primary is specified it, returns an array of just the primary set numbers in this chain. It is possible that there can be more than one primary set in a chain, where for instance the clips came from a movie where there is loose connections between the scenes. The usual case is that it's the set number at the top of the chain of continuation files. (New in Wacs 1.0.0). If duplicates is given it follows the duplicates link of each set until it reaches the end of the chain or returns to the first set - it returns an array of these sets. If altmedia is specified an array of set numbers will be returned prefixed by their type and a hyphen.

stypegives the type of the set we're dealing with - ie I or V.
setno

the set number to start from - most likely the first in the set but not necessarily. The progression will only be forwards however. For alternative media, this can be expected to be the start point that we don't want given back to us.

alternative

This is the first alternative number to look for when looking for alternative media. The chain continues until we get back to the set number given.

duplicates

This is the first number of a duplicate set to look for when finding alternatives. If you don't specify this option, the search will start with the set itself - sometimes this maybe what you want.

dbhandlethe database handle to use for submitting queries to the database

Summary

The function getrelated provides a tool for finding a sequence of related sets based on the requested type of relation to look for and the set number given. If the relation specified is continuation it will return an array starting with the set itself in element zero and will then follow links in snext to find the chain of related sets and each subsequent element will be the setno of the next set in the continuation chain.

If the relation specfied is primary, then it will only find the primary sets walking backwards through the chain. In the vast majority of cases, this will be a single set number at the top of the chain. It is possible for there to be multiple primary sets in a chain if there is a looser connection between two chains such as different scenes from a movie, or different parts of a series. This option is only available in Wacs 1.0.0 and later.

If the relation specified is altmedia it will return an array of all sets of other media types related to this set, but not the set's own details.

Availability

getrelated is available from Wacs release 0.9.0 onwards in both perl and php. It was not available prior to this release. The primary is only available in Wacs release 1.0.0 and later.