diff --git a/manager/manager.go b/manager/manager.go index a337424..91116bc 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -168,8 +168,9 @@ func (s *SyncManager) Start() error { } for i, c := range channels { log.Infof("There are %d channels in the \"%s\" queue", len(channels)-i, q) + maxVideoLength := s.maxVideoLength if c.TotalSubscribers < 1000 { - s.maxVideoLength = 1.0 + maxVideoLength = 1.0 } syncs = append(syncs, Sync{ APIConfig: s.apiConfig, @@ -178,6 +179,7 @@ func (s *SyncManager) Start() error { lbryChannelID: c.ChannelClaimID, MaxTries: s.maxTries, ConcurrentVideos: s.concurrentVideos, + MaxVideoLength: maxVideoLength, Refill: s.refill, Manager: s, LbrycrdString: s.lbrycrdString, diff --git a/manager/ytsync.go b/manager/ytsync.go index 8428947..705df62 100644 --- a/manager/ytsync.go +++ b/manager/ytsync.go @@ -91,6 +91,7 @@ type Sync struct { clientPublishAddress string publicKey string defaultAccountID string + MaxVideoLength float64 } func (s *Sync) AppendSyncedVideo(videoID string, published bool, failureReason string, claimName string, claimID string, metadataVersion int8, size int64) { @@ -979,6 +980,8 @@ func (s *Sync) startWorker(workerNum int) { } } +var mostRecentlyFailedChannel string + func (s *Sync) enqueueYoutubeVideos() error { client := &http.Client{ Transport: &transport.APIKey{Key: s.APIConfig.YoutubeAPIKey}, @@ -1033,6 +1036,10 @@ func (s *Sync) enqueueYoutubeVideos() error { if youtubeIsLying { break } + if s.YoutubeChannelID == mostRecentlyFailedChannel { + return errors.Err("playlist items not found") + } + mostRecentlyFailedChannel = s.YoutubeChannelID break //return errors.Err("playlist items not found") //TODO: will this work? } videoIDs := make([]string, 50) @@ -1158,7 +1165,7 @@ func (s *Sync) processVideo(v video) (err error) { ChannelID: s.lbryChannelID, MaxVideoSize: s.Manager.maxVideoSize, Namer: s.namer, - MaxVideoLength: s.Manager.maxVideoLength, + MaxVideoLength: s.MaxVideoLength, Fee: s.Fee, DefaultAccount: da, } diff --git a/util/util.go b/util/util.go index 7248c91..bbe8ec2 100644 --- a/util/util.go +++ b/util/util.go @@ -253,7 +253,7 @@ func CleanupLbrynet() error { } return errors.Err(err) } - dbSizeLimit := int64(2 * 1024 * 1024 * 1024) + dbSizeLimit := int64(1 * 1024 * 1024 * 1024) if db.Size() > dbSizeLimit { files, err := filepath.Glob(lbryumDir + "/blockchain.db*") if err != nil {