fix description not containing youtube link
add workaround to SDK bug not spending the right UTXOs fix bug in assignments
This commit is contained in:
parent
e893f68bc1
commit
6668840b11
3 changed files with 17 additions and 8 deletions
|
@ -676,18 +676,27 @@ func (s *Sync) startWorker(workerNum int) {
|
|||
"have blocked it on copyright grounds",
|
||||
"the video must be republished as we can't get the right size",
|
||||
}
|
||||
if util.SubstringInSlice(err.Error(), errorsNoRetry) {
|
||||
if strings.Contains(err.Error(), "txn-mempool-conflict") ||
|
||||
strings.Contains(err.Error(), "too-long-mempool-chain") {
|
||||
log.Println("waiting for a block before retrying")
|
||||
err := s.waitForNewBlock()
|
||||
if err != nil {
|
||||
s.grp.Stop()
|
||||
SendErrorToSlack("something went wrong while waiting for a block: %v", err)
|
||||
break
|
||||
}
|
||||
} else if util.SubstringInSlice(err.Error(), errorsNoRetry) {
|
||||
log.Println("This error should not be retried at all")
|
||||
} else if tryCount < s.MaxTries {
|
||||
if util.SubstringInSlice(err.Error(), []string{
|
||||
"Not enough funds to cover this transaction",
|
||||
"failed: Not enough funds",
|
||||
"Error in daemon: Insufficient funds, please deposit additional LBC",
|
||||
"txn-mempool-conflict",
|
||||
"too-long-mempool-chain",
|
||||
// "txn-mempool-conflict", //TODO: uncomment the two lines when the SDK will start spending confirmed UTXOs before failing
|
||||
//"too-long-mempool-chain",
|
||||
}) {
|
||||
log.Println("checking funds and UTXOs before retrying...")
|
||||
err = s.walletSetup()
|
||||
err := s.walletSetup()
|
||||
if err != nil {
|
||||
s.grp.Stop()
|
||||
SendErrorToSlack("failed to setup the wallet for a refill: %v", err)
|
||||
|
|
|
@ -162,14 +162,14 @@ func (v *YoutubeVideo) getFullPath() string {
|
|||
func (v *YoutubeVideo) getAbbrevDescription() string {
|
||||
maxLines := 10
|
||||
description := strings.TrimSpace(v.description)
|
||||
if strings.Count(description, "\n") < maxLines {
|
||||
return description
|
||||
}
|
||||
additionalDescription := "\nhttps://www.youtube.com/watch?v=" + v.id
|
||||
khanAcademyClaimID := "5fc52291980268b82413ca4c0ace1b8d749f3ffb"
|
||||
if v.lbryChannelID == khanAcademyClaimID {
|
||||
additionalDescription = additionalDescription + "\nNote: All Khan Academy content is available for free at (www.khanacademy.org)"
|
||||
}
|
||||
if strings.Count(description, "\n") < maxLines {
|
||||
return description + "\n..." + additionalDescription
|
||||
}
|
||||
return strings.Join(strings.Split(description, "\n")[:maxLines], "\n") + "\n..." + additionalDescription
|
||||
}
|
||||
|
||||
|
|
|
@ -488,7 +488,7 @@ var channelWideTags = map[string][]string{
|
|||
shogogarcia: {"learning"},
|
||||
alphalifestyleacademy: {"learning"},
|
||||
NileRed: {"learning", "science"},
|
||||
veritasium: {"learning"},
|
||||
veritasium: {"learning", "science"},
|
||||
stevecronin: {"learning"},
|
||||
jeranism: {"learning"},
|
||||
MinutePhysics: {"learning", "science"},
|
||||
|
|
Loading…
Reference in a new issue