From 29910a26981dfbe4a30830ed192a1fd53a819a8f Mon Sep 17 00:00:00 2001 From: Stefan <84-stefan@users.noreply.gitlab.futo.org> Date: Thu, 31 Jul 2025 14:00:17 +0000 Subject: [PATCH 1/2] docs: add section for Request Modifiers in Content types document --- docs/Content Types.md | 48 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/docs/Content Types.md b/docs/Content Types.md index 660e9855..8f0441b5 100644 --- a/docs/Content Types.md +++ b/docs/Content Types.md @@ -70,7 +70,7 @@ A feed object representing a community post with text, and optionally images. *Usage:* ```javascript -new PlatformPost{ +new PlatformPost({ id: new PlatformID(config.name, item?.id, config.id), name: item?.attributes?.title, author: getPlatformAuthorLink(item, context), @@ -276,4 +276,50 @@ new PlatformPostDetails{ }); ``` +# Request Modifiers +Sources support request modifiers that allow to modify HTTP headers before sending requests. This is useful when a source requires specific headers for authentication, content type specification, or other requirements. + +## Using requestModifier property + +``` +new HLSSource({ +    //Your other properties... +    requestModifier: { +        headers: { +            "Referer": "https://www.example.com/", +            "Origin": "https://www.example.com" +        } +    } +}) +``` + +## Custom source implementation + +``` +class YourAudioSource extends AudioUrlRangeSource { + constructor(obj) { + super(obj); + } + + getRequestModifier() { + return new YourRequestModifier(); + } +} + +class YourRequestModifier extends RequestModifier { + constructor() { + super(); + } + modifyRequest(url, headers) { + //modify headers + + return { + url: url, + headers: headers + } + } +} + +``` + From 4c0c1abb4bf6cbad6d9df496bf3873f3a86cf1f7 Mon Sep 17 00:00:00 2001 From: zvonimir Date: Thu, 31 Jul 2025 18:34:24 +0200 Subject: [PATCH 2/2] fix: erroring out when thumbnails are null which causes sync to reset --- .../api/media/models/video/SerializedPlatformVideo.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/futo/platformplayer/api/media/models/video/SerializedPlatformVideo.kt b/app/src/main/java/com/futo/platformplayer/api/media/models/video/SerializedPlatformVideo.kt index eadffc8d..6144e3e6 100644 --- a/app/src/main/java/com/futo/platformplayer/api/media/models/video/SerializedPlatformVideo.kt +++ b/app/src/main/java/com/futo/platformplayer/api/media/models/video/SerializedPlatformVideo.kt @@ -16,7 +16,7 @@ open class SerializedPlatformVideo( override val contentType: ContentType = ContentType.MEDIA, override val id: PlatformID, override val name: String, - override val thumbnails: Thumbnails, + override val thumbnails: Thumbnails = Thumbnails(), override val author: PlatformAuthorLink, @kotlinx.serialization.Serializable(with = OffsetDateTimeNullableSerializer::class) @JsonNames("datetime", "dateTime")