Skip to content

Commit

Permalink
Merge pull request #22 from justinfx/21_FindSequencesInList
Browse files Browse the repository at this point in the history
Prevent omission of frame range on ambiguous single item frame range
  • Loading branch information
justinfx authored Mar 20, 2022
2 parents 7aa08e0 + 6acaf31 commit 19b8300
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions fileseq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ func TestFindSequencesInList(t *testing.T) {
{
Name: "ambiguous single files",
Paths: []string{
"/path/to/complex_name_15-14-56-14.ext",
"/path/to/single/123",
"/path/to/single/123.ext",
"/path/to/single/file0001.ext",
Expand All @@ -829,6 +830,7 @@ func TestFindSequencesInList(t *testing.T) {
},
Opts: []FileOption{SingleFiles},
Expect: []string{
"/path/to/complex_name_15-14-56-14@@@.ext",
"/path/to/single/123@@@",
"/path/to/single/123@@@.ext",
"/path/to/single/file1#.ext",
Expand All @@ -839,13 +841,15 @@ func TestFindSequencesInList(t *testing.T) {
{
Name: "ambiguous single files disabled",
Paths: []string{
"/path/to/complex_name_15-14-56-14.ext",
"/path/to/single/123",
"/path/to/single/123.ext",
"/path/to/single/file0001.ext",
"/path/to/single/file.ext12345",
"/path/to/single/file.ext12345z",
},
Expect: []string{
"/path/to/complex_name_15-14-56-14@@@.ext",
"/path/to/single/123@@@.ext",
"/path/to/single/file1#.ext",
},
Expand Down
10 changes: 9 additions & 1 deletion sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,17 @@ func findSequencesInList(paths []*fileItem, opts ...FileOption) (FileSequences,
if err != nil {
return err
}
if pad == "" {

// Always use the previously parsed basename, range, and ext
fs.basename = baseName
fs.ext = ext
if frange == "" {
fs.SetFrameSet(nil)
fs.SetPadding("")
} else {
fs.SetFrameRange(frange)
}

fseqs = append(fseqs, fs)

buf.Reset()
Expand Down

0 comments on commit 19b8300

Please sign in to comment.