org.stanwood.media.search
Class MediaSearcher

java.lang.Object
  extended by org.stanwood.media.search.MediaSearcher

public class MediaSearcher
extends java.lang.Object

Used to search for media information


Constructor Summary
MediaSearcher(Controller controller)
          The constructor
 
Method Summary
protected static SearchResult findFilm(MediaDirectory dir, java.io.File file, boolean useSources)
           
static IFilm getFilm(MediaDirectory dir, java.io.File file, boolean useSources)
          Used to lookup film information
static java.lang.Integer getFilmPart(MediaDirectory dir, java.io.File file, IFilm film)
          Used to get the part number of a film
static IEpisode getTVEpisode(MediaDirectory dir, java.io.File file, boolean useSources)
          Used to lookup TV episode information
 MediaSearchResult lookupMedia(java.io.File mediaFile, boolean useSources)
          Used to lookup media file information
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaSearcher

public MediaSearcher(Controller controller)
              throws ConfigException
The constructor

Parameters:
controller - The media controller
Throws:
ConfigException - Thrown if their is a problem reading the configuration
Method Detail

lookupMedia

public MediaSearchResult lookupMedia(java.io.File mediaFile,
                                     boolean useSources)
                              throws ActionException
Used to lookup media file information

Parameters:
mediaFile - The media file
useSources - If true, then information is fetched remotely as well as locally
Returns:
The media file information, or null if it could not be found.
Throws:
ActionException - Thrown if their are any problems.

getFilm

public static IFilm getFilm(MediaDirectory dir,
                            java.io.File file,
                            boolean useSources)
                     throws ActionException
Used to lookup film information

Parameters:
dir - The media directory
file - The media file
useSources - If true, then information is fetched remotely as well as locally
Returns:
The media file information, or null if it could not be found.
Throws:
ActionException - Thrown if their are any problems.

findFilm

protected static SearchResult findFilm(MediaDirectory dir,
                                       java.io.File file,
                                       boolean useSources)
                                throws ActionException
Throws:
ActionException

getTVEpisode

public static IEpisode getTVEpisode(MediaDirectory dir,
                                    java.io.File file,
                                    boolean useSources)
                             throws ActionException
Used to lookup TV episode information

Parameters:
dir - The media directory
file - The media file
useSources - If true, then information is fetched remotely as well as locally
Returns:
The media file information, or null if it could not be found.
Throws:
ActionException - Thrown if their are any problems.

getFilmPart

public static java.lang.Integer getFilmPart(MediaDirectory dir,
                                            java.io.File file,
                                            IFilm film)
Used to get the part number of a film

Parameters:
dir - The media directory of the film
file - The media file
film - The film information
Returns:
The part number or null if it does not have one