MythTV 0.25-pre
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
jamu::MythTvMetaData Class Reference
Inheritance diagram for jamu::MythTvMetaData:
jamu::VideoFiles jamu::Tvdatabase

List of all members.

Public Member Functions

def __init__
def hashFile
def rtnRelativePath
def rtnAbsolutePath
def removeCommonWords
def combineMetaData
def updateMiroVideo
def findFileInDir
def processMythTvMetaData
def __repr__

Public Attributes

 program_seriesid
 errors
 new_names
 absolutepath

Static Public Attributes

string movie_file_format = u"%s/%s.%s"
dictionary graphic_suffix = {u'coverfile': u'_coverart', u'fanart': u'_fanart', u'banner': u'_banner'}
string graphic_name_suffix = u"%s/%s%s.%s"
string graphic_name_season_suffix = u"%s/%s Season %d%s.%s"
list errors = []
list new_names = []
int num_moved_video_files = 0
int num_created_video_subdirectories = 0
int num_symbolic_links = 0
int num_secondary_source_graphics_downloaded = 0
int num_secondary_source_metadata_downloaded = 0

Private Member Functions

def _getSubtitle
def _getTmdbIMDB
def _getTmdbGraphics
def _getSecondarySourceGraphics
def _getSecondarySourceMetadata
def _getTmdbMetadata
def _getTvdbGraphics
def _getTvdbMetadata
def _make_db_ready
def _addCastGenreCountry
def _moveDirectoryTree
def _moveVideoFiles
def _displayMessage
def _findMissingInetref
def _checkValidGraphicFile
def _graphicsCleanup
def _getVideoLength
def _getMiroVideometadataRecords
def _getExtraMiroDetails
def _getScheduledRecordedProgramList
def _getScheduledRecordedTVGraphics
def _downloadScheduledRecordedGraphics

Detailed Description

Process all mythvideo video files, update the video files associated MythTV meta data.
Download graphics for those video files from either thetvdb.com or themovie.com. Video file names
for TV episodes must series name, season and episode numbers. The video file's movie name must be
an exact match with a movie title in themoviedb.com or the MythTV database must have an entry for
the video file with a TMDB or an IMDB number (db field 'intref').

Definition at line 3029 of file jamu.py.


Constructor & Destructor Documentation

def jamu::MythTvMetaData::__init__ (   self,
  configuration 
)
Retrieve the configuration options

Reimplemented from jamu::VideoFiles.

Definition at line 3036 of file jamu.py.


Member Function Documentation

def jamu::MythTvMetaData::_getSubtitle (   self,
  cfile 
) [private]
Get the MythTV subtitle (episode name)
return None
return episode name string

Definition at line 3051 of file jamu.py.

def jamu::MythTvMetaData::hashFile (   self,
  name 
)
Create metadata hash values for mythvideo files
return a hash value
return u'' if the was an error with the video file or the video file length was zero bytes

Definition at line 3066 of file jamu.py.

def jamu::MythTvMetaData::rtnRelativePath (   self,
  abpath,
  filetype 
)
Check if there is a Storage Group for the file type (video, coverfile, banner, fanart, screenshot)
and form an apprioriate relative path and file name.
return a relative path and file name
return an absolute path and file name if there is no storage group for the file type

Definition at line 3109 of file jamu.py.

def jamu::MythTvMetaData::rtnAbsolutePath (   self,
  relpath,
  filetype 
)
Check if there is a Storage Group for the file type (mythvideo, coverfile, banner, fanart,
screenshot)    and form an appropriate absolute path and file name.
return an absolute path and file name
return the relpath sting if the file does not actually exist in the absolute path location

Definition at line 3132 of file jamu.py.

def jamu::MythTvMetaData::removeCommonWords (   self,
  title 
)
Remove common words from a title
return title striped of common words

Definition at line 3161 of file jamu.py.

def jamu::MythTvMetaData::_getTmdbIMDB (   self,
  title,
  watched = False,
  IMDB = False,
  rtnyear = False 
) [private]
Find and exact match of the movie name with what's on themoviedb.com
If IMDB is True return an imdb#
If rtnyear is True return IMDB# and the movie year in a dictionary
return False (no matching movie found)
return imdb# and/or tmdb#

Definition at line 3177 of file jamu.py.

def jamu::MythTvMetaData::_getTmdbGraphics (   self,
  cfile,
  graphic_type,
  watched = False 
) [private]
Download either a movie Poster or Fanart
return None
return full qualified path and filename of downloaded graphic

Definition at line 3405 of file jamu.py.

def jamu::MythTvMetaData::_getSecondarySourceGraphics (   self,
  cfile,
  graphic_type,
  watched = False 
) [private]
Download from secondary source such as movieposter.com
return None
return full qualified path and filename of downloaded graphic

Definition at line 3476 of file jamu.py.

def jamu::MythTvMetaData::combineMetaData (   self,
  available_metadata,
  meta_dict,
  vid_type = False 
)
Combine the current data with new meta data from primary or secondary sources
return combinted meta data dictionary

Definition at line 3614 of file jamu.py.

def jamu::MythTvMetaData::_getSecondarySourceMetadata (   self,
  cfile,
  available_metadata 
) [private]
Download meta data from secondary source
return available_metadata (returns the current metadata unaltered)
return dictionary of combined meta data

Definition at line 3671 of file jamu.py.

def jamu::MythTvMetaData::_getTmdbMetadata (   self,
  cfile,
  available_metadata 
) [private]
Download a movie's meta data and massage the genres string
return results for secondary sources when no primary source meta data
return dictionary of metadata combined with data from a secondary source

Definition at line 3794 of file jamu.py.

def jamu::MythTvMetaData::_getTvdbGraphics (   self,
  cfile,
  graphic_type,
  toprated = False,
  watched = False 
) [private]
Download either a TV Series Poster, Banner, Fanart or Episode image
return None
return full qualified path and filename of downloaded graphic

Definition at line 3884 of file jamu.py.

def jamu::MythTvMetaData::_getTvdbMetadata (   self,
  cfile,
  available_metadata 
) [private]
Download thetvdb.com meta data
return what was input or results from a secondary source
return dictionary of metadata

Definition at line 3956 of file jamu.py.

def jamu::MythTvMetaData::_make_db_ready (   self,
  text 
) [private]
Prepare text for inclusion into a DB
return None
return data base ready text

Definition at line 4094 of file jamu.py.

def jamu::MythTvMetaData::_addCastGenreCountry (   self,
  data_string,
  vim,
  cast_genres_type 
) [private]
From a comma delimited string of cast members, genres or countries add the ones
not already in the myth db and update the video's meta data
return True when successfull
return False if failed

Definition at line 4114 of file jamu.py.

def jamu::MythTvMetaData::_moveDirectoryTree (   self,
  src,
  dst,
  symlinks = False,
  ignore = None 
) [private]
Move a directory tree from a given source to a given destination. Subdirectories will be
created and synbolic links will be recreated in the new destination.
return an array of two arrays. Names of files/directories moved and Errors found

Definition at line 4147 of file jamu.py.

def jamu::MythTvMetaData::_moveVideoFiles (   self,
  target_destination_array 
) [private]
Copy files or directories to a destination directory.
If the -F filename option is set then rename TV series during the move process. The move will
be interactive for identifying a movie's IMDB number or TV series if the -i option was also set.
If there is a problem error message are displayed and the script exists. After processing
print a statistics report.
return a array of video file dictionaries to update in Mythvideo data base

Definition at line 4253 of file jamu.py.

def jamu::MythTvMetaData::_displayMessage (   self,
  message 
) [private]
Displays messages through stdout. Usually used with MythTv metadata updates in -V
verbose mode.
returns nothing

Definition at line 4480 of file jamu.py.

def jamu::MythTvMetaData::_findMissingInetref (   self) [private]
Find any video file without a Mythdb record or without an inetref number
return None if there are no new video files
return a array of dictionary information on each video file that qualifies for processing

Definition at line 4491 of file jamu.py.

def jamu::MythTvMetaData::_checkValidGraphicFile (   self,
  filename,
  graphicstype = u'',
  vidintid = False 
) [private]
Verify that a graphics file is not really an HTML file
return True if it is a graphics file
return False if it is an HTML file

Definition at line 4531 of file jamu.py.

def jamu::MythTvMetaData::_graphicsCleanup (   self) [private]
Match the graphics in the mythtv graphics directories with the ones specified by the
mythvideometa records. Remove any graphics that are not referenced at least once. Print a
report.

Definition at line 4573 of file jamu.py.

def jamu::MythTvMetaData::_getVideoLength (   self,
  videofilename 
) [private]
Using ffmpeg (if it can be found) get the duration of the video
return False if either ffmpeg cannot be found or the file is not a video
return video lenght in minutes

Definition at line 4764 of file jamu.py.

def jamu::MythTvMetaData::_getMiroVideometadataRecords (   self) [private]
Fetches all videometadata records with an inetref of '99999999' and a category of 'Miro'. If the
videometadata record has a host them it must match the lower-case of the locahostname.
aborts if processing failed
return and array of matching videometadata dictionary records

Definition at line 4800 of file jamu.py.

def jamu::MythTvMetaData::_getExtraMiroDetails (   self,
  mythvideorec,
  vidtype 
) [private]
Find the extra details required for Miro MythVideo record processing
return a dictionary of details required for processing

Definition at line 4831 of file jamu.py.

def jamu::MythTvMetaData::updateMiroVideo (   self,
  program 
)
Update the information in a Miro/MythVideo record
return nothing

Definition at line 4921 of file jamu.py.

def jamu::MythTvMetaData::_getScheduledRecordedProgramList (   self) [private]
Find all Scheduled and Recorded programs
return array of found programs, if none then empty array is returned

Definition at line 4989 of file jamu.py.

def jamu::MythTvMetaData::_getScheduledRecordedTVGraphics (   self,
  program,
  graphics_type 
) [private]
Get TV show graphics for Scheduled and Recorded TV programs
return None if no graphics found
return fullpath and filename of downloaded graphics file

Definition at line 5152 of file jamu.py.

def jamu::MythTvMetaData::_downloadScheduledRecordedGraphics (   self) [private]
Get Scheduled and Recorded programs and Miro vidoes get their graphics if not already
downloaded
return (nothing is returned)

Definition at line 5187 of file jamu.py.

def jamu::MythTvMetaData::findFileInDir (   self,
  filename,
  directories,
  suffix = None,
  fuzzy_match = False 
)
Find if a file is in any of the specified directories. An exact match or a variation.
return False - File not found in directories
return True - Absolute file name and path

Definition at line 5439 of file jamu.py.

def jamu::MythTvMetaData::processMythTvMetaData (   self)
Check each video file in the mythvideo directories download graphics files and meta data then
update MythTV data base meta data with any new information.

Definition at line 5504 of file jamu.py.

def jamu::MythTvMetaData::__repr__ (   self)

Reimplemented from jamu::VideoFiles.

Definition at line 6174 of file jamu.py.


Member Data Documentation

Definition at line 3045 of file jamu.py.

dictionary jamu::MythTvMetaData::graphic_suffix = {u'coverfile': u'_coverart', u'fanart': u'_fanart', u'banner': u'_banner'} [static]

Definition at line 3046 of file jamu.py.

Definition at line 3047 of file jamu.py.

string jamu::MythTvMetaData::graphic_name_season_suffix = u"%s/%s Season %d%s.%s" [static]

Definition at line 3048 of file jamu.py.

list jamu::MythTvMetaData::errors = [] [static]

Definition at line 4144 of file jamu.py.

list jamu::MythTvMetaData::new_names = [] [static]

Definition at line 4145 of file jamu.py.

Definition at line 4249 of file jamu.py.

Definition at line 4250 of file jamu.py.

Definition at line 4251 of file jamu.py.

Definition at line 5501 of file jamu.py.

Definition at line 5502 of file jamu.py.

Definition at line 3408 of file jamu.py.

Definition at line 4259 of file jamu.py.

Definition at line 4259 of file jamu.py.

Definition at line 4259 of file jamu.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends