Skip to content

Commit 55002e5

Browse files
authored
Merge pull request #443 from cronxco/bug-squash
🐛 Fix Goodreads and Untappd
2 parents 4a35424 + d9a190f commit 55002e5

File tree

15 files changed

+676
-114
lines changed

15 files changed

+676
-114
lines changed

app/Integrations/Goodreads/GoodreadsPlugin.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,20 @@ public static function getGroupConfigurationSchema(): array
5151

5252
public static function getConfigurationSchema($instanceType = null): array
5353
{
54-
return [
55-
'update_frequency_minutes' => [
56-
'type' => 'integer',
57-
'label' => 'Update Frequency (minutes)',
58-
'required' => true,
59-
'min' => 15,
60-
'max' => 1440,
61-
'default' => 60,
62-
'description' => 'How often to check for new reading activity (15-1440 minutes)',
63-
],
64-
];
54+
return array_merge(
55+
static::getGroupConfigurationSchema(),
56+
[
57+
'update_frequency_minutes' => [
58+
'type' => 'integer',
59+
'label' => 'Update Frequency (minutes)',
60+
'required' => true,
61+
'min' => 15,
62+
'max' => 1440,
63+
'default' => 60,
64+
'description' => 'How often to check for new reading activity (15-1440 minutes)',
65+
],
66+
]
67+
);
6568
}
6669

6770
public static function getInstanceTypes(): array

app/Integrations/Karakeep/KarakeepPlugin.php

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,26 +60,29 @@ public static function getGroupConfigurationSchema(): array
6060

6161
public static function getConfigurationSchema($instanceType = null): array
6262
{
63-
return [
64-
'update_frequency_minutes' => [
65-
'type' => 'integer',
66-
'label' => 'Update Frequency (minutes)',
67-
'required' => true,
68-
'min' => 15,
69-
'max' => 1440,
70-
'default' => 30,
71-
'description' => 'How often to sync bookmarks (15-1440 minutes)',
72-
],
73-
'fetch_limit' => [
74-
'type' => 'integer',
75-
'label' => 'Fetch Limit',
76-
'required' => false,
77-
'min' => 10,
78-
'max' => 100,
79-
'default' => 50,
80-
'description' => 'Number of bookmarks to fetch per sync (10-100)',
81-
],
82-
];
63+
return array_merge(
64+
static::getGroupConfigurationSchema(),
65+
[
66+
'update_frequency_minutes' => [
67+
'type' => 'integer',
68+
'label' => 'Update Frequency (minutes)',
69+
'required' => true,
70+
'min' => 15,
71+
'max' => 1440,
72+
'default' => 30,
73+
'description' => 'How often to sync bookmarks (15-1440 minutes)',
74+
],
75+
'fetch_limit' => [
76+
'type' => 'integer',
77+
'label' => 'Fetch Limit',
78+
'required' => false,
79+
'min' => 10,
80+
'max' => 100,
81+
'default' => 50,
82+
'description' => 'Number of bookmarks to fetch per sync (10-100)',
83+
],
84+
]
85+
);
8386
}
8487

8588
public static function getInstanceTypes(): array

app/Integrations/Outline/OutlinePlugin.php

Lines changed: 67 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -93,72 +93,83 @@ public static function getConfigurationSchema($instanceType = null): array
9393
];
9494

9595
if ($instanceType === 'recent_daynotes') {
96-
return array_merge($baseSchema, [
97-
'update_frequency_minutes' => [
98-
'type' => 'integer',
99-
'label' => 'Update Frequency (minutes)',
100-
'required' => true,
101-
'min' => 5,
102-
'max' => 60,
103-
'default' => 15,
104-
'description' => 'How often to sync recent day notes (5-60 minutes)',
105-
],
106-
'document_limit' => [
107-
'type' => 'integer',
108-
'label' => 'Document Limit',
109-
'required' => false,
110-
'min' => 1,
111-
'max' => 20,
112-
'default' => 5,
113-
'description' => 'Number of most recent day notes to sync',
114-
],
115-
]);
96+
return array_merge(
97+
static::getGroupConfigurationSchema(),
98+
$baseSchema,
99+
[
100+
'update_frequency_minutes' => [
101+
'type' => 'integer',
102+
'label' => 'Update Frequency (minutes)',
103+
'required' => true,
104+
'min' => 5,
105+
'max' => 60,
106+
'default' => 15,
107+
'description' => 'How often to sync recent day notes (5-60 minutes)',
108+
],
109+
'document_limit' => [
110+
'type' => 'integer',
111+
'label' => 'Document Limit',
112+
'required' => false,
113+
'min' => 1,
114+
'max' => 20,
115+
'default' => 5,
116+
'description' => 'Number of most recent day notes to sync',
117+
],
118+
]
119+
);
116120
}
117121

118122
if ($instanceType === 'recent_documents') {
119-
return array_merge($baseSchema, [
120-
'update_frequency_minutes' => [
123+
return array_merge(
124+
static::getGroupConfigurationSchema(),
125+
$baseSchema,
126+
[
127+
'update_frequency_minutes' => [
128+
'type' => 'integer',
129+
'label' => 'Update Frequency (minutes)',
130+
'required' => true,
131+
'min' => 60,
132+
'max' => 1440,
133+
'default' => 120,
134+
'description' => 'How often to sync recent documents (1-24 hours)',
135+
],
136+
'document_limit' => [
137+
'type' => 'integer',
138+
'label' => 'Document Limit',
139+
'required' => false,
140+
'min' => 1,
141+
'max' => 50,
142+
'default' => 10,
143+
'description' => 'Number of most recent documents to sync',
144+
],
145+
]
146+
);
147+
}
148+
149+
// Legacy schema for backward compatibility
150+
return array_merge(
151+
static::getGroupConfigurationSchema(),
152+
$baseSchema,
153+
[
154+
'poll_interval_minutes' => [
121155
'type' => 'integer',
122-
'label' => 'Update Frequency (minutes)',
156+
'label' => 'Polling Interval (minutes)',
123157
'required' => true,
124-
'min' => 60,
125-
'max' => 1440,
126-
'default' => 120,
127-
'description' => 'How often to sync recent documents (1-24 hours)',
158+
'min' => 1,
159+
'default' => (int) (config('services.outline.poll_interval_minutes') ?? 15),
160+
],
161+
'since_cursor' => [
162+
'type' => 'string',
163+
'label' => 'Since Cursor (updatedAt ISO8601)',
164+
'required' => false,
128165
],
129-
'document_limit' => [
166+
'backfill_years' => [
130167
'type' => 'integer',
131-
'label' => 'Document Limit',
168+
'label' => 'Backfill Years',
132169
'required' => false,
133-
'min' => 1,
134-
'max' => 50,
135-
'default' => 10,
136-
'description' => 'Number of most recent documents to sync',
170+
'default' => 3,
137171
],
138172
]);
139-
}
140-
141-
// Legacy schema for backward compatibility
142-
return array_merge($baseSchema, [
143-
'poll_interval_minutes' => [
144-
'type' => 'integer',
145-
'label' => 'Polling Interval (minutes)',
146-
'required' => true,
147-
'min' => 1,
148-
'default' => (int) (config('services.outline.poll_interval_minutes') ?? 15),
149-
],
150-
'since_cursor' => [
151-
'type' => 'string',
152-
'label' => 'Since Cursor (updatedAt ISO8601)',
153-
'required' => false,
154-
],
155-
'backfill_years' => [
156-
'type' => 'integer',
157-
'label' => 'Backfill Years',
158-
'required' => false,
159-
'default' => 3,
160-
],
161-
]);
162173
}
163174

164175
public static function getInstanceTypes(): array

app/Integrations/Untappd/UntappdPlugin.php

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,20 @@ public static function getGroupConfigurationSchema(): array
5151

5252
public static function getConfigurationSchema($instanceType = null): array
5353
{
54-
return [
55-
'update_frequency_minutes' => [
56-
'type' => 'integer',
57-
'label' => 'Update Frequency (minutes)',
58-
'required' => true,
59-
'min' => 15,
60-
'max' => 1440,
61-
'default' => 30,
62-
'description' => 'How often to check for new check-ins (15-1440 minutes)',
63-
],
64-
];
54+
return array_merge(
55+
static::getGroupConfigurationSchema(),
56+
[
57+
'update_frequency_minutes' => [
58+
'type' => 'integer',
59+
'label' => 'Update Frequency (minutes)',
60+
'required' => true,
61+
'min' => 15,
62+
'max' => 1440,
63+
'default' => 30,
64+
'description' => 'How often to check for new check-ins (15-1440 minutes)',
65+
],
66+
]
67+
);
6568
}
6669

6770
public static function getInstanceTypes(): array
@@ -93,9 +96,9 @@ public static function getDomain(): string
9396
public static function getActionTypes(): array
9497
{
9598
return [
96-
'drank_beer' => [
99+
'drank' => [
97100
'icon' => 'fas.beer-mug-empty',
98-
'display_name' => 'Drank Beer',
101+
'display_name' => 'Drank',
99102
'description' => 'Drank a beer',
100103
'display_with_object' => true,
101104
'value_unit' => null,

app/Jobs/CheckIntegrationUpdates.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use App\Jobs\OAuth\GoCardless\GoCardlessAccountPull;
99
use App\Jobs\OAuth\GoCardless\GoCardlessBalancePull;
1010
use App\Jobs\OAuth\GoCardless\GoCardlessTransactionPull;
11+
use App\Jobs\OAuth\Goodreads\GoodreadsRssPull;
1112
use App\Jobs\OAuth\GoogleCalendar\GoogleCalendarEventsPull;
1213
use App\Jobs\OAuth\Hevy\HevyWorkoutPull;
1314
use App\Jobs\OAuth\Karakeep\KarakeepBookmarksPull;
@@ -33,6 +34,7 @@
3334
use App\Jobs\OAuth\Oura\OuraWorkoutsPull;
3435
use App\Jobs\OAuth\Reddit\RedditSavedPull;
3536
use App\Jobs\OAuth\Spotify\SpotifyListeningPull;
37+
use App\Jobs\OAuth\Untappd\UntappdRssPull;
3638
use App\Models\Integration;
3739
use Exception;
3840
use Illuminate\Bus\Queueable;
@@ -224,6 +226,8 @@ private function getFetchJobsForIntegration(Integration $integration): array
224226
'karakeep' => $this->getKarakeepFetchJobs($integration),
225227
'google-calendar' => $this->getGoogleCalendarFetchJobs($integration),
226228
'fetch' => $this->getFetchFetchJobs($integration),
229+
'goodreads' => $this->getGoodreadsFetchJobs($integration),
230+
'untappd' => $this->getUntappdFetchJobs($integration),
227231
// Add other services here as they are implemented
228232
default => [],
229233
};
@@ -366,4 +370,24 @@ private function getFetchFetchJobs(Integration $integration): array
366370
default => [],
367371
};
368372
}
373+
374+
private function getGoodreadsFetchJobs(Integration $integration): array
375+
{
376+
$instanceType = $integration->instance_type ?: 'rss_feed';
377+
378+
return match ($instanceType) {
379+
'rss_feed' => [GoodreadsRssPull::class],
380+
default => [],
381+
};
382+
}
383+
384+
private function getUntappdFetchJobs(Integration $integration): array
385+
{
386+
$instanceType = $integration->instance_type ?: 'rss_feed';
387+
388+
return match ($instanceType) {
389+
'rss_feed' => [UntappdRssPull::class],
390+
default => [],
391+
};
392+
}
369393
}

0 commit comments

Comments
 (0)