Skip to content

Commit

Permalink
feat(wrapped): keep it for january too (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeopJr authored Dec 10, 2024
1 parent 7f8c8d3 commit 6eac5ed
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/Services/Accounts/InstanceAccount.vala
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,21 @@ public class Tuba.InstanceAccount : API.Account, Streamable {
API.AnnualReports? annual_report;
private void gather_annual_report () {
var now = new GLib.DateTime.now ();
if (now.get_month () != 12) return;

var year = now.get_year ();
new Request.GET (@"/api/v1/annual_reports/$(now.get_year ())")
int year = 0;
switch (now.get_month ()) {
case 12:
year = now.get_year ();
break;
case 1:
year = now.get_year () - 1;
break;
default:
return;
}


new Request.GET (@"/api/v1/annual_reports/$(year)")
.with_account (accounts.active)
.then ((in_stream) => {
var parser = Network.get_parser_from_inputstream (in_stream);
Expand Down

0 comments on commit 6eac5ed

Please sign in to comment.