diff --git a/src/float.ts b/src/float.ts index 75f6e39..9b05c04 100644 --- a/src/float.ts +++ b/src/float.ts @@ -18,7 +18,11 @@ const fetchNewVideos = async (subscriptions: Array, videoProcessor for (const subscription of subscriptions) { await subscription.deleteOldVideos(); console.log(); - await Promise.all(videoProcessor.processVideos(await subscription.fetchNewVideos(settings.floatplane.videosToSearch, settings.extras.stripSubchannelPrefix))); + await Promise.all( + videoProcessor.processVideos( + await subscription.fetchNewVideos(settings.floatplane.videosToSearch, settings.extras.stripSubchannelPrefix, settings.floatplane.forceFullSearch) + ) + ); } if (settings.plex.enabled) { diff --git a/src/lib/Subscription.ts b/src/lib/Subscription.ts index 994687b..32dfcb1 100644 --- a/src/lib/Subscription.ts +++ b/src/lib/Subscription.ts @@ -81,7 +81,7 @@ export default class Subscription { return this.defaultChannel.addVideo(video); } - public async fetchNewVideos(videosToSearch = 20, stripSubchannelPrefix: boolean): Promise> { + public async fetchNewVideos(videosToSearch = 20, stripSubchannelPrefix: boolean, forceFullSearch: boolean): Promise> { const coloredTitle = `${this.defaultChannel.consoleColor || '\u001b[38;5;208m'}${this.defaultChannel.title}\u001b[0m`; const videos = []; @@ -89,7 +89,7 @@ export default class Subscription { process.stdout.write(`> Fetching latest videos from [${coloredTitle}]... Fetched ${videos.length} videos!`); for await (const video of fApi.creator.blogPostsIterable(this.creatorId, { type: 'video' })) { - if (video.guid === this.lastSeenVideo.guid) { + if (!forceFullSearch && video.guid === this.lastSeenVideo.guid) { // If we have found the last seen video, check if its downloaded. // If it is then break here and return the videos we have found. // Otherwise continue to fetch new videos up to the videosToSearch limit to ensure partially or non downloaded videos are returned. diff --git a/src/lib/defaults.ts b/src/lib/defaults.ts index d8ef1d0..7ec6d63 100644 --- a/src/lib/defaults.ts +++ b/src/lib/defaults.ts @@ -167,6 +167,7 @@ export const defaultSettings: Settings = { downloadThreads: -1, floatplane: { videosToSearch: 5, + forceFullSearch: false, videoResolution: '1080', waitForNewVideos: true, _availableResolutions: defaultResolutions, diff --git a/src/lib/types.ts b/src/lib/types.ts index 87c3adb..2e72609 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -73,6 +73,7 @@ export type Settings = { floatplane: { videoResolution: Resolution; videosToSearch: number; + forceFullSearch: boolean; waitForNewVideos: boolean; _availableResolutions: Resolutions; downloadEdge: string; diff --git a/wiki/settings.md b/wiki/settings.md index fed13cf..f5ed5aa 100644 --- a/wiki/settings.md +++ b/wiki/settings.md @@ -39,6 +39,17 @@ Number of videos to search through when looking for undownloaded videos **per su
+**floatplane.forceFullSearch**:
+Force the downloader to search the full `videosToSearch` regardless of what has been downloaded. Note: Will not result in downloaded videos being redownloaded.
+ +```json +"floatplane": { + "forceFullSearch": true +} +``` + +
+ **floatplane.videoResolution**:
Resolution to download the videos in. See `_availableResolutions` for options.