Skip to content

Commit

Permalink
Immich Merging Together JPGs and MOVs incorrectly (#556)
Browse files Browse the repository at this point in the history
Fixes #554
  • Loading branch information
simulot authored Dec 3, 2024
1 parent 67b8383 commit 33d6504
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions internal/groups/series/series.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ func sendGroup(ctx context.Context, out chan<- *assets.Asset, outg chan<- *asset
gotJPG := false
gotRAW := false
gotHEIC := false
gotMP4 := false
gotMOV := false

cover := 0
// determine if the group is a burst
for i, a := range as {
gotMP4 = gotMP4 || a.Ext == ".mp4"
gotMOV = gotMOV || a.Ext == ".mov"
gotJPG = gotJPG || a.Ext == ".jpg"
gotRAW = gotRAW || filetypes.IsRawFile(a.Ext)
gotHEIC = gotHEIC || a.Ext == ".heic" || a.Ext == ".heif"
Expand All @@ -79,6 +83,17 @@ func sendGroup(ctx context.Context, out chan<- *assets.Asset, outg chan<- *asset
grouping = assets.GroupByRawJpg
} else if gotJPG && !gotRAW && gotHEIC {
grouping = assets.GroupByHeicJpg
} else if (gotMP4 || gotMOV) && (gotJPG || gotHEIC) {
grouping = assets.GroupByNone
}
}
if grouping == assets.GroupByNone {
for _, a := range as {
select {
case out <- a:
case <-ctx.Done():
return
}
}
}
// check the delay between the two assets, if it's too long, we don't group them
Expand Down

0 comments on commit 33d6504

Please sign in to comment.