2019-08-11 04:50:43 +02:00
#!/usr/bin/env bash
set -e
#Add a ytsync user
ADDYTSYNCUSER = 'INSERT INTO user (given_name) VALUE("ytsync user")'
mysql -u lbry -plbry -D lbry -h "127.0.0.1" -P 15500 -e " $ADDYTSYNCUSER "
#Insert an auth token for the user to be used by ytsync
ADDYTSYNCAUTHTOKEN = 'INSERT INTO auth_token (user_id, value) VALUE(1,"ytsyntoken")'
mysql -u lbry -plbry -D lbry -h "127.0.0.1" -P 15500 -e " $ADDYTSYNCAUTHTOKEN "
#Give priveledges to ytsync user
ASSIGNGROOP = 'INSERT INTO user_groop (user_id, groop_id) VALUE( 1,3)'
mysql -u lbry -plbry -D lbry -h "127.0.0.1" -P 15500 -e " $ASSIGNGROOP "
#Add youtuber to sync
ADDYTSYNCER = 'INSERT INTO user (given_name) VALUE("youtuber")'
mysql -u lbry -plbry -D lbry -h "127.0.0.1" -P 15500 -e " $ADDYTSYNCER "
2019-08-16 05:34:25 +02:00
#Insert an auth token for the youtuber to be used by ytsync
ADDYTSYNCAUTHTOKEN = 'INSERT INTO auth_token (user_id, value) VALUE(2,"youtubertoken")'
mysql -u lbry -plbry -D lbry -h "127.0.0.1" -P 15500 -e " $ADDYTSYNCAUTHTOKEN "
2019-08-11 04:50:43 +02:00
#Add their youtube channel to be synced
2020-10-07 03:10:54 +02:00
ADDYTCHANNEL = " INSERT INTO youtube_data (user_id, status_token,desired_lbry_channel,channel_id,channel_name,status,created_at,source,total_videos,total_subscribers,should_sync,redeemable,total_views,reviewed,last_uploaded_video,length_limit,size_limit,reward_amount,reward_expiration)
2021-03-15 22:50:23 +01:00
VALUE( 2,'3qzGyuVjQaf7t4pKKu2Er1NRW2LJkeWw' ,'$1' ,'$2' ,'СтопХам' ,'queued' ,'2019-08-01 00:00:00' ,'sync' ,1000,1000,1,1,10000,1,'$3' ,60,2048,0,'2019-08-01 00:00:00' ) "
2021-03-04 03:04:52 +01:00
mysql -u lbry -plbry -D lbry -h "127.0.0.1" --default-character-set= utf8 -P 15500 -e " $ADDYTCHANNEL "