Transcoding queue still doesn't publish videos correctly
I can't find the old issue so I'm opening a new one.
Video publishing is still heavily delayed until the queue is finished. If I have 100 videos queued for transcoding they will either randomly appear or not appear at all until that queue is finished.. which means if users are actively uploading videos consistently they may not appear for several days depending on the queue size.
If I manually go into one of the videos it says its still being transcoded. But when I click on the download option the transcoded (AV1) video is there. It can play just fine and the audio works. But it's still stuck in transcoding limbo until the queue is finished.

Using NodeJS 16 and peertube 4.1.1 and transcoding-profile-debug plugin.
Forgot to mention my instance currently only encodes in 1080p, so it's not waiting on lower resolution transcodes for the videos.
The instance is private, but the url is vidbin.org. These are just some youtube imports I'm using to test this out. This shows up once the video-transcoding job has finished (job 191/161).
{"level":"info","message":"Creating torrent /var/www/peertube/storage/torrents/3b5e69eb-f1c7-43d8-a19d-d72d1bffc0b9-1080.torrent.","label":"vidbin.org:443","timestamp":"2022-05-09T13:53:24.263Z"}
{"level":"info","message":"Optimize transcoding job for 1ab38542-2e2b-4a10-a644-b6995249386c ended.","label":"vidbin.org:443","tags":["transcoding","1ab38542-2e2b-4a10-a644-b6995249386c"],"timestamp":"2022-05-09T13:53:24.277Z"}
{"level":"info","message":"No transcoding jobs created for video 1ab38542-2e2b-4a10-a644-b6995249386c (no resolutions).","label":"vidbin.org:443","tags":["transcoding","1ab38542-2e2b-4a10-a644-b6995249386c"],"timestamp":"2022-05-09T13:53:24.333Z"}
{"level":"info","message":"Processing transcoding job 192.","label":"vidbin.org:443","tags":["transcoding","fc07f92a-16f8-4b2c-b828-29ad64114846"],"timestamp":"2022-05-09T13:53:24.336Z"}
{"level":"info","message":"Handling optimize transcoding job for fc07f92a-16f8-4b2c-b828-29ad64114846.","label":"vidbin.org:443","tags":["transcoding","fc07f92a-16f8-4b2c-b828-29ad64114846"],"timestamp":"2022-05-09T13:53:24.343Z"}
As per the image below the transcoding job is marked as completed while the video remains in the transcoding state until the queue has finished.

If I had to take a wild guess the issue is occurring when converting the video from webtorrent to HLS in the system since when the video works/is published it's marked as HLS under videos/list and when its not working its marked as webtorrent.
Actually that's exactly whats happening the new-resolution-hls jobs are added to the top of the queue and dont get processed until the end.