mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00

- Dropped the protobuf extensions in favor of explicitly listing out methods in both services if we want to implement both, as it's clearer. - Move Service/Method wrappers into a separate crate that the various clients can import, to easily get at the list of backend services and their correct indices and comments.
39 lines
1 KiB
Protocol Buffer
39 lines
1 KiB
Protocol Buffer
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
syntax = "proto3";
|
|
|
|
option java_multiple_files = true;
|
|
|
|
package anki.media;
|
|
|
|
import "anki/generic.proto";
|
|
|
|
service MediaService {
|
|
rpc CheckMedia(generic.Empty) returns (CheckMediaResponse);
|
|
rpc AddMediaFile(AddMediaFileRequest) returns (generic.String);
|
|
rpc TrashMediaFiles(TrashMediaFilesRequest) returns (generic.Empty);
|
|
rpc EmptyTrash(generic.Empty) returns (generic.Empty);
|
|
rpc RestoreTrash(generic.Empty) returns (generic.Empty);
|
|
}
|
|
|
|
// Implicitly includes any of the above methods that are not listed in the
|
|
// backend service.
|
|
service BackendMediaService {}
|
|
|
|
message CheckMediaResponse {
|
|
repeated string unused = 1;
|
|
repeated string missing = 2;
|
|
repeated int64 missing_media_notes = 3;
|
|
string report = 4;
|
|
bool have_trash = 5;
|
|
}
|
|
|
|
message TrashMediaFilesRequest {
|
|
repeated string fnames = 1;
|
|
}
|
|
|
|
message AddMediaFileRequest {
|
|
string desired_name = 1;
|
|
bytes data = 2;
|
|
}
|