1- import type { dbGuildYouTubeSubscriptionsTable } from "../../db/schema " ;
1+ import type { Platform } from "../../types/types.d.ts " ;
22
3+ import {
4+ dbGuildYouTubeSubscriptionsTable ,
5+ dbYouTubeTable ,
6+ } from "../../db/schema" ;
37import { env } from "../../config" ;
4- import { updateVideoId } from "../database" ;
58import { dbYouTubeGetAllChannelsToTrack } from "../../db/youtube" ;
69import { discordGetAllGuildsTrackingChannel } from "../../db/discord" ;
7- import { Platform } from "../../types/types" ;
810
911import getChannelDetails from "./getChannelDetails" ;
1012
@@ -20,7 +22,7 @@ export default async function fetchLatestUploads() {
2022 console . log ( "Fetching latest uploads..." ) ;
2123
2224 const channels = await dbYouTubeGetAllChannelsToTrack ( ) ;
23- const channelDict : Record < string , string > = { } ;
25+ const channelDict : Record < string , typeof dbYouTubeTable . $inferSelect > = { } ;
2426
2527 if ( ! channels || ! channels . success || channels . data . length === 0 ) {
2628 console . log ( "No channels to track." ) ;
@@ -29,14 +31,14 @@ export default async function fetchLatestUploads() {
2931 }
3032
3133 channels . data . forEach ( ( channel ) => {
32- if ( ! channel . youtube_channel_id || ! channel . latest_video_id ) {
34+ if ( ! channel . youtubeChannelId || ! channel . latestAllId ) {
3335 console . error (
3436 "Channel ID or latest video ID is missing in fetchLatestUploads" ,
3537 ) ;
3638
3739 return ;
3840 }
39- channelDict [ channel . youtube_channel_id ] = channel . latest_video_id ;
41+ channelDict [ channel . youtubeChannelId ] = channel ;
4042 } ) ;
4143
4244 const chunkSize = 50 ;
0 commit comments