Skip to content

Commit 5ad7f63

Browse files
committed
Live Photos: Require video type MOV as sidecar for HEIC and JPEG photoprism#5089
Signed-off-by: Michael Mayer <michael@photoprism.app>
1 parent cedc879 commit 5ad7f63

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/photoprism/mediafile.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,16 +390,16 @@ func (m *MediaFile) RelPath(directory string) string {
390390
pathname := m.fileName
391391

392392
if i := strings.Index(pathname, directory); i == 0 {
393-
if i := strings.LastIndex(directory, string(os.PathSeparator)); i == len(directory)-1 {
393+
if i = strings.LastIndex(directory, string(os.PathSeparator)); i == len(directory)-1 {
394394
pathname = pathname[len(directory):]
395-
} else if i := strings.LastIndex(directory, string(os.PathSeparator)); i != len(directory) {
395+
} else if i = strings.LastIndex(directory, string(os.PathSeparator)); i != len(directory) {
396396
pathname = pathname[len(directory)+1:]
397397
}
398398
}
399399

400400
if end := strings.LastIndex(pathname, string(os.PathSeparator)); end != -1 {
401401
pathname = pathname[:end]
402-
} else if end := strings.LastIndex(pathname, string(os.PathSeparator)); end == -1 {
402+
} else if end = strings.LastIndex(pathname, string(os.PathSeparator)); end == -1 {
403403
pathname = ""
404404
}
405405

@@ -1068,7 +1068,7 @@ func (m *MediaFile) IsLive() bool {
10681068
return false
10691069
}
10701070

1071-
if m.IsVideo() {
1071+
if m.HasFileType(fs.VideoMov) {
10721072
if fs.ImageHeic.FindFirst(m.FileName(), []string{}, Config().OriginalsPath(), false) != "" ||
10731073
fs.ImageJpeg.FindFirst(m.FileName(), []string{}, Config().OriginalsPath(), false) != "" {
10741074
return true

0 commit comments

Comments
 (0)