@@ -25,16 +25,20 @@ fn main() -> Result<()> {
2525 let mut crobot_updates = Vec :: new ( ) ;
2626
2727 let mut imported = 0 ;
28+ let mut originated = 0 ;
29+
2830 for qpay_user in members {
2931 match qpay_user. in_membership_db ( & mut pg, & table) {
3032 postgres:: InDb :: Empty => {
3133 qpay_user
3234 . create_membership ( & mut pg, & table)
35+ . with_context ( || "Importing member" )
3336 . with_context ( || format ! ( "{:#?}" , qpay_user) ) ?;
3437
3538 crobot_updates. push (
3639 qpay_user
3740 . add_username ( & mut pg, & table)
41+ . with_context ( || "Importing discord" )
3842 . with_context ( || format ! ( "{:#?}" , qpay_user) ) ?,
3943 ) ;
4044
@@ -43,17 +47,26 @@ fn main() -> Result<()> {
4347 postgres:: InDb :: NeedsDiscord => crobot_updates. push (
4448 qpay_user
4549 . add_username ( & mut pg, & table)
50+ . with_context ( || "Importing discord" )
4651 . with_context ( || format ! ( "{:#?}" , qpay_user) ) ?,
4752 ) ,
48- _ => ( ) ,
53+ postgres:: InDb :: NeedsOrigination => {
54+ qpay_user
55+ . add_origination ( & mut pg, & table)
56+ . with_context ( || "Importing origination" )
57+ . with_context ( || format ! ( "{:#?}" , qpay_user) ) ?;
58+ originated += 1 ;
59+ ( )
60+ }
61+ postgres:: InDb :: Full => ( ) ,
4962 }
5063 }
5164
5265 let discord_imported = crobot:: send_webhook ( crobot_updates) ?;
5366
5467 println ! (
55- "Imported {}, {} discord usernames" ,
56- imported, discord_imported
68+ "Imported {}, {} discord usernames, {} originated " ,
69+ imported, discord_imported, originated
5770 ) ;
5871
5972 Ok ( ( ) )
0 commit comments