Exemple #1
0
def getEventsByFighter(fighterID):
    log('Listing all events for: %s' % fighterID)
    dbList = library.getEvents(fighterID=fighterID)
    totalEvents = len(dbList)
    for event in dbList:
        addEvent(event[0], event[1], event[2], event[3], event[4], event[5],
                 event[6], totalEvents)
Exemple #2
0
def allEvents():
    log('Browsing: All events')
    dbList = library.getEvents()
    totalEvents = len(dbList)
    for event in dbList:
        addEvent(event[0], event[1], event[2], event[3], event[4], event[5],
                 event[6], totalEvents)
Exemple #3
0
def getEventsByOrganisation(organisation):
    log('Listing all events for: %s' % organisation)
    dbList = library.getEvents(promotion=organisation)
    totalEvents = len(dbList)
    for event in dbList:
        addEvent(event[0], event[1], event[2], event[3], event[4], event[5],
                 event[6], totalEvents)
Exemple #4
0
def getEvent(eventID):
    event = library.getEvents(eventID=eventID)[0]
    log('Listing video files for event: %s' % event[1])
    thumbPath = os.path.join(__thumbDir__, '%s-poster.jpg' % eventID)
    if not xbmcvfs.exists(thumbPath):
        thumbPath = os.path.join(__promotionDir__,
                                 '%s-poster.jpg' % event[2].replace(' ', ''))
    fanartPath = os.path.join(__thumbDir__, '%s-fanart.jpg' % eventID)
    if not xbmcvfs.exists(fanartPath):
        fanartPath = os.path.join(__promotionDir__,
                                  '%s-fanart.jpg' % event[2].replace(' ', ''))
    outline = '%s: %s, %s' % (event[3], event[4], event[5])
    try:
        description = open(
            os.path.join(__thumbDir__,
                         '%s-description.txt' % event[0])).read()
    except IOError:
        description = outline
    description = description + '\n\n' + event[6]
    fileList = getVideoList(event['path'])
    for vidFile in fileList:
        addLink(linkName=vidFile['title'],
                plotoutline=outline,
                plot=description,
                url=vidFile['path'],
                thumbPath=thumbPath,
                fanartPath=fanartPath,
                genre=event[1],
                tvshowtitle=event[1])
Exemple #5
0
def searchAll():
    log('Searching MMA Library')
    searchStr = getUserInput(title="Search MMA Library")
    if searchStr:
        dbList = library.getEvents(searchStr=searchStr)
        totalEvents = len(dbList)
        dbList2 = library.getFighters(searchStr=searchStr)
        totalFighters = len(dbList2)
        totalListItems = totalEvents + totalFighters
        for event in dbList:
            addEvent(event[0], event[1], event[2], event[3], event[4],
                     event[5], event[6], totalListItems)
        for fighter in dbList2:
            addFighter(fighter[0], fighter[1], fighter[2], fighter[3],
                       fighter[4], fighter[5], fighter[6], fighter[7],
                       fighter[8], fighter[10], totalListItems, fighter[9])