1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Subtitle search on a paired server's item: the user's home server
//! passes `SearchSubtitles`, `DownloadSubtitle` and
//! `RemoveSubtitleDownload` of a `fed:` item to the item's server (the
//! server whose item it is). That server plans the play and burns
//! subtitles in, so the file must be there.
//!
//! The item's server searches with its own sites and ranking, ordered by
//! the user's own SDH and forced choices on the home server, and keeps
//! what it downloads as its own, for everyone. All the home server's users
//! together get one daily allowance on the item's server
//! (`subtitles { daily_limit_per_peer }`). It is counted under the pair,
//! never under the home server's users, whom the item's server never
//! names. The home server holds each of its users to its own per-user
//! limit first.
//!
//! Each ask arrives on the pair's connection, which proves who sends it,
//! as an assertion does: the user is the home server's local account, by
//! its stable id.
use ;
use SubtitlePreferences;
/// `SearchSubtitles` of the item's server's `item` for the home server's
/// `user`: answered with `SubtitleResults`, or `Failed`.
/// `DownloadSubtitle` of result `result` of a search for the item's
/// server's `item`, for the home server's `user`: answered with
/// `SubtitleDownloaded`, or `Failed`.
/// `RemoveSubtitleDownload` of download `download` of the item's server's
/// `item`, for the home server's `user`: answered with `Done`, or
/// `Failed`.