Refactor: Suffixe in helpers/

This commit is contained in:
MasterAcnolo
2026-03-18 09:13:47 +01:00
parent 1c27cc19cf
commit da393b19d9
13 changed files with 19 additions and 19 deletions

View File

@@ -0,0 +1,27 @@
function parseVideo(data) {
return {
type: "video",
...data
};
}
function parsePlaylist(data) {
return {
type: "playlist",
title: data.title || data.id,
channel: data.uploader,
count: data.entries.length,
videos: (data.entries || []).map(v => ({
id: v.id,
title: v.title,
url: v.webpage_url,
duration: v.duration,
thumbnail: v.thumbnail,
uploader: v.uploader
}))
};
}
module.exports = { parseVideo, parsePlaylist };