player: fix linter

This commit is contained in:
Nikita Galaiko 2023-03-24 13:36:19 +01:00
parent fa8f95f705
commit 6ff78b8cf7

View File

@ -130,14 +130,14 @@
}); });
// get the session chapters that are in the current day // get the session chapters that are in the current day
let dayChapters = Object.entries(sessionChapters) let dayChapters = Object.values(sessionChapters)
.filter(([sid, chapter]) => { .filter((chapter) => {
let chapterDay = dateToYmd(new Date(chapter.firstDeltaTimestampMs)); let chapterDay = dateToYmd(new Date(chapter.firstDeltaTimestampMs));
return chapterDay === $currentDay; return chapterDay === $currentDay;
}) })
// filter to chapters with more than 0 files // filter to chapters with more than 0 files
.filter(([, chapter]) => Object.keys(chapter.files).length > 0) .filter((chapter) => Object.keys(chapter.files).length > 0)
.map(([, chapter]) => chapter) .map((chapter) => chapter)
.sort((a, b) => a.firstDeltaTimestampMs - b.firstDeltaTimestampMs); .sort((a, b) => a.firstDeltaTimestampMs - b.firstDeltaTimestampMs);
// process the playlist metadata // process the playlist metadata
@ -148,7 +148,7 @@
projectId: data.projectId, projectId: data.projectId,
sessionId: sid sessionId: sid
}).then((files) => { }).then((files) => {
Object.entries(sessionFiles[sid] ?? {}).forEach(([filepath, _]) => { Object.keys(sessionFiles[sid] ?? {}).forEach((filepath) => {
if (files[filepath] !== undefined) { if (files[filepath] !== undefined) {
sessionFiles[sid][filepath] = files[filepath]; sessionFiles[sid][filepath] = files[filepath];
} }
@ -442,7 +442,7 @@
</div> </div>
</div> </div>
<div class="rounded-b bg-zinc-800 p-2 pb-3"> <div class="rounded-b bg-zinc-800 p-2 pb-3">
{#each Object.entries(chapter.files) as [filenm, changes]} {#each Object.keys(chapter.files) as filenm}
{#if currentEdit.filepath == filenm} {#if currentEdit.filepath == filenm}
<div class="truncate font-bold text-zinc-100">{shortPath(filenm)}</div> <div class="truncate font-bold text-zinc-100">{shortPath(filenm)}</div>
{:else} {:else}
@ -456,7 +456,7 @@
<button <button
on:click={() => { on:click={() => {
currentDeltasIndex = Math.max( currentDeltasIndex = Math.max(
currentPlaylist.editOffsets[chapter.session], currentPlaylist?.editOffsets[chapter.session] || 0,
1 1
); );
}} }}