From c2b5878daab69cdddd415cd27b2bd12c4c4f0f5f Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Tue, 21 Jul 2020 13:54:28 -0400 Subject: [PATCH] don't delete lbry first videos from the db --- manager/ytsync.go | 8 ++++++-- sdk/api.go | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/manager/ytsync.go b/manager/ytsync.go index f6dbdfe..766092e 100644 --- a/manager/ytsync.go +++ b/manager/ytsync.go @@ -656,7 +656,7 @@ func (s *Sync) updateRemoteDB(claims []jsonrpc.Claim, ownClaims []jsonrpc.Claim) } for vID, sv := range s.syncedVideos { - if sv.Transferred { + if sv.Transferred || sv.IsLbryFirst { _, ok := allClaimsInfo[vID] if !ok && sv.Published { searchResponse, err := s.daemon.ClaimSearch(nil, &sv.ClaimID, nil, nil, 1, 20) @@ -668,7 +668,11 @@ func (s *Sync) updateRemoteDB(claims []jsonrpc.Claim, ownClaims []jsonrpc.Claim) log.Debugf("%s: was transferred but appears abandoned! we should ignore this - claimID: %s", vID, sv.ClaimID) continue //TODO: we should flag these on the db } else { - log.Debugf("%s: was transferred and was then edited! we should ignore this - claimID: %s", vID, sv.ClaimID) + if sv.IsLbryFirst { + log.Debugf("%s: was published using lbry-first so we don't want to do anything here! - claimID: %s", vID, sv.ClaimID) + } else { + log.Debugf("%s: was transferred and was then edited! we should ignore this - claimID: %s", vID, sv.ClaimID) + } //return count, fixed, 0, errors.Err("%s: isn't our control but is on the database and on the blockchain. wtf is up? ClaimID: %s", vID, sv.ClaimID) } } diff --git a/sdk/api.go b/sdk/api.go index e51640c..903229b 100644 --- a/sdk/api.go +++ b/sdk/api.go @@ -113,6 +113,7 @@ type SyncedVideo struct { Size int64 `json:"size"` MetadataVersion int8 `json:"metadata_version"` Transferred bool `json:"transferred"` + IsLbryFirst bool `json:"is_lbry_first"` } func sanitizeFailureReason(s *string) {