Skip to content

Commit

Permalink
When no related field, handle as a delete story package request.
Browse files Browse the repository at this point in the history
  • Loading branch information
iulianp26 committed May 8, 2017
1 parent 9dcdbfc commit 55a3b62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
4 changes: 3 additions & 1 deletion mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ func (m *relatedContentMapper) mapRelatedContent() ([]byte, string, error) {
}

relatedItems := m.retrieveRelatedItems(relatedItemsArray, videoUUID)
cc = m.newContentCollection(collectionContainerUUID, relatedItems)
if len(relatedItems) > 0 {
cc = m.newContentCollection(collectionContainerUUID, relatedItems)
}
}

mc := m.newMappedContent(collectionContainerUUID, cc)
Expand Down
19 changes: 9 additions & 10 deletions queuehandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,16 @@ func getBytes(fileName string, t *testing.T) []byte {

func newStringMappedContent(t *testing.T, itemUUID string, tid string, msgDate string) string {
ccUUID := NewNameUUIDFromBytes([]byte(videoUUID)).String()
var items []Item
var cc ContentCollection
if itemUUID != "" {
items = []Item{{itemUUID}}
}

cc := ContentCollection{
UUID: ccUUID,
Items: items,
PublishReference: tid,
LastModified: msgDate,
CollectionType: collectionType,
items := []Item{{itemUUID}}
cc = ContentCollection{
UUID: ccUUID,
Items: items,
PublishReference: tid,
LastModified: msgDate,
CollectionType: collectionType,
}
}

mc := MappedContent{
Expand Down

0 comments on commit 55a3b62

Please sign in to comment.