feat: add upcoming episodes and movies timeline (#17)

This commit is contained in:
2026-03-21 12:31:53 -04:00
committed by GitHub
parent 5aaf88591b
commit 1a503df2ae
42 changed files with 2405 additions and 61 deletions
@@ -2,6 +2,7 @@ import {
getContinueWatchingFeed,
getLibraryFeed,
getRecommendationsFeed,
getUpcomingFeed,
getUserStats,
getWatchCount,
getWatchHistory,
@@ -87,6 +88,27 @@ export const recommendations = os.dashboard.recommendations.use(authed).handler(
return { items };
});
export const upcoming = os.dashboard.upcoming.use(authed).handler(({ input, context }) => {
const result = getUpcomingFeed(context.user.id, {
days: input.days,
limit: input.limit,
cursor: input.cursor,
});
return {
items: result.items.map((item) => ({
...item,
posterPath: tmdbImageUrl(item.posterPath, "posters"),
streamingProvider: item.streamingProvider
? {
...item.streamingProvider,
logoPath: tmdbImageUrl(item.streamingProvider.logoPath, "logos"),
}
: null,
})),
nextCursor: result.nextCursor,
};
});
export const watchHistory = os.dashboard.watchHistory.use(authed).handler(({ input, context }) => {
const coreType = watchHistoryTypeMap[input.type];
const count = getWatchCount(context.user.id, coreType, input.period);
+1
View File
@@ -40,6 +40,7 @@ export const implementedRouter = {
dashboard: {
stats: dashboard.stats,
continueWatching: dashboard.continueWatching,
upcoming: dashboard.upcoming,
library: dashboard.library,
recommendations: dashboard.recommendations,
watchHistory: dashboard.watchHistory,