Skip to content

Commit

Permalink
* Fixing #346 preserve the order of audio tracks when editing a queue…
Browse files Browse the repository at this point in the history
…d job (thanks to Patrick Bassner)
  • Loading branch information
cdgriffith committed Jul 20, 2022
1 parent a12dd0e commit 4e22f06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Fixing #319 no longer disables built in tracks for profile matching (thanks to Owen Quinlan)
* Fixing #218 and #308 subtitle scaling with rigaya's hardware encoders needs to be scaled for 4K content (thanks to wynterca)
* Fixing #350 subtitle burn in quoting (thanks to Maddie Davis)
* Fixing #346 preserve the order of audio tracks when editing a queued job (thanks to Patrick Bassner)
* Fixing Chinese translations (thanks to leonardyan)

## Version 4.9.4
Expand Down
10 changes: 7 additions & 3 deletions fastflix/widgets/panels/audio_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,12 @@ def reload(self, original_tracks: List[AudioTrack], audio_formats):
all_info=x,
disable_dup=disable_dups,
)
self.tracks.append(new_item)

self.tracks.sort(key=lambda z: (int(not z.original), z.index))
for idx, tk in enumerate(self.tracks):
if tk.index > new_item.index:
print(f"Inserting at {idx}")
self.tracks.insert(idx, new_item)
break
else:
self.tracks.append(new_item)

super()._new_source(self.tracks)

0 comments on commit 4e22f06

Please sign in to comment.