mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
홈 페이지와 갤러리 페이지에서 사진 및 동영상만 표시되도록 개선
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import { getAllFileInfos } from "$lib/indexedDB";
|
||||
|
||||
export const requestFreshFilesRetrieval = async (limit = 8) => {
|
||||
export const requestFreshMediaFilesRetrieval = async (limit = 8) => {
|
||||
const files = await getAllFileInfos();
|
||||
files.sort(
|
||||
(a, b) =>
|
||||
(b.createdAt ?? b.lastModifiedAt).getTime() - (a.createdAt ?? a.lastModifiedAt).getTime(),
|
||||
);
|
||||
return files.slice(0, limit);
|
||||
return files
|
||||
.filter(
|
||||
({ contentType }) => contentType.startsWith("image/") || contentType.startsWith("video/"),
|
||||
)
|
||||
.slice(0, limit);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user