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 )
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)
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'], )
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'] )
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'])
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, )
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, )
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, )
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, )
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, )
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, )