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
This commit is contained in:
shivraj1182 2025-12-03 11:48:56 +05:30 committed by GitHub
parent 2d4de33cf3
commit 8e868559c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}
}