def getPlayListBasicVideo(playListItem, myRow): ''' This function will export and return the basic info for the Playlist for movie/tv-shows types ''' # Get Studio myRow['Studio'] = misc.GetRegInfo(playListItem, 'studio', 'N/A') # Get Content Rating myRow['Content Rating'] = misc.GetRegInfo(playListItem, 'contentRating', 'N/A') # Get Tagline myRow['Tagline'] = misc.GetRegInfo(playListItem, 'tagline', 'N/A') # Get Duration myRow['Duration'] = misc.ConvertTimeStamp( misc.GetRegInfo(playListItem, 'duration', '0')).encode('utf8') # Get Originally Available At myRow['Originally Available At'] = misc.GetRegInfo( playListItem, 'originallyAvailableAt', 'N/A') # Get Added At myRow['Added At'] = misc.ConvertDateStamp( misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp( misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') # Get Updated At myRow['Updated At'] = misc.ConvertDateStamp( misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp( misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') return myRow
def getPlayListBasicPhoto(playListItem, myRow): # Get Originally Available At myRow['Originally Available At'] = misc.GetRegInfo(playListItem, 'originallyAvailableAt', 'N/A') # Get Added At myRow['Added At'] = misc.ConvertDateStamp(misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp(misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') # Get Updated At myRow['Updated At'] = misc.ConvertDateStamp(misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp(misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') return myRow
def getPlayListBasicAudio(playListItem, myRow): # Get Rating count myRow['Rating Count'] = misc.GetRegInfo(playListItem, 'ratingCount', 'N/A') # Get Added At myRow['Added At'] = misc.ConvertDateStamp(misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp(misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') # Get Updated At myRow['Updated At'] = misc.ConvertDateStamp(misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp(misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') # Grab the FileName(s) myRow['File Name'] = getFileNamesFromObject(playListItem) return myRow
def getPlayListBasicAudio(playListItem, myRow): # Get Rating count myRow['Rating Count'] = misc.GetRegInfo(playListItem, 'ratingCount', 'N/A') # Get Duration myRow['Duration'] = misc.ConvertTimeStamp(misc.GetRegInfo(playListItem, 'duration', '0')).encode('utf8') # Get Added At myRow['Added At'] = misc.ConvertDateStamp(misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp(misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') # Get Updated At myRow['Updated At'] = misc.ConvertDateStamp(misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp(misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') return myRow
def getPlayListBasicVideo(playListItem, myRow): # Get Studio myRow['Studio'] = misc.GetRegInfo(playListItem, 'studio', 'N/A') # Get Content Rating myRow['Content Rating'] = misc.GetRegInfo(playListItem, 'contentRating', 'N/A') # Get Tagline myRow['Tagline'] = misc.GetRegInfo(playListItem, 'tagline', 'N/A') # Get Duration myRow['Duration'] = misc.ConvertTimeStamp(misc.GetRegInfo(playListItem, 'duration', '0')).encode('utf8') # Get Originally Available At myRow['Originally Available At'] = misc.GetRegInfo(playListItem, 'originallyAvailableAt', 'N/A') # Get Added At myRow['Added At'] = misc.ConvertDateStamp(misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp(misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') # Get Updated At myRow['Updated At'] = misc.ConvertDateStamp(misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp(misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') return myRow
def getShowOnly(myMedia, myRow, level): ''' Export TV Show info only ''' if level: prefsLevel = level else: prefsLevel = Prefs['TV_Level'] if prefsLevel in ['Show Only 1', 'Show Only 2', 'Show Only 3']: for key, value in tvfields.Show_1: element = myMedia.get(value[1:]) if element is None: element = consts.DEFAULT element = misc.WrapStr(misc.fixCRLF(element).encode('utf8')) if key == 'MetaDB Link': myRow[key] = misc.metaDBLink(element) # Is it a dateStamp? elif value[1:] in tvfields.dateTimeFields: myRow[key] = misc.ConvertDateStamp(element) elif key in myRow: myRow[key] = myRow[key] + Prefs['Seperator'] + element else: myRow[key] = element if prefsLevel in ['Show Only 2', 'Show Only 3']: for key, value in tvfields.Show_2: myRow[key] = misc.GetArrayAsString(myMedia, value, default=consts.DEFAULT) # Additional call needed for level 3 if prefsLevel in ['Show Only 3']: directURL = misc.GetLoopBack() + '/library/metadata/' + \ myRow['Media ID'] directMedia = XML.ElementFromURL(directURL, timeout=float(consts.PMSTIMEOUT)) for key, value in tvfields.Show_3: if key == 'MetaDB Link': try: myRow[key] = misc.metaDBLink( str(directMedia.xpath('//Directory/@guid'))) except Exception, e: myRow[key] = consts.DEFAULT pass elif key == 'Delete Item Watched after days': try: deleteDays = directMedia.xpath( '//Directory/@autoDeletionItemPolicyWatchedLibrary') if deleteDays == ['100']: deleteDays = 'Next Refresh' elif deleteDays == []: deleteDays = 'Never' elif deleteDays == ['0']: deleteDays = 'Never' elif deleteDays == ['1']: deleteDays = '1 Day' elif deleteDays == ['7']: deleteDays = '7 Days' myRow[key] = deleteDays except Exception, e: myRow[key] = consts.DEFAULT pass
def getPlayListBasicPhoto(playListItem, myRow): ''' This function will export and return the basic info for the Playlist for photo types ''' # Get Originally Available At myRow['Originally Available At'] = misc.GetRegInfo( playListItem, 'originallyAvailableAt', 'N/A') # Get Added At myRow['Added At'] = misc.ConvertDateStamp( misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp( misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') # Get Updated At myRow['Updated At'] = misc.ConvertDateStamp( misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp( misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') return myRow
def getPlayListBasicAudio(playListItem, myRow): ''' This function will export and return the basic info for the Playlist for audio types ''' # Get Rating count myRow['Rating Count'] = misc.GetRegInfo(playListItem, 'ratingCount', 'N/A') # Get Added At myRow['Added At'] = misc.ConvertDateStamp( misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp( misc.GetRegInfo(playListItem, 'addedAt', '0')).encode('utf8') # Get Updated At myRow['Updated At'] = misc.ConvertDateStamp( misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') + ' ' + misc.ConvertTimeStamp( misc.GetRegInfo(playListItem, 'updatedAt', '0')).encode('utf8') # Grab the FileName(s) myRow['File Name'] = getFileNamesFromObject(playListItem) return myRow