Skip to content

Commit

Permalink
Fix for handling videos with no levels
Browse files Browse the repository at this point in the history
  • Loading branch information
Inrixia committed Apr 18, 2024
1 parent edc0e95 commit dca43ec
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "floatplane-plex-downloader",
"version": "5.13.0",
"version": "5.13.1",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/Subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ export default class Subscription {
if (blogPost.videoAttachments.length > 1) {
dateOffset++;
video = await Subscription.AttachmentsCache.get(attachmentId);
// Skip videos with no levels
if (video.levels.length === 0) continue;
videoTitle = removeRepeatedSentences(videoTitle, video.title);
}

Expand Down
6 changes: 2 additions & 4 deletions src/lib/VideoBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,12 @@ export class VideoBase extends Attachment {
await VideoBase.DeliverySemaphore.obtain();

// Send download request video, assume the first video attached is the actual video as most will not have more than one video
const {
groups: [delivery],
} = await fApi.cdn.delivery("download", this.attachmentId);
const deliveryInfo = await fApi.cdn.delivery("download", this.attachmentId);

// Release the semaphore after DeliveryTimeout
setTimeout(() => VideoBase.DeliverySemaphore.release(), VideoBase.DeliveryTimeout);

return delivery;
return deliveryInfo?.groups?.[0];
}

protected async getVideoStream(quality: string): Promise<ReturnType<typeof fApi.got.stream>> {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import "dotenv/config";
import json5 from "json5";
const { parse } = json5;

export const DownloaderVersion = "5.13.0";
export const DownloaderVersion = "5.13.1";

import type { PartialArgs, Settings } from "../types.js";

Expand Down

0 comments on commit dca43ec

Please sign in to comment.