         
         let object = NSManagedObject(entity: entity!, insertIntoManagedObjectContext: managedContext)
         
+        object.setValue(assetId, forKey: "assetId")
         object.setValue(videoURL.lastPathComponent, forKey: "videoFile")
         object.setValue(thumbnailURL.lastPathComponent, forKey: "thumbFile")
         object.setValue(NSDate(), forKey: "openDate")

        
        selectedAsset = asset
        
        PHImageManager().requestAVAssetForVideo(
            asset, options:
            videoRequestOptions,

                self.tableView.reloadData()
                self.viewVideo(video)
            }
        } catch let error  {
            print("Could not save \(error))")
        }
    }
    
