def run(self): publisher = ZmqPublisher.get_instance() call(['youtube-dl', '-f', 'mp4', '-o', self.location, self.uri]) with db.conn(settings['database']) as conn: update(conn, self.asset_id, {'asset_id': self.asset_id, 'is_processing': 0}) publisher.send_to_ws_server(self.asset_id)
def test_create_update_read_asset_utf8(self): assets_helper.create(self.conn, asset_w) asset_w_ = asset_w.copy() asset_w_.update(**asset_w_diff) assets_helper.update(self.conn, asset_w['asset_id'], asset_w_) should_be_w_ = assets_helper.read(self.conn) self.assertEqual([asset_w_], should_be_w_)
def playlist_order(): "Receive a list of asset_ids in the order they should be in the playlist" for play_order, asset_id in enumerate( request.POST.get('ids', '').split(',')): assets_helper.update(db_conn, asset_id, { 'asset_id': asset_id, 'play_order': play_order })
def test_create_update_read_asset(self): assets_helper.create(self.conn, asset_x) asset_x_ = asset_x.copy() asset_x_.update(**asset_x_diff) assets_helper.update(self.conn, asset_x['asset_id'], asset_x_) assets_helper.create(self.conn, asset_y) asset_y_ = asset_y.copy() asset_y_.update(**asset_y_diff) assets_helper.update(self.conn, asset_y['asset_id'], asset_y_) should_be_y__x_ = assets_helper.read(self.conn) self.assertEqual([asset_y_, asset_x_], should_be_y__x_)
def edit_asset(asset_id): return assets_helper.update(db_conn, asset_id, prepare_asset(request))
def playlist_order(): "Receive a list of asset_ids in the order they should be in the playlist" for play_order, asset_id in enumerate(request.POST.get('ids', '').split(',')): assets_helper.update(db_conn, asset_id, {'asset_id': asset_id, 'play_order': play_order})
def playlist_order(): "Receive a list of asset_ids in the order they should be in the playlist" for play_order, asset_id in enumerate(request.POST.get("ids", "").split(",")): assets_helper.update(db_conn, asset_id, {"asset_id": asset_id, "play_order": play_order})