DDRecorder icon indicating copy to clipboard operation
DDRecorder copied to clipboard

Add Dev Container and Fix Bug

Open Hugozys opened this issue 3 years ago • 0 comments

  • Added dev container configuration to ease develpment process
  • Fixed a bug in uploader code

According to Processor.py - Line198, clip file has the following format:

{self.room_id}_{self.global_start.strftime('%Y-%m-%d_%H-%M-%S')}_{hours:02}-{minutes:02}-{seconds:02}_{outhint}.mp4"

When uploading clips, we sort the files in output directory before uploading each of them:

filelists.sort(key=lambda x: int(
                    os.path.splitext(x)[0].split("_")[-2]))

It will throw exception at runtime because the integer conversion is invalid. For example, given file name: 12345_2022-08-12_19-40-47_20-05-06_弹幕.mp4

os.path.split(x)[0].split("_")[-2] => "20-05-06"

will cause exception when we do a integer conversion

"".join(os.path.splitext(x)[0].split("_")[-2].split("-")) =>"200506"

will be a valid integer with the correct order.

Hugozys avatar Aug 12 '22 23:08 Hugozys