Skip to content

Instantly share code, notes, and snippets.

@Ntropish
Created July 5, 2015 02:36
Show Gist options
  • Save Ntropish/bb43a53f33fe980bf28e to your computer and use it in GitHub Desktop.
Save Ntropish/bb43a53f33fe980bf28e to your computer and use it in GitHub Desktop.
return {
name:list.name,
videos:videos.filter(function(video){
return list.id === video.listId;
}).concatMap(function(video){
return Array.zip(
bookmarks.filter(function(bookmark){
return video.id === bookmark.videoId;
}),
boxarts.filter(function(boxart){
return video.id === boxart.videoId;
}).reduce(function(keep, bookmark){
return keep.width > bookmark.width ? bookmark : keep;
}),
function(a, b){
return {
id:video.id,
title:video.title,
time:a.time,
boxart:b.url
};
}
);
})};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment