Fix
This commit is contained in:
		@@ -43,7 +43,11 @@ export async function batchProcess(abortSignal?: AbortSignal): Promise<void> {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Load feed URLs from file
 | 
					    // Load feed URLs from file
 | 
				
			||||||
    const feedUrls = await loadFeedUrls();
 | 
					    const { fetchActiveFeeds } = await import("../services/database.js");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const feeds = await fetchActiveFeeds();
 | 
				
			||||||
 | 
					    const feedUrls = feeds.map((feed) => feed.url).filter((url) => !!url);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (feedUrls.length === 0) {
 | 
					    if (feedUrls.length === 0) {
 | 
				
			||||||
      console.log("ℹ️  No feed URLs found.");
 | 
					      console.log("ℹ️  No feed URLs found.");
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
@@ -100,25 +104,6 @@ export async function batchProcess(abortSignal?: AbortSignal): Promise<void> {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * Load feed URLs from configuration file
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
async function loadFeedUrls(): Promise<string[]> {
 | 
					 | 
				
			||||||
  try {
 | 
					 | 
				
			||||||
    const data = await fs.readFile(config.paths.feedUrlsFile, "utf-8");
 | 
					 | 
				
			||||||
    return data
 | 
					 | 
				
			||||||
      .split("\n")
 | 
					 | 
				
			||||||
      .map((url) => url.trim())
 | 
					 | 
				
			||||||
      .filter((url) => url.length > 0 && !url.startsWith("#"));
 | 
					 | 
				
			||||||
  } catch (err) {
 | 
					 | 
				
			||||||
    console.warn(
 | 
					 | 
				
			||||||
      `⚠️  Failed to read feed URLs file: ${config.paths.feedUrlsFile}`,
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
    console.warn("📝 Please create the file with one RSS URL per line.");
 | 
					 | 
				
			||||||
    return [];
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Process a single feed URL and discover new articles
 | 
					 * Process a single feed URL and discover new articles
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@@ -735,7 +720,9 @@ export async function addNewFeedUrl(feedUrl: string): Promise<void> {
 | 
				
			|||||||
      active: true,
 | 
					      active: true,
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    console.log(`✅ Feed URL added: ${feedUrl} (Title: ${feedTitle}, Category: ${category})`);
 | 
					    console.log(
 | 
				
			||||||
 | 
					      `✅ Feed URL added: ${feedUrl} (Title: ${feedTitle}, Category: ${category})`,
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
  } catch (error) {
 | 
					  } catch (error) {
 | 
				
			||||||
    console.error(`❌ Failed to add feed URL: ${feedUrl}`, error);
 | 
					    console.error(`❌ Failed to add feed URL: ${feedUrl}`, error);
 | 
				
			||||||
    throw error;
 | 
					    throw error;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user