diff --git a/extras/rpc-spec.txt b/extras/rpc-spec.txt index 7c6878956..6f4a9d707 100644 --- a/extras/rpc-spec.txt +++ b/extras/rpc-spec.txt @@ -518,8 +518,8 @@ Method name: "session-set" Request arguments: one or more of 4.1's arguments, except: "blocklist-size", - "config-dir", "rpc-version", "rpc-version-minimum", and - "version" + "config-dir", "rpc-version", "rpc-version-minimum", + "version", and "session-id" Response arguments: none 4.1.2. Accessors @@ -768,6 +768,7 @@ | | yes | torrent-add | new return arg "torrent-duplicate" ------+---------+-----------+----------------------+------------------------------- 16 | 3.00 | yes | session-get | new request arg "fields" + | | yes | session-get | new arg "session-id" 5.1. Upcoming Breakage diff --git a/libtransmission/quark.c b/libtransmission/quark.c index 466bb3563..21b577482 100644 --- a/libtransmission/quark.c +++ b/libtransmission/quark.c @@ -315,6 +315,7 @@ static const struct tr_key_struct my_static[] = { "seederCount", 11 }, { "seeding-time-seconds", 20 }, { "session-count", 13 }, + { "session-id", 10 }, { "sessionCount", 12 }, { "show-backup-trackers", 20 }, { "show-extra-peer-details", 23 }, diff --git a/libtransmission/quark.h b/libtransmission/quark.h index b67f2c9ba..cbbc9d8a5 100644 --- a/libtransmission/quark.h +++ b/libtransmission/quark.h @@ -316,6 +316,7 @@ enum TR_KEY_seederCount, TR_KEY_seeding_time_seconds, TR_KEY_session_count, + TR_KEY_session_id, TR_KEY_sessionCount, TR_KEY_show_backup_trackers, TR_KEY_show_extra_peer_details, diff --git a/libtransmission/rpcimpl.c b/libtransmission/rpcimpl.c index b17490091..211a1a8c6 100644 --- a/libtransmission/rpcimpl.c +++ b/libtransmission/rpcimpl.c @@ -26,6 +26,7 @@ #include "platform-quota.h" /* tr_device_info_get_free_space() */ #include "rpcimpl.h" #include "session.h" +#include "session-id.h" #include "torrent.h" #include "utils.h" #include "variant.h" @@ -2260,6 +2261,10 @@ addSessionField (tr_session * s, tr_variantDictAddStr (d, key, str); break; } + + case TR_KEY_session_id: + tr_variantDictAddStr (d, key, tr_session_id_get_current (s->session_id)); + break; } }