Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3f40c41ef | ||
|
|
05b65c4cb5 | ||
|
|
69ad13848b | ||
|
|
e496ad670a | ||
|
|
9d8eb32f9f |
No files matched your search
+4
-4
@@ -90,12 +90,12 @@ func (s *Sync) walletSetup() error {
|
||||
}
|
||||
s.syncedVideosMux.RUnlock()
|
||||
|
||||
log.Debugf("We already allocated credits for %d videos", publishedCount)
|
||||
log.Debugf("We already allocated credits for %d published videos and %d failed videos", publishedCount, failedCount)
|
||||
|
||||
if videosOnYoutube > s.Manager.videosLimit {
|
||||
videosOnYoutube = s.Manager.videosLimit
|
||||
}
|
||||
unallocatedVideos := videosOnYoutube - publishedCount
|
||||
unallocatedVideos := videosOnYoutube - (publishedCount + failedCount)
|
||||
requiredBalance := float64(unallocatedVideos)*(publishAmount+estimatedMaxTxFee) + channelClaimAmount
|
||||
if s.Manager.upgradeMetadata {
|
||||
requiredBalance += float64(notUpgradedCount) * 0.001
|
||||
@@ -103,7 +103,7 @@ func (s *Sync) walletSetup() error {
|
||||
|
||||
refillAmount := 0.0
|
||||
if balance < requiredBalance || balance < minimumAccountBalance {
|
||||
refillAmount = math.Max(requiredBalance-requiredBalance, minimumRefillAmount)
|
||||
refillAmount = math.Max(requiredBalance-balance, minimumRefillAmount)
|
||||
}
|
||||
|
||||
if s.Refill > 0 {
|
||||
@@ -169,7 +169,7 @@ func (s *Sync) ensureEnoughUTXOs() error {
|
||||
|
||||
for _, utxo := range *utxolist {
|
||||
amount, _ := strconv.ParseFloat(utxo.Amount, 64)
|
||||
if !utxo.IsClaim && !utxo.IsSupport && !utxo.IsUpdate && amount != 0.0 {
|
||||
if !utxo.IsClaim && !utxo.IsSupport && !utxo.IsUpdate && amount > 0.001 {
|
||||
count++
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -480,7 +480,7 @@ func (s *Sync) updateRemoteDB(claims []jsonrpc.Claim) (total, fixed, removed int
|
||||
if claimIDDiffers {
|
||||
log.Debugf("%s: Mismatch in database for claimID. DB: %s - Blockchain: %s", videoID, pv.ClaimID, c.ClaimID)
|
||||
}
|
||||
if claimIDDiffers {
|
||||
if claimNameDiffers {
|
||||
log.Debugf("%s: Mismatch in database for claimName. DB: %s - Blockchain: %s", videoID, pv.ClaimName, c.Name)
|
||||
}
|
||||
if claimMarkedUnpublished {
|
||||
@@ -675,6 +675,7 @@ func (s *Sync) startWorker(workerNum int) {
|
||||
"Watch this video on YouTube.",
|
||||
"have blocked it on copyright grounds",
|
||||
"the video must be republished as we can't get the right size",
|
||||
"Invalid status code: 403",
|
||||
}
|
||||
if strings.Contains(err.Error(), "txn-mempool-conflict") ||
|
||||
strings.Contains(err.Error(), "too-long-mempool-chain") {
|
||||
|
||||
@@ -71,6 +71,8 @@ func SanitizeTags(tags []string, youtubeChannelID string) ([]string, error) {
|
||||
return sanitizedTags, nil
|
||||
}
|
||||
|
||||
const TagMaxLength = 255
|
||||
|
||||
func normalizeTag(t string) (string, error) {
|
||||
t = strings.ToLower(t)
|
||||
multipleSpaces := regexp.MustCompile(`\s{2,}`)
|
||||
@@ -87,7 +89,10 @@ func normalizeTag(t string) (string, error) {
|
||||
if weirdChars.MatchString(t) {
|
||||
log.Debugf("tag '%s' has weird stuff in it, skipping\n", t)
|
||||
return "", nil
|
||||
|
||||
}
|
||||
if len(t) > TagMaxLength {
|
||||
log.Debugf("tag '%s' is too long, skipping\n", t)
|
||||
return "", nil
|
||||
}
|
||||
return t, nil
|
||||
}
|
||||
|
||||
+5
-4
@@ -61,10 +61,11 @@ func (u *thumbnailUploader) uploadThumbnail() error {
|
||||
uploader := s3manager.NewUploader(s3Session)
|
||||
|
||||
_, err = uploader.Upload(&s3manager.UploadInput{
|
||||
Bucket: aws.String("thumbnails.lbry.com"),
|
||||
Key: key,
|
||||
Body: thumb,
|
||||
ACL: aws.String("public-read"),
|
||||
Bucket: aws.String("thumbnails.lbry.com"),
|
||||
Key: key,
|
||||
Body: thumb,
|
||||
ACL: aws.String("public-read"),
|
||||
ContentType: aws.String("image/jpeg"),
|
||||
})
|
||||
u.mirroredUrl = ThumbnailEndpoint + u.name
|
||||
return errors.Err(err)
|
||||
|
||||
Reference in new issue
Block a user