don't delete lbry first videos from the db

This commit is contained in:
Niko Storni 2020-07-21 13:54:28 -04:00
parent 749d5095c9
commit c2b5878daa
No known key found for this signature in database
GPG key ID: 951CA4715245B535
2 changed files with 7 additions and 2 deletions

View file

@ -656,7 +656,7 @@ func (s *Sync) updateRemoteDB(claims []jsonrpc.Claim, ownClaims []jsonrpc.Claim)
} }
for vID, sv := range s.syncedVideos { for vID, sv := range s.syncedVideos {
if sv.Transferred { if sv.Transferred || sv.IsLbryFirst {
_, ok := allClaimsInfo[vID] _, ok := allClaimsInfo[vID]
if !ok && sv.Published { if !ok && sv.Published {
searchResponse, err := s.daemon.ClaimSearch(nil, &sv.ClaimID, nil, nil, 1, 20) 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) 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 continue //TODO: we should flag these on the db
} else { } 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) //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)
} }
} }

View file

@ -113,6 +113,7 @@ type SyncedVideo struct {
Size int64 `json:"size"` Size int64 `json:"size"`
MetadataVersion int8 `json:"metadata_version"` MetadataVersion int8 `json:"metadata_version"`
Transferred bool `json:"transferred"` Transferred bool `json:"transferred"`
IsLbryFirst bool `json:"is_lbry_first"`
} }
func sanitizeFailureReason(s *string) { func sanitizeFailureReason(s *string) {