WIP. A little custom music server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactory: readDirectoryStream to use Effect.fn

+18 -20
+18 -20
backend/src/file-parser.ts
··· 82 82 }).pipe(Effect.withSpan("readDirectory")); 83 83 } 84 84 85 - export function readDirectoryStream(dirPath: string, skip: string[] = []) { 86 - return Effect.gen(function* () { 87 - const fs = yield* FileSystem.FileSystem; 88 - const path = yield* Path.Path; 85 + export const readDirectoryStream = Effect.fn("read-directory-stream")(function* (dirPath: string, skip: string[] = []) { 86 + const fs = yield* FileSystem.FileSystem; 87 + const path = yield* Path.Path; 89 88 90 - const files = yield* fs.readDirectory(dirPath, { 91 - recursive: true, 92 - }); 89 + const files = yield* fs.readDirectory(dirPath, { 90 + recursive: true, 91 + }); 93 92 94 - yield* Console.log(files); 93 + yield* Console.log(files); 95 94 96 - const stream = Stream.fromIterable(files).pipe( 97 - Stream.map((file) => path.resolve(dirPath, file)), 98 - Stream.filter((file) => supportedExtensions.some((ext) => file.endsWith(ext)) === true), 99 - Stream.filter((file) => skip.includes(file) === false), 100 - Stream.mapEffect((file) => parseFile(file), { 101 - concurrency: 10, 102 - }), 103 - Stream.catchAll((err) => Stream.empty), 104 - ); 95 + const stream = Stream.fromIterable(files).pipe( 96 + Stream.map((file) => path.resolve(dirPath, file)), 97 + Stream.filter((file) => supportedExtensions.some((ext) => file.endsWith(ext)) === true), 98 + Stream.filter((file) => skip.includes(file) === false), 99 + Stream.mapEffect((file) => parseFile(file), { 100 + concurrency: 10, 101 + }), 102 + Stream.catchAll((err) => Stream.empty), 103 + ); 105 104 106 - return stream; 107 - }).pipe(Effect.withSpan("readDirectoryStream")); 108 - } 105 + return stream; 106 + });
db.sqlite

This is a binary file and will not be displayed.