Skip to content

Commit

Permalink
Merge pull request #669 from SilenceLove/666-限制视频时长依然可被选中
Browse files Browse the repository at this point in the history
fix:#666
  • Loading branch information
SilenceLove authored Apr 20, 2024
2 parents 820194f + 52dc46e commit e1f9aeb
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public extension PhotoPickerListSwipeSelect {
) {
if let indexPath = collectionView.indexPathForItem(at: localPoint),
let photoAsset = getCell(for: indexPath.item)?.photoAsset {
if photoAsset.mediaType == .video &&
pickerController.pickerData.videoDurationExceedsTheLimit(photoAsset) {
return
}
if !pickerController.pickerData.canSelect(photoAsset, isShowHUD: false) && !photoAsset.isSelected {
return
}
Expand Down Expand Up @@ -144,6 +148,10 @@ public extension PhotoPickerListSwipeSelect {
updateCellSelectedTitle()
}else {
if let photoAsset = getCell(for: lastIndex)?.photoAsset {
if photoAsset.mediaType == .video &&
pickerController.pickerData.videoDurationExceedsTheLimit(photoAsset) {
return
}
if !pickerController.pickerData.canSelect(photoAsset, isShowHUD: false) && !photoAsset.isSelected {
return
}
Expand Down Expand Up @@ -228,6 +236,10 @@ public extension PhotoPickerListSwipeSelect {
}
}
let photoAsset = getAsset(for: index)
if photoAsset.mediaType == .video &&
pickerController.pickerData.videoDurationExceedsTheLimit(photoAsset) {
return
}
if swipeSelectState == .select {
if let array = swipeSelectedIndexArray,
!photoAsset.isSelected,
Expand Down

0 comments on commit e1f9aeb

Please sign in to comment.