MythTV  0.27pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
Namespaces | Functions | Variables
mirobridge Namespace Reference

Namespaces

namespace  mirobridge_interpreter_2_0_3
namespace  mirobridge_interpreter_2_5_2
namespace  mirobridge_interpreter_3_0_0
namespace  mirobridge_interpreter_3_5_0
namespace  mirobridge_interpreter_4_0_2

Functions

def getMythtvDirectories
def setUseroptions
def massageDescription
def getOldrecordedOrphans
def getStartEndTimes
def setSymbolic
def createOldRecordedRecord
def createRecordedRecords
def createVideometadataRecord
def createChannelRecord
def checkVideometadataFails
def createMiroMythVideoDirectory
def createMiroChannelSubdirectory
def getPlayedMiroVideos
def updateMythRecorded
def updateMythVideo
def printStatistics
def main

Variables

string __title__ = "mirobridge - Maintains Miro's Video files with MythTV"
string __author__ = "R.D.Vaughan"
string __purpose__
string __version__ = u"v0.7.0"
string examples_txt = u''
tuple records = mythdb.getStorageGroup(hostname=localhostname)
tuple dirname = unicode(record.dirname, 'utf8')
 storagegroup_ok = True
tuple myapp = singleinstance(u'/tmp/mirobridge.pid')

Function Documentation

def mirobridge.getMythtvDirectories ( )
Get all video and graphics directories found in the MythTV DB and add them to the dictionary.
Ignore any MythTV Frontend setting when there is already a storage group configured.

Definition at line 834 of file mirobridge.py.

Referenced by main().

def mirobridge.setUseroptions ( )
Change variables through a user supplied configuration file
abort the script if there are issues with the configuration file values

Definition at line 950 of file mirobridge.py.

Referenced by main().

def mirobridge.massageDescription (   description,
  extras = False 
)
Massage the Miro description removing all HTML.
return the massaged description

Definition at line 1031 of file mirobridge.py.

Referenced by createOldRecordedRecord(), createRecordedRecords(), and createVideometadataRecord().

def mirobridge.getOldrecordedOrphans ( )
Retrieves the Miro oldrecorded records for localhostname. Match them against the Miro recorded
records and identify any orphaned oldrecorded records. Those records mean a MythTV user deleted the
Miro video from the Watched Recordings screen or from MythVideo. Delete the orphaned records from
MythTV plus any left over graphic files.
return array of oldrecorded dictionary records which are orphaned
return None if there are no orphaned oldrecorded records

Definition at line 1152 of file mirobridge.py.

Referenced by main().

def mirobridge.getStartEndTimes (   duration,
  downloadedTime 
)
Calculate a videos start and end times and isotime for the recorded file name.
return an array of initialised values if either duration or downloadedTime is invalid
return an array of the video's start, end times and isotime

Definition at line 1227 of file mirobridge.py.

Referenced by createRecordedRecords(), and createVideometadataRecord().

def mirobridge.setSymbolic (   filename,
  storagegroupkey,
  symbolic_name,
  allow_symlink = False 
)
Convert the file into a symbolic name according to it's storage group (there may be
no storage group for the key). Check if a symbolic link exists and replace the link with a copy of
the file. except for video files. Abort if the file does not exist.
return the symbolic link to the file

Definition at line 1263 of file mirobridge.py.

Referenced by createRecordedRecords(), and createVideometadataRecord().

def mirobridge.createOldRecordedRecord (   item,
  start,
  end,
  inetref 
)
Using the details from a Miro item record create a MythTV oldrecorded record
return an array of MythTV of a full initialised oldrecorded record dictionaries

Definition at line 1347 of file mirobridge.py.

Referenced by createRecordedRecords(), and createVideometadataRecord().

def mirobridge.createRecordedRecords (   item)
Using the details from a Miro item record create a MythTV recorded record
return an array of MythTV full initialised recorded and recordedprogram record dictionaries

Definition at line 1375 of file mirobridge.py.

Referenced by updateMythRecorded().

def mirobridge.createVideometadataRecord (   item)
Using the details from a Miro item create a MythTV videometadata record
return an dictionary of MythTV an initialised videometadata record

Definition at line 1459 of file mirobridge.py.

Referenced by updateMythVideo().

def mirobridge.createChannelRecord (   icon,
  channel_id,
  channel_num 
)
Create the optional Miro "channel" record as it makes the Watch Recordings screen look better.
return True if the record was created and written successfully
abort if the processing failed

Definition at line 1572 of file mirobridge.py.

Referenced by main().

def mirobridge.checkVideometadataFails (   record,
  flat 
)
Verify that the real path exists for both video and graphics for this MythVideo Miro record.
return False if there were no failures
return True if a failure was found

Definition at line 1618 of file mirobridge.py.

Referenced by updateMythVideo().

def mirobridge.createMiroMythVideoDirectory ( )
If the "Miro" directory does not exist in MythVideo then create it.
abort if there is an issue creating the directory

Definition at line 1641 of file mirobridge.py.

Referenced by updateMythVideo().

def mirobridge.createMiroChannelSubdirectory (   item)
Create the Miro Channel subdirectory in MythVideo
abort if the subdirectory cannot be made

Definition at line 1669 of file mirobridge.py.

Referenced by updateMythVideo().

def mirobridge.getPlayedMiroVideos ( )
From the MythTV database recorded records identify all "played" Miro Video files.
return None if there were either no Miro recorded records or none that were in "watched" status
return an array of subtitles of those Miro video files that were "watched"

Definition at line 1693 of file mirobridge.py.

Referenced by main().

def mirobridge.updateMythRecorded (   items)
Add and delete MythTV (Watch Recordings) Miro recorded records. Add and delete symbolic links
to coverart/Miro icons.
Abort if processing failed
return True if processing was successful

Definition at line 1720 of file mirobridge.py.

Referenced by main().

def mirobridge.updateMythVideo (   items)
Add and delete MythVideo records for played Miro Videos. Add and delete symbolic links
to Miro Videos, to coverart/Miro icons, banners and Miro screenshots and fanart.
NOTE: banner and fanart graphics were provided with the script and are used only if present.
Abort if processing failed
return True if processing was successful

Definition at line 1884 of file mirobridge.py.

Referenced by main().

def mirobridge.printStatistics ( )

Definition at line 2043 of file mirobridge.py.

Referenced by main().

def mirobridge.main ( void  )
Support mirobridge from the command line
returns True

Definition at line 2072 of file mirobridge.py.

Variable Documentation

string mirobridge.__title__ = "mirobridge - Maintains Miro's Video files with MythTV"

Definition at line 22 of file mirobridge.py.

string mirobridge.__author__ = "R.D.Vaughan"

Definition at line 23 of file mirobridge.py.

string mirobridge.__purpose__
Initial value:
1 '''
2 This python script is intended to synchronise Miro's video files with MythTV's "Watch Recordings" and MythVideo.
3 
4 The source of all video files are from those downloaded my Miro.
5 The source of all meta data for the video files is from the Miro data base.
6 The source of all cover art and screen shots are from those downloaded and maintained by Miro.
7 Miro v2.0.3 or later must already be installed and configured and capable of downloading videos.
8 '''

Definition at line 24 of file mirobridge.py.

string mirobridge.__version__ = u"v0.7.0"

Definition at line 33 of file mirobridge.py.

string mirobridge.examples_txt = u''

Definition at line 215 of file mirobridge.py.

tuple mirobridge.records = mythdb.getStorageGroup(hostname=localhostname)

Definition at line 801 of file mirobridge.py.

mirobridge.dirname = unicode(record.dirname, 'utf8')
mirobridge.storagegroup_ok = True

Definition at line 824 of file mirobridge.py.

tuple mirobridge.myapp = singleinstance(u'/tmp/mirobridge.pid')

Definition at line 2744 of file mirobridge.py.