Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/Attachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { nll } from "./logging/ProgressLogger";
type AttachmentInfo = {
partialBytes?: number;
muxedBytes?: number;
muxed?: boolean;
filePath: string;
releaseDate: number;
videoTitle: string;
Expand Down
5 changes: 5 additions & 0 deletions src/lib/Video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ export class Video extends Attachment {
}
}
}
const attrStore = await this.attachmentInfo();
attrStore.muxed = true;
telegramMsg(`Downloaded ${this.videoTitle} from ${this.channelTitle}`);
discordEmbed("New video downloaded", this);
this.logger.done(chalk`{cyan Downloaded!}`);
Expand Down Expand Up @@ -217,9 +219,12 @@ export class Video extends Attachment {
public async getState() {
const attrStore = await this.attachmentInfo();

if (settings.floatplane.trackVideoIDs && attrStore.muxed) return VideoState.Muxed;

const muxedBytes = await Video.pathBytes(this.muxedPath);
// If considerAllNonPartialDownloaded is true, return true if the file exists. Otherwise check if the file is the correct size
if (settings.extras.considerAllNonPartialDownloaded && muxedBytes !== -1) attrStore.muxedBytes = muxedBytes;
if (settings.floatplane.trackVideoIDs && attrStore.muxedBytes === muxedBytes) attrStore.muxed = true;
if (attrStore.muxedBytes === muxedBytes) return VideoState.Muxed;

const partialBytes = await Video.pathBytes(this.partialPath);
Expand Down
1 change: 1 addition & 0 deletions src/lib/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const defaultSettings: Settings = {
videosToSearch: 5,
videoResolution: "1080",
waitForNewVideos: true,
trackVideoIDs: false,
seekAndDestroy: [],
},
maxDownloadSpeed: -1,
Expand Down
1 change: 1 addition & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export type Settings = {
videoResolution: Resolution;
videosToSearch: number;
waitForNewVideos: boolean;
trackVideoIDs: boolean;
seekAndDestroy: string[];
};
maxDownloadSpeed: number;
Expand Down
13 changes: 13 additions & 0 deletions wiki/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ Controls if the downloader should wait for new videos to download after finishin

<br>


**floatplane.trackVideoIDs**:
Controls if the downloader should redownload a video if the video file can't be found. Setting this to `true` will not redownload even if the video file has been moved, renamed or deleted.
If you move or rename a video file with this enabled it will not automatically be deleted after `daysToKeepVideos`.

```json
"floatplane": {
"trackVideoIDs": true
}
```

<br>

**floatplane.seekAndDestroy**:
You can put video id's here and the downloader will find, sort and download them normally.

Expand Down
Loading