コード例 #1
0
ファイル: utils.py プロジェクト: w1nterl0ng/screenly-ose
    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)
コード例 #2
0
    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_)
コード例 #3
0
ファイル: server_test.py プロジェクト: Geo-Joy/screenly-ose
    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_)
コード例 #4
0
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
        })
コード例 #5
0
    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_)
コード例 #6
0
ファイル: server_test.py プロジェクト: amit1870/ridsc
    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_)
コード例 #7
0
def edit_asset(asset_id):
    return assets_helper.update(db_conn, asset_id, prepare_asset(request))
コード例 #8
0
ファイル: server.py プロジェクト: Geo-Joy/sync-pi-ose
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})
コード例 #9
0
ファイル: server.py プロジェクト: Geo-Joy/sync-pi-ose
def edit_asset(asset_id):
    return assets_helper.update(db_conn, asset_id, prepare_asset(request))
コード例 #10
0
ファイル: server.py プロジェクト: richard-to/screenly-ose
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})