From 8e868559c9e3d05644488fc93148fe1bcc82bd5e Mon Sep 17 00:00:00 2001 From: shivraj1182 <79820642+shivraj1182@users.noreply.github.com> Date: Wed, 3 Dec 2025 11:48:56 +0530 Subject: [PATCH] feat(proto): extend AddMediaFile to accept file paths for streaming support - Modify AddMediaFileRequest message to support both inline byte data and file path references - Use oneof construct to ensure exactly one data source is provided (backward compatible) - This enables memory-efficient streaming uploads for large media files on mobile clients - Addresses issue #608: AnkiDroid OutOfMemoryError when adding large media files --- proto/anki/media.proto | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proto/anki/media.proto b/proto/anki/media.proto index 76d42931a..ddf1c5fb0 100644 --- a/proto/anki/media.proto +++ b/proto/anki/media.proto @@ -36,7 +36,13 @@ message TrashMediaFilesRequest { repeated string fnames = 1; } +// AddMediaFileRequest now supports both inline byte data and file path references. +// Using oneof ensures backward compatibility - exactly one must be provided. + message AddMediaFileRequest { string desired_name = 1; - bytes data = 2; + oneof data_source { + bytes data = 2; + string file_path = 3; + } }