MCPcopy Create free account
hub / github.com/DialmasterOrg/Youtarr / readChannels

Method readChannels

server/modules/channelModule.js:1025–1039  ·  view source on GitHub ↗

* Read all enabled channels from the database. * Also backfills poster.jpg files for existing channel folders. * @returns {Promise } - Array of channel objects with url, uploader, channel_id, auto_download_enabled_tabs, available_tabs, sub_folder, and video_quality

()

Source from the content-addressed store, hash-verified

1023 * @returns {Promise<Array>} - Array of channel objects with url, uploader, channel_id, auto_download_enabled_tabs, available_tabs, sub_folder, and video_quality
1024 */
1025 async readChannels() {
1026 try {
1027 const channels = await Channel.findAll({
1028 where: { enabled: true },
1029 });
1030
1031 // Backfill poster.jpg for existing channel folders
1032 this.backfillChannelPosters(channels);
1033
1034 return channels.map((channel) => this.mapChannelListEntry(channel));
1035 } catch (err) {
1036 logger.error({ err }, 'Error reading channels from database');
1037 return [];
1038 }
1039 }
1040
1041 /**
1042 * Retrieve channels in a paginated format with optional filtering/sorting

Callers 2

Calls 2

mapChannelListEntryMethod · 0.95

Tested by

no test coverage detected