|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.stanwood.media.store.SapphireStore
public class SapphireStore
This is a write only store that is used to store information in a format that can be used by the sapphire frontrow plug-in. "http://appletv.nanopi.net/". The details of the XML format can be found here: "http://appletv.nanopi.net/manual/overriding-metadata/".
Every time the cacheEpisode(File, File, IEpisode)
or the cacheFilm(File, File, IFilm, Integer)
method is called, a XML file is written next to the episodes/films file with a
.xml extension.
This store has the optional parameter "PreferredCertificationCounrty". If this is set, then when fetching the rating, this country's rating is used. If this is not set or the country can't be found, then the first rating is used.
Constructor Summary | |
---|---|
SapphireStore()
|
Method Summary | |
---|---|
void |
cacheEpisode(java.io.File rootMediaDir,
java.io.File episodeFile,
IEpisode episode)
This will store the episode and show details in a XML file next too the media file. |
void |
cacheFilm(java.io.File rootMediaDir,
java.io.File filmFile,
IFilm film,
java.lang.Integer part)
This is used to write a film to the store. |
void |
cacheSeason(java.io.File rootMediaDir,
java.io.File episodeFile,
ISeason season)
Does nothing as it is not implemented for this store |
void |
cacheShow(java.io.File rootMediaDir,
java.io.File episodeFile,
IShow show)
Does nothing as it is not implemented for this store |
void |
fileDeleted(MediaDirectory dir,
java.io.File file)
This is called when a file is deleted from a media directory |
void |
fileUpdated(MediaDirectory mediaDirectory,
java.io.File file)
This is called when a file is updated within a media directory. |
IEpisode |
getEpisode(java.io.File rootMediaDir,
java.io.File episodeFile,
ISeason season,
int episodeNum)
Always returns null as it is not implemented for this store. |
IEpisode |
getEpisode(MediaDirectory dir,
java.io.File file)
This is used to get a episode from a store via it's file name. |
IFilm |
getFilm(java.io.File rootMediaDir,
java.io.File filmFile,
java.lang.String filmId)
Always returns null as it is not implemented for this store. |
IFilm |
getFilm(MediaDirectory dir,
java.io.File file)
This is used to get a film from a store via it's file name. |
java.lang.String |
getParameter(java.lang.String key)
Used to get the value of a source parameter. |
Season |
getSeason(java.io.File rootMediaDir,
java.io.File episodeFile,
IShow show,
int seasonNum)
Always returns null as it is not implemented for this store. |
IShow |
getShow(java.io.File rootMediaDir,
java.io.File episodeFile,
java.lang.String showId)
Always returns null as it is not implemented for this store. |
IEpisode |
getSpecial(java.io.File rootMediaDir,
java.io.File episodeFile,
ISeason season,
int specialNumber)
Always returns null as it is not implemented for this store. |
void |
init(Controller controller,
java.io.File nativeDir)
Called to initialise the stores and check all their resources can be found. |
java.util.List<IEpisode> |
listEpisodes(MediaDirConfig dirConfig,
IProgressMonitor monitor)
This is used to list all the episodes within the store if the store supports the operation. |
java.util.List<IFilm> |
listFilms(MediaDirConfig dirConfig,
IProgressMonitor monitor)
This is used to list all the films within the store if the store supports the operation. |
void |
performedActions(MediaDirectory dir)
This is called after all the actions on all the media files have been performed so that the store can clean up any stale data. |
void |
renamedFile(java.io.File rootMediaDir,
java.io.File oldFile,
java.io.File newFile)
This will update all references of the old file to the new file |
SearchResult |
searchMedia(java.lang.String name,
Mode mode,
java.lang.Integer part,
MediaDirConfig dirConfig,
java.io.File mediaFile)
Used to search for store for media |
void |
setParameter(java.lang.String key,
java.lang.String value)
Used to set source parameters. |
void |
upgrade(MediaDirectory mediaDirectory)
This is called to check if a upgrade is needed and perform the upgrade if required |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SapphireStore()
Method Detail |
---|
public void cacheEpisode(java.io.File rootMediaDir, java.io.File episodeFile, IEpisode episode) throws StoreException
cacheEpisode
in interface IStore
episode
- The episode to the storedepisodeFile
- the file which the episode is stored inrootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.
StoreException
- Thrown if their is a problem writing to the storepublic void cacheSeason(java.io.File rootMediaDir, java.io.File episodeFile, ISeason season)
cacheSeason
in interface IStore
season
- The season too storeepisodeFile
- the file witch the episode is stored inrootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.public void cacheShow(java.io.File rootMediaDir, java.io.File episodeFile, IShow show)
cacheShow
in interface IStore
show
- The show too storeepisodeFile
- the file witch the episode is stored inrootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.public IEpisode getEpisode(java.io.File rootMediaDir, java.io.File episodeFile, ISeason season, int episodeNum)
getEpisode
in interface IStore
season
- The season the episode belongs tooepisodeNum
- The number of the episodeepisodeFile
- the file which the episode is stored inrootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.
public Season getSeason(java.io.File rootMediaDir, java.io.File episodeFile, IShow show, int seasonNum)
getSeason
in interface IStore
show
- The show the season belongs tooseasonNum
- The number of the seasonepisodeFile
- the file which the episode is stored inrootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.
public IShow getShow(java.io.File rootMediaDir, java.io.File episodeFile, java.lang.String showId)
getShow
in interface IStore
showId
- The id of the showepisodeFile
- the file which the episode is stored inrootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.
public IEpisode getSpecial(java.io.File rootMediaDir, java.io.File episodeFile, ISeason season, int specialNumber)
getSpecial
in interface IStore
season
- The season the special episode belongs toospecialNumber
- The number of the special episodeepisodeFile
- the file which the episode is stored inrootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.
public SearchResult searchMedia(java.lang.String name, Mode mode, java.lang.Integer part, MediaDirConfig dirConfig, java.io.File mediaFile) throws StoreException
searchMedia
in interface IStore
name
- The search termmode
- The mode of the searchpart
- The part number to search fordirConfig
- The Media directory configurationmediaFile
- The media file the search is associated with
StoreException
- Thrown if their is a problem with the storepublic void cacheFilm(java.io.File rootMediaDir, java.io.File filmFile, IFilm film, java.lang.Integer part) throws StoreException
cacheFilm
in interface IStore
filmFile
- The file which the film is stored infilm
- The film to writerootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.part
- The part number of the film
StoreException
- Thrown if their is a problem with the storepublic void renamedFile(java.io.File rootMediaDir, java.io.File oldFile, java.io.File newFile)
renamedFile
in interface IStore
oldFile
- The old filenewFile
- The new filerootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.public IFilm getFilm(java.io.File rootMediaDir, java.io.File filmFile, java.lang.String filmId) throws StoreException, java.net.MalformedURLException, java.io.IOException
getFilm
in interface IStore
filmFile
- The file the film is stored infilmId
- The id of the filmrootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.
StoreException
- Thrown if their is a problem retrieving the data
java.net.MalformedURLException
- Thrown if their is a problem creating URL's
java.io.IOException
- Thrown if their is a I/O related problem.public void setParameter(java.lang.String key, java.lang.String value)
Used to set source parameters. If the key is not supported by this source, then a SourceException
is thrown.
setParameter
in interface IStore
key
- The key of the parametervalue
- The value of the parameterpublic java.lang.String getParameter(java.lang.String key)
Used to get the value of a source parameter. If the key is not supported by this source, then a SourceException
is thrown.
getParameter
in interface IStore
key
- The key of the parameter
public void performedActions(MediaDirectory dir)
performedActions
in interface IStore
dir
- The media directorypublic void fileDeleted(MediaDirectory dir, java.io.File file) throws StoreException
fileDeleted
in interface IStore
dir
- The media directoryfile
- The file
StoreException
- Thrown if their is a problempublic IEpisode getEpisode(MediaDirectory dir, java.io.File file) throws StoreException
getEpisode
in interface IStore
dir
- The media directoryfile
- The media file
StoreException
- Thrown if their are any problemspublic IFilm getFilm(MediaDirectory dir, java.io.File file) throws StoreException
getFilm
in interface IStore
dir
- The media directoryfile
- The media file
StoreException
- Thrown if their are any problemspublic void init(Controller controller, java.io.File nativeDir) throws StoreException
init
in interface IStore
controller
- The media controllernativeDir
- The native folder been used or configured. Null if can't be found
StoreException
- Thrown if their are any problemspublic java.util.List<IEpisode> listEpisodes(MediaDirConfig dirConfig, IProgressMonitor monitor)
listEpisodes
in interface IStore
dirConfig
- The media directory configurationmonitor
- The progress monitor
public java.util.List<IFilm> listFilms(MediaDirConfig dirConfig, IProgressMonitor monitor)
listFilms
in interface IStore
dirConfig
- The media directory configurationmonitor
- The progress monitor
public void upgrade(MediaDirectory mediaDirectory)
upgrade
in interface IStore
mediaDirectory
- The media directory been upgradedpublic void fileUpdated(MediaDirectory mediaDirectory, java.io.File file) throws StoreException
fileUpdated
in interface IStore
mediaDirectory
- The media directory the file belongs tofile
- The media file
StoreException
- Thrown if their are any problems
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |