Fixed bug where file indices were incorrectly assigned

This commit is contained in:
Isaac Abadi
2020-12-28 00:22:14 -05:00
parent 085849c7ee
commit ea959547fd

View File

@@ -127,12 +127,12 @@ export class RecentVideosComponent implements OnInit {
this.normal_files_received = false;
this.postsService.getAllFiles().subscribe(res => {
this.files = res['files'];
this.files.sort(this.sortFiles);
for (let i = 0; i < this.files.length; i++) {
const file = this.files[i];
file.duration = typeof file.duration !== 'string' ? file.duration : this.durationStringToNumber(file.duration);
file.index = i;
}
this.files.sort(this.sortFiles);
if (this.search_mode) {
this.filterFiles(this.search_text);
} else {