diff --git a/manager/manager.go b/manager/manager.go index 02b277f..b08b601 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -2,8 +2,6 @@ package manager import ( "fmt" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" "strings" "syscall" "time" @@ -13,6 +11,9 @@ import ( "github.com/lbryio/lbry.go/extras/errors" "github.com/lbryio/lbry.go/extras/util" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" log "github.com/sirupsen/logrus" ) diff --git a/manager/ytsync.go b/manager/ytsync.go index 026a09b..cf74299 100644 --- a/manager/ytsync.go +++ b/manager/ytsync.go @@ -444,6 +444,7 @@ func (s *Sync) fixDupes(claims []jsonrpc.Claim) (bool, error) { } //updateRemoteDB counts the amount of videos published so far and updates the remote db if some videos weren't marked as published +//additionally it removes all entries in the database indicating that a video is published when it's actually not func (s *Sync) updateRemoteDB(claims []jsonrpc.Claim) (total, fixed, removed int, err error) { count := 0 videoIDMap := make(map[string]string, len(claims)) @@ -581,7 +582,7 @@ func (s *Sync) doSync() error { } if s.LbryChannelName == "@UCBerkeley" { - err = errors.Err("UCB is not supported on this version of YTSYNC") + err = errors.Err("UCB is not supported in this version of YTSYNC") } else { err = s.enqueueYoutubeVideos() } @@ -695,7 +696,7 @@ func (s *Sync) startWorker(workerNum int) { } s.AppendSyncedVideo(v.ID(), false, err.Error(), "") - err = s.Manager.apiConfig.MarkVideoStatus(s.YoutubeChannelID, v.ID(), VideoStatusFailed, existingClaimID, existingClaimName, err.Error(), existingClaimSize, 1) + err = s.Manager.apiConfig.MarkVideoStatus(s.YoutubeChannelID, v.ID(), VideoStatusFailed, existingClaimID, existingClaimName, err.Error(), existingClaimSize, 0) if err != nil { SendErrorToSlack("Failed to mark video on the database: %s", err.Error()) } diff --git a/sdk/api.go b/sdk/api.go index ec861c5..0fef3de 100644 --- a/sdk/api.go +++ b/sdk/api.go @@ -214,7 +214,9 @@ func (a *APIConfig) MarkVideoStatus(channelID string, videoID string, status str vals.Add("published_at", strconv.FormatInt(time.Now().Unix(), 10)) vals.Add("claim_id", claimID) vals.Add("claim_name", claimName) - vals.Add("metadata_version", fmt.Sprintf("%d", metadataVersion)) + if metadataVersion > 0 { + vals.Add("metadata_version", fmt.Sprintf("%d", metadataVersion)) + } if size != nil { vals.Add("size", strconv.FormatInt(*size, 10)) } diff --git a/sources/youtubeVideo.go b/sources/youtubeVideo.go index 5d61cc7..5e96ce7 100644 --- a/sources/youtubeVideo.go +++ b/sources/youtubeVideo.go @@ -471,6 +471,7 @@ func (v *YoutubeVideo) reprocess(daemon *jsonrpc.Client, params SyncParams, exis return nil, errors.Err("the video must be republished as we can't get the right size") } } + v.size = util.PtrToInt64(int64(videoSize)) var fee *jsonrpc.Fee if params.Fee != nil { feeAmount, err := decimal.NewFromString(params.Fee.Amount) diff --git a/tagsManager/tags_mapping.go b/tagsManager/tags_mapping.go index c164cc0..636b2ac 100644 --- a/tagsManager/tags_mapping.go +++ b/tagsManager/tags_mapping.go @@ -145,6 +145,7 @@ const ( Juggling = "UC2fhTIbnQlFYaFzyTcmPkXg" JustJuggling = "UCftqelpjmbFrUwr3VVzzVwA" JordanBPeterson = "UCL_f53ZEJxp8TtlOkHwMV9Q" + DavidPakman = "UCvixJtaXuNdMPUGdOPcY8Ag" ) var channelWideTags = map[string][]string{ @@ -153,6 +154,7 @@ var channelWideTags = map[string][]string{ Juggling: {"juggling", "circus arts", "malabares"}, JustJuggling: {"juggling", "circus arts", "malabares"}, JordanBPeterson: {"postmodernism", "psychology", "news"}, + DavidPakman: {"news"}, } var tagsToSkip = map[string]*struct{}{ "#hangoutsonair": nil,