예제 #1
0
파일: mobile.py 프로젝트: imro2/maraschino
def couchpotato_movie(id):
    try:
        couchpotato = couchpotato_api('media.get', 'id=%s' % id)
        if couchpotato['success']:
            couchpotato = couchpotato['media']
        
        profiles = couchpotato_api('profile.list')

    except Exception as e:
        logger.log('Mobile :: CouchPotato :: Could not retrieve movie - %s]' % (e), 'WARNING')

    return render_template('mobile/couchpotato/movie.html',
        movie=couchpotato,
        profiles=profiles
    )
예제 #2
0
def couchpotato_movie(id):
    try:
        couchpotato = couchpotato_api('media.get', 'id=%s' % id)
        if couchpotato['success']:
            couchpotato = couchpotato['media']

        profiles = couchpotato_api('profile.list')

    except Exception as e:
        logger.log(
            'Mobile :: CouchPotato :: Could not retrieve movie - %s]' % (e),
            'WARNING')

    return render_template('mobile/couchpotato/movie.html',
                           movie=couchpotato,
                           profiles=profiles)
예제 #3
0
def couchpotato_all():
    try:
        couchpotato = couchpotato_api('movie.list', params='status=done')

    except Exception as e:
        logger.log('Mobile :: CouchPotato :: Could not retrieve Couchpotato - %s]' % (e), 'WARNING')
        couchpotato = None

    return render_template('mobile/couchpotato/all.html',
        all=couchpotato['movies'],
    )
예제 #4
0
def couchpotato():
    try:
        couchpotato = couchpotato_api('movie.list', params='status=active')
        print couchpotato

    except Exception as e:
        logger.log('Mobile :: CouchPotato :: Could not retrieve Couchpotato - %s]' % (e), 'WARNING')
        couchpotato = None

    return render_template('mobile/couchpotato/wanted.html',
        wanted=couchpotato['movies']
    )
예제 #5
0
def couchpotato():
    try:
        couchpotato = couchpotato_api('movie.list', params='status=active')
        print couchpotato

    except Exception as e:
        logger.log(
            'Mobile :: CouchPotato :: Could not retrieve Couchpotato - %s]' %
            (e), 'WARNING')
        couchpotato = None

    return render_template('mobile/couchpotato/wanted.html',
                           wanted=couchpotato['movies'])
예제 #6
0
def couchpotato():
    try:
        couchpotato = couchpotato_api('movie.list', params=False)
        if couchpotato['success'] and not couchpotato['empty']:
            couchpotato = couchpotato['movies']

    except Exception as e:
        logger.log('Mobile :: CouchPotato :: Could not retrieve Couchpotato - %s]' % (e), 'WARNING')
        couchpotato = None

    return render_template('mobile/couchpotato/wanted.html',
        wanted=couchpotato,
    )
예제 #7
0
def couchpotato_all():
    try:
        couchpotato = couchpotato_api('movie.list', params='status=done')
        if couchpotato['success'] and not couchpotato['empty']:
            couchpotato = couchpotato['movies']

    except Exception as e:
        logger.log('Mobile :: CouchPotato :: Could not retrieve Couchpotato - %s]' % (e), 'WARNING')
        couchpotato = None

    return render_template('mobile/couchpotato/all.html',
        all=couchpotato,
    )
예제 #8
0
def couchpotato_all():
    try:
        couchpotato = couchpotato_api('movie.list', params='status=done')
        if couchpotato['success'] and not couchpotato['empty']:
            couchpotato = couchpotato['movies']

    except Exception as e:
        logger.log('Mobile :: CouchPotato :: Could not retrieve Couchpotato - %s]' % (e), 'WARNING')
        couchpotato = None

    return render_template('mobile/couchpotato/all.html',
        all=couchpotato,
        webroot=maraschino.WEBROOT,
    )
예제 #9
0
def couchpotato_search(query=None):
    couchpotato = None
    if query:
        try:
            couchpotato = couchpotato_api('movie.search', params='q=%s' % query)
            if couchpotato['success']:
                couchpotato = couchpotato['movie']

        except Exception as e:
            logger.log('Mobile :: CouchPotato :: Could not retrieve movie - %s]' % (e), 'WARNING')

    return render_template('mobile/couchpotato/search.html',
        results=couchpotato,
        query=query,
    )
예제 #10
0
def couchpotato_search(query=None):
    couchpotato = None
    if query:
        try:
            couchpotato = couchpotato_api('movie.search', params='q=%s' % query)
            if couchpotato['success']:
                couchpotato = couchpotato['movie']

        except Exception as e:
            logger.log('Mobile :: CouchPotato :: Could not retrieve movie - %s]' % (e), 'WARNING')

    return render_template('mobile/couchpotato/search.html',
        results=couchpotato,
        query=query,
    )
예제 #11
0
def couchpotato():
    try:
        couchpotato = couchpotato_api('movie.list', params=False)
        if couchpotato['success'] and not couchpotato['empty']:
            couchpotato = couchpotato['movies']

    except Exception as e:
        logger.log(
            'Mobile :: CouchPotato :: Could not retrieve Couchpotato - %s]' %
            (e), 'WARNING')
        couchpotato = None

    return render_template(
        'mobile/couchpotato/wanted.html',
        wanted=couchpotato,
        webroot=maraschino.WEBROOT,
    )
예제 #12
0
def couchpotato_history():
    unread = 0
    try:
        couchpotato = couchpotato_api('notification.list')
        if couchpotato['success'] and not couchpotato['empty']:
            couchpotato = couchpotato['notifications']
            for notification in couchpotato:
                if not notification['read']:
                    unread = unread + 1

    except Exception as e:
        logger.log('Mobile :: CouchPotato :: Could not retrieve Couchpotato - %s]' % (e), 'WARNING')
        couchpotato = None

    return render_template('mobile/couchpotato/history.html',
        history=couchpotato,
        unread=unread,
    )
예제 #13
0
def couchpotato_history():
    unread = 0
    try:
        couchpotato = couchpotato_api('notification.list')
        if couchpotato['success'] and not couchpotato['empty']:
            couchpotato = couchpotato['notifications']
            for notification in couchpotato:
                if not notification['read']:
                    unread = unread + 1

    except Exception as e:
        logger.log('Mobile :: CouchPotato :: Could not retrieve Couchpotato - %s]' % (e), 'WARNING')
        couchpotato = None

    return render_template('mobile/couchpotato/history.html',
        history=couchpotato,
        unread=unread,
    )