fix bug when publishing

This commit is contained in:
Niko Storni 2020-01-11 22:01:40 -05:00
parent ef62242f42
commit 93f9185c71
No known key found for this signature in database
GPG key ID: 951CA4715245B535
3 changed files with 20 additions and 3 deletions

View file

@ -204,7 +204,12 @@ func transferVideos(s *Sync) error {
streamUpdateOptions := jsonrpc.StreamUpdateOptions{ streamUpdateOptions := jsonrpc.StreamUpdateOptions{
StreamCreateOptions: &jsonrpc.StreamCreateOptions{ StreamCreateOptions: &jsonrpc.StreamCreateOptions{
ClaimCreateOptions: jsonrpc.ClaimCreateOptions{ClaimAddress: &s.clientPublishAddress}, ClaimCreateOptions: jsonrpc.ClaimCreateOptions{
ClaimAddress: &s.clientPublishAddress,
FundingAccountIDs: []string{
account,
},
},
}, },
Bid: util.PtrToString("0.005"), // Todo - Dont hardcode Bid: util.PtrToString("0.005"), // Todo - Dont hardcode
} }

View file

@ -660,7 +660,8 @@ 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 {
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) log.Debugf("%s: was transferred adn 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)
} }
} }
continue continue
@ -1143,6 +1144,10 @@ func (s *Sync) processVideo(v video) (err error) {
if err != nil { if err != nil {
return err return err
} }
da, err := s.getDefaultAccount()
if err != nil {
return err
}
sp := sources.SyncParams{ sp := sources.SyncParams{
ClaimAddress: s.claimAddress, ClaimAddress: s.claimAddress,
Amount: publishAmount, Amount: publishAmount,
@ -1151,6 +1156,7 @@ func (s *Sync) processVideo(v video) (err error) {
Namer: s.namer, Namer: s.namer,
MaxVideoLength: s.Manager.maxVideoLength, MaxVideoLength: s.Manager.maxVideoLength,
Fee: s.Fee, Fee: s.Fee,
DefaultAccount: da,
} }
summary, err := v.Sync(s.daemon, sp, &sv, videoRequiresUpgrade, s.walletMux) summary, err := v.Sync(s.daemon, sp, &sv, videoRequiresUpgrade, s.walletMux)

View file

@ -367,7 +367,6 @@ func (v *YoutubeVideo) triggerThumbnailSave() (err error) {
func (v *YoutubeVideo) publish(daemon *jsonrpc.Client, params SyncParams) (*SyncSummary, error) { func (v *YoutubeVideo) publish(daemon *jsonrpc.Client, params SyncParams) (*SyncSummary, error) {
languages, locations, tags := v.getMetadata() languages, locations, tags := v.getMetadata()
var fee *jsonrpc.Fee var fee *jsonrpc.Fee
if params.Fee != nil { if params.Fee != nil {
feeAmount, err := decimal.NewFromString(params.Fee.Amount) feeAmount, err := decimal.NewFromString(params.Fee.Amount)
@ -390,6 +389,9 @@ func (v *YoutubeVideo) publish(daemon *jsonrpc.Client, params SyncParams) (*Sync
ThumbnailURL: &v.thumbnailURL, ThumbnailURL: &v.thumbnailURL,
Tags: tags, Tags: tags,
Locations: locations, Locations: locations,
FundingAccountIDs: []string{
params.DefaultAccount,
},
}, },
Fee: fee, Fee: fee,
License: util.PtrToString("Copyrighted (contact publisher)"), License: util.PtrToString("Copyrighted (contact publisher)"),
@ -415,6 +417,7 @@ type SyncParams struct {
Namer *namer.Namer Namer *namer.Namer
MaxVideoLength float64 MaxVideoLength float64
Fee *sdk.Fee Fee *sdk.Fee
DefaultAccount string
} }
func (v *YoutubeVideo) Sync(daemon *jsonrpc.Client, params SyncParams, existingVideoData *sdk.SyncedVideo, reprocess bool, walletLock *sync.RWMutex) (*SyncSummary, error) { func (v *YoutubeVideo) Sync(daemon *jsonrpc.Client, params SyncParams, existingVideoData *sdk.SyncedVideo, reprocess bool, walletLock *sync.RWMutex) (*SyncSummary, error) {
@ -548,6 +551,9 @@ func (v *YoutubeVideo) reprocess(daemon *jsonrpc.Client, params SyncParams, exis
ThumbnailURL: &thumbnailURL, ThumbnailURL: &thumbnailURL,
Languages: languages, Languages: languages,
Locations: locations, Locations: locations,
FundingAccountIDs: []string{
params.DefaultAccount,
},
}, },
Author: util.PtrToString(""), Author: util.PtrToString(""),
License: util.PtrToString("Copyrighted (contact publisher)"), License: util.PtrToString("Copyrighted (contact publisher)"),