Skip to content

Commit

Permalink
default to "photo" when asset type isn't specified
Browse files Browse the repository at this point in the history
  • Loading branch information
vin047 committed Jun 22, 2021
1 parent b8a140c commit f8ea47f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,10 @@ func createSingleAsset(asset asset, uid string, neoDB *database.Neo4j) (int, err
totalsize = &size
}

if err := validateArgsNotZero([]string{asset.Type}); err != nil {
asset.Type = "photo"
}

err := neoDB.CreateAsset(uid, asset.AssetID, asset.Type, asset.RemotePath, asset.CreateDate, asset.Location, asset.Duration, asset.OriginalUTI, asset.PixelWidth, asset.PixelHeight, asset.Md5, asset.Key, asset.RemotePathOrig, totalsize)
if err != nil {
return http.StatusInternalServerError, err, nil
Expand Down

0 comments on commit f8ea47f

Please sign in to comment.